|
1 // terminalkeyboardcons.h |
|
2 // |
|
3 // Copyright (c) 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Accenture - Initial contribution |
|
11 // |
|
12 #ifndef TERMINALKEYBOARDCONS_H |
|
13 #define TERMINALKEYBOARDCONS_H |
|
14 |
|
15 #include <e32std.h> |
|
16 #include <e32cons.h> |
|
17 #include <TcDriverIf.h> |
|
18 #include <fshell/consoleextensions.h> |
|
19 #include "vtc_cursor_tracker.h" |
|
20 class CMessageWatcher; |
|
21 |
|
22 //#define SHOW_TEXTSHELL_BORDERS |
|
23 |
|
24 NONSHARABLE_CLASS(CTerminalKeyboardCons) : public CConsoleBase, public MIosrvConsoleHelper, public MConsoleScrollHandler |
|
25 { |
|
26 public: |
|
27 CTerminalKeyboardCons(); |
|
28 virtual ~CTerminalKeyboardCons(); |
|
29 |
|
30 public: // From CConsoleBase |
|
31 virtual TInt Create(const TDesC& aTitle, TSize aSize); |
|
32 virtual void Read(TRequestStatus& aStatus); |
|
33 virtual void ReadCancel(); |
|
34 virtual void Write(const TDesC& aDes); |
|
35 virtual TPoint CursorPos() const; |
|
36 virtual void SetCursorPosAbs(const TPoint& aPoint); |
|
37 virtual void SetCursorPosRel(const TPoint& aPoint); |
|
38 virtual void SetCursorHeight(TInt aPercentage); |
|
39 virtual void SetTitle(const TDesC& aTitle); |
|
40 virtual void ClearScreen(); |
|
41 virtual void ClearToEndOfLine(); |
|
42 virtual TSize ScreenSize() const; |
|
43 virtual TKeyCode KeyCode() const; |
|
44 virtual TUint KeyModifiers() const; |
|
45 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); |
|
46 |
|
47 private: // From MConsoleScrollHandler |
|
48 void ConsoleScrolled(TInt aNumberOfLines); |
|
49 |
|
50 private: |
|
51 virtual void ConstructL(const TDesC& aTitle, const TSize& aSize); |
|
52 void Update(); |
|
53 void MessageReceived(TInt aError); |
|
54 void Transmit(const TDesC& aBuf, TInt aWidth, TInt aHeight); |
|
55 |
|
56 protected: |
|
57 TRequestStatus* iClientStatus; |
|
58 TBool iGotKey; |
|
59 TKeyCode iKeyCode; |
|
60 TUint iKeyModifiers; |
|
61 CConsoleBase* iUnderlyingConsole; |
|
62 RTcDriver iDriver; |
|
63 |
|
64 RBuf iTextBuffer; |
|
65 RBuf iMungedTextBuffer; // With the borders |
|
66 TCursorTracker iTracker; |
|
67 CMessageWatcher* iWatcher; |
|
68 friend class CMessageWatcher; |
|
69 TBool iBacktickModifierDown; |
|
70 }; |
|
71 |
|
72 #endif // TERMINALKEYBOARDCONS_H |