|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // $Header$ |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __CCONSOLEREADER_H__ |
|
19 #define __CCONSOLEREADER_H__ |
|
20 |
|
21 //----------------------------------------------------------------------------- |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32cons.h> |
|
25 |
|
26 //----------------------------------------------------------------------------- |
|
27 |
|
28 #include "GT0149.h" |
|
29 |
|
30 //----------------------------------------------------------------------------- |
|
31 |
|
32 class CConsoleReader : public CActive |
|
33 { |
|
34 public: // Methods |
|
35 |
|
36 static CConsoleReader* NewL(CConsoleBase& aConsole); |
|
37 ~CConsoleReader(); |
|
38 |
|
39 void ReadLine(TDes& aData, TRequestStatus& aCallbackStatus); |
|
40 void ReadChar(TDes& aChar, TRequestStatus& aCallbackStatus); |
|
41 void ReadCancel(); |
|
42 |
|
43 private: // Methods from CActive |
|
44 |
|
45 virtual void RunL(); |
|
46 virtual void DoCancel(); |
|
47 |
|
48 private: // Methods |
|
49 |
|
50 CConsoleReader(CConsoleBase& aConsole); |
|
51 void ProcessKeyPress(TChar aChar); |
|
52 void IssueRequest(); |
|
53 |
|
54 private: // Enums |
|
55 |
|
56 enum TReadMode |
|
57 { |
|
58 ELineMode = 0, |
|
59 ECharMode |
|
60 }; |
|
61 |
|
62 private: // Attributes |
|
63 |
|
64 CConsoleBase &iConsole; |
|
65 TDes *iData; |
|
66 TRequestStatus *iCallbackStatus; |
|
67 TReadMode iMode; |
|
68 |
|
69 }; |
|
70 |
|
71 #endif // __CCONSOLEREADER_H__ |