|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of HtiAdmin main. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CHTIADMINENGINE_H |
|
19 #define CHTIADMINENGINE_H |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <e32base.h> |
|
23 #include <BADESCA.H> |
|
24 |
|
25 |
|
26 class HtiEngineWrapper; |
|
27 class CPeriodic; |
|
28 class CHtiCfg; |
|
29 |
|
30 |
|
31 class CHtiAdminEngine : public CBase |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Constructor |
|
37 */ |
|
38 CHtiAdminEngine(); |
|
39 |
|
40 /** |
|
41 * Destructor |
|
42 */ |
|
43 ~CHtiAdminEngine(); |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CHtiAdminEngine* NewL(HtiEngineWrapper *aEngineWrapper); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CHtiAdminEngine* NewLC(HtiEngineWrapper *aEngineWrapper); |
|
54 |
|
55 void StartHtiL(); |
|
56 |
|
57 void StopHtiL(); |
|
58 |
|
59 void EnableBtByAddressL(const TDesC& aAddress); |
|
60 |
|
61 void EnableBtByNameL(const TDesC& aAddress); |
|
62 |
|
63 void BtSearchL(); |
|
64 |
|
65 void IPListenL(const TDesC& aPort, const TDesC& aIAP); |
|
66 |
|
67 void IPConnectL(const TDesC& aHost, const TDesC& aPort, const TDesC& aIAP); |
|
68 |
|
69 void EnableSerialL(const TDesC& aComPortNumber); |
|
70 |
|
71 void EnableOtherCommL(const TDesC& aSelectedPluginName); |
|
72 |
|
73 void SetPriorityBackgroundL(); |
|
74 |
|
75 void SetPriorityForegroundL(); |
|
76 |
|
77 void SetPriorityHighL(); |
|
78 |
|
79 void SetPriorityAbsoluteHighL(); |
|
80 |
|
81 void AutoStartEnableL(TBool aEnableAutoStart); |
|
82 |
|
83 void ConsoleEnableL(TBool aEnableConsole); |
|
84 |
|
85 void ErrorDialogsEnableL(TBool aEnableErrorDialogs); |
|
86 |
|
87 void SetHtiCfgParamL(const TDesC& aParamName, const TDesC& aParamValue); |
|
88 void GetHtiCfgParamL(const TDesC& aParamName, TDes& aParamValue); |
|
89 |
|
90 void SetBtCfgParamL(const TDesC& aParamName, const TDesC& aParamValue); |
|
91 void GetBtCfgParamL(const TDesC& aParamName, TDes& aParamValue); |
|
92 |
|
93 void SetSerialCfgParamL(const TDesC& aParamName, const TDesC& aParamValue); |
|
94 void GetSerialCfgParamL(const TDesC& aParamName, TDes& aParamValue); |
|
95 |
|
96 void SetIPCfgParamL(const TDesC& aParamName, const TDesC& aParamValue); |
|
97 void GetIPCfgParamL(const TDesC& aParamName, TDes& aParamValue); |
|
98 |
|
99 void GetSelectedComm(TDes& aPluginName); |
|
100 |
|
101 void CheckStatusesL(); |
|
102 |
|
103 CDesCArray* SearchCommPluginsL(); |
|
104 |
|
105 CDesCArray* SearchIAPsL(); |
|
106 |
|
107 void CHtiAdminEngine::WatchDogEnableL(TBool aEnableWDog); |
|
108 |
|
109 /** |
|
110 * Kills the HtiWatchDog process if it is running. |
|
111 */ |
|
112 void KillHtiWatchDogL(); |
|
113 |
|
114 /** |
|
115 * Stops the timer issuing the periodical HTI Framework process |
|
116 * status checks. |
|
117 */ |
|
118 void KillTimer(); |
|
119 |
|
120 /** |
|
121 * The method called by the periodic timer. |
|
122 * @param aPtr pointer to this CHtiAdminAppUi instance |
|
123 * @return zero if the callback function should not be called again, |
|
124 * otherwise non-zero. Current implementation returns always ETrue. |
|
125 */ |
|
126 static TInt TimerCallBackL( TAny* aPtr ); |
|
127 |
|
128 /** |
|
129 * Tries to find the HTIFramework.exe process and open a handle to it. |
|
130 * @param aPrs on return contains an open handle to the HTIFramework.exe |
|
131 * process if process found and opened successfully |
|
132 * @return ETrue if process found and opened successfully, |
|
133 * otherwise EFalse |
|
134 */ |
|
135 TBool OpenHtiProcess( RProcess& aPrs ); |
|
136 |
|
137 /** |
|
138 * Updates the HTI Framework process status in the display. |
|
139 */ |
|
140 void UpdateStatusL(); |
|
141 |
|
142 /** |
|
143 * Updates the HTI auto start status in the display. |
|
144 */ |
|
145 void UpdateAutoStartStatus(); |
|
146 |
|
147 |
|
148 void UpdateConsoleStatus(); |
|
149 |
|
150 void UpdateWatchDogStatus(); |
|
151 |
|
152 /** |
|
153 * Updates the selected communication in the display. |
|
154 */ |
|
155 void UpdateSelectedComm(); |
|
156 |
|
157 private: |
|
158 void ConstructL(HtiEngineWrapper *aEngineWrapper); |
|
159 |
|
160 void SetCfgParamL(const TDesC& aParamName, const TDesC& aParamValue, const TDesC& aFileName); |
|
161 void GetCfgParamL(const TDesC& aParamName, TDes& aParamValue, const TDesC& aFileName); |
|
162 |
|
163 private: |
|
164 // Enginewrapper that is used for communicating between QT and Symbian |
|
165 HtiEngineWrapper* iEngineWrapper; |
|
166 |
|
167 // Timer triggering periodic checking of HTIFramework process status |
|
168 CPeriodic* iPeriodic; |
|
169 |
|
170 // For reading and writing HTI configuration files |
|
171 CHtiCfg* iHtiCfg; |
|
172 |
|
173 CDesCArrayFlat* iPluginNameArray; |
|
174 |
|
175 CDesC8ArrayFlat* iPluginDataTypeArray; |
|
176 |
|
177 CDesCArrayFlat* iIAPsArray; |
|
178 |
|
179 |
|
180 }; |
|
181 |
|
182 #endif //CHTIADMINENGINE_H |