|
1 // remote_console.h |
|
2 // |
|
3 // Copyright (c) 2005 - 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 |
|
13 #ifndef __REMOTE_CONSOLE_H__ |
|
14 #define __REMOTE_CONSOLE_H__ |
|
15 |
|
16 #include <e32cons.h> |
|
17 #include <es_sock.h> |
|
18 #include "remote_console_config.h" |
|
19 |
|
20 |
|
21 #ifdef EKA2 |
|
22 NONSHARABLE_CLASS(CRemoteConsole) |
|
23 #else |
|
24 class CRemoteConsole |
|
25 #endif |
|
26 : public CConsoleBase |
|
27 { |
|
28 public: |
|
29 CRemoteConsole(); |
|
30 public: // From CConsoleBase. |
|
31 virtual ~CRemoteConsole(); |
|
32 virtual TInt Create(const TDesC& aTitle, TSize aSize); |
|
33 virtual void Read(TRequestStatus& aStatus); |
|
34 virtual void ReadCancel(); |
|
35 virtual void Write(const TDesC& aDes); |
|
36 virtual TPoint CursorPos() const; |
|
37 virtual void SetCursorPosAbs(const TPoint& aPoint); |
|
38 virtual void SetCursorPosRel(const TPoint& aPoint); |
|
39 virtual void SetCursorHeight(TInt aPercentage); |
|
40 virtual void SetTitle(const TDesC& aTitle); |
|
41 virtual void ClearScreen(); |
|
42 virtual void ClearToEndOfLine(); |
|
43 virtual TSize ScreenSize() const; |
|
44 virtual TKeyCode KeyCode() const; |
|
45 virtual TUint KeyModifiers() const; |
|
46 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); |
|
47 private: |
|
48 TInt Connect(const TDesC& aTitle, TSize aSize); |
|
49 void CleanupConnection(); |
|
50 void WriteCommand(const TDesC8& aDes) const; |
|
51 void ReadCommandResponse(TDes8& aDes) const; |
|
52 private: |
|
53 class TKeyEvent |
|
54 { |
|
55 public: |
|
56 TUint16 iChar; |
|
57 TUint32 iModifiers; |
|
58 }; |
|
59 private: |
|
60 TRemoteConsoleConfig iConfig; |
|
61 RSocketServ iSocketSession; |
|
62 #ifdef USE_RCONNECTION |
|
63 RConnection iConnection; |
|
64 #endif |
|
65 mutable RSocket iCommandSocket; |
|
66 RSocket iKeyEventSocket; |
|
67 TKeyEvent iKeyEvent; |
|
68 TPckg<TKeyEvent> iKeyEventPckg; |
|
69 CConsoleBase* iUnderlyingConsole; |
|
70 }; |
|
71 |
|
72 |
|
73 #endif // __REMOTE_CONSOLE_H__ |