1 /* |
|
2 * Copyright (c) 2008 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: CLocBtNotifierPlugIn class declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_LOCBTNOTIFIERPLUGIN_H |
|
21 #define C_LOCBTNOTIFIERPLUGIN_H |
|
22 |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <cfactionplugin.h> |
|
26 |
|
27 |
|
28 #include "locbtnotifierconstantsmanager.h" |
|
29 |
|
30 /** |
|
31 * Forward Declarations |
|
32 */ |
|
33 class CAknGlobalNote; |
|
34 class CLocBtNotifierPlugIn; |
|
35 |
|
36 |
|
37 |
|
38 /** |
|
39 * LocBtNotifier action plugin. |
|
40 * Implementation of the Context Framework Action Plugin. |
|
41 * Specifies the action for a change in the BtGpsPsy PS keys. |
|
42 * ShowMsg Action shows appropriate note on change of BtGpsPsy PS Keys |
|
43 * |
|
44 * @lib |
|
45 * @since S60 5.1 |
|
46 */ |
|
47 NONSHARABLE_CLASS ( CLocBtNotifierPlugIn ) : public CCFActionPlugIn |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Enumeration used to determine Battery Key State |
|
54 */ |
|
55 enum TBtGpsPsyBatteryKeyState |
|
56 { |
|
57 /** |
|
58 * Indicates the battery state when the plugin is loaded |
|
59 */ |
|
60 EBatteryStateUnInitialized = -3, |
|
61 /** |
|
62 * Indicates the battery state when plugin is initialized after |
|
63 * the first call from the Context Framework Source plugin |
|
64 */ |
|
65 EBatteryStateInitialized, |
|
66 /** |
|
67 * Indicates that the BT GPS device battery state is not applicable |
|
68 */ |
|
69 EBatteryStateNotApplicable, |
|
70 /** |
|
71 * Indicates that BT GPS Device battery state is normal |
|
72 */ |
|
73 EBatteryStateNormal, |
|
74 /** |
|
75 * Indicates that BT GPS Device battery state is low |
|
76 */ |
|
77 EBatteryStateLow, |
|
78 /** |
|
79 * Indicates that BT GPS Device battery state is full |
|
80 */ |
|
81 EBatteryStateFull |
|
82 }; |
|
83 |
|
84 /** |
|
85 * Enumeration used to determine Antenna Key State |
|
86 */ |
|
87 enum TBtGpsPsyAntennaKeyState |
|
88 { |
|
89 /** |
|
90 * Indicates the ext Antenna state when the plugin is loaded |
|
91 */ |
|
92 EAntennaStateUnInitialized = -3, |
|
93 /** |
|
94 * Indicates Antenna state when the plugin is initialized |
|
95 * after the first call from the Context Framework Source plugin |
|
96 */ |
|
97 EAntennaStateInitialized, |
|
98 /** |
|
99 * Indicates that the Ext Antenna State is not applicable |
|
100 */ |
|
101 EAntennaStateNotApplicable, |
|
102 /** |
|
103 * Indicates that the Ext Antenna is disconnected from the |
|
104 * BT GPS Device |
|
105 */ |
|
106 EExtAntennaOff, |
|
107 /** |
|
108 * Indicates that the Ext Antenna is connected to the |
|
109 * BT GPS Device |
|
110 */ |
|
111 EExtAntennaOn |
|
112 }; |
|
113 |
|
114 /** |
|
115 * Enumeration used to determine Power Key State |
|
116 */ |
|
117 enum TBtGpsPsyPowerKeyState |
|
118 { |
|
119 /** |
|
120 * Indicates the ext Power state when the plugin is loaded |
|
121 */ |
|
122 EPowerStateUnInitialized = -3, |
|
123 /** |
|
124 * Indicates Power state when the plugin is initialized |
|
125 * after the first call from the Context Framework Source plugin |
|
126 */ |
|
127 EPowerStateInitialized, |
|
128 /** |
|
129 * Indicates that the Ext Power State is not applicable |
|
130 */ |
|
131 EPowerStateNotApplicable, |
|
132 /** |
|
133 * Indicates that the Charger is disconnected from the |
|
134 * BT GPS Device |
|
135 */ |
|
136 EExtPowerOff, |
|
137 /** |
|
138 * Indicates that the Charger is connected to the |
|
139 * BT GPS Device |
|
140 */ |
|
141 EExtPowerOn |
|
142 }; |
|
143 |
|
144 /** |
|
145 * Constructor |
|
146 */ |
|
147 static CLocBtNotifierPlugIn* NewL(); |
|
148 |
|
149 /** |
|
150 * Destructor. |
|
151 */ |
|
152 ~CLocBtNotifierPlugIn(); |
|
153 |
|
154 private: |
|
155 |
|
156 /** |
|
157 * from base class CCFActionPlugIn |
|
158 */ |
|
159 void InitializeL(); |
|
160 |
|
161 /** |
|
162 * from base class CCFActionPlugIn |
|
163 */ |
|
164 TExecutionTime ExecuteL( CCFActionIndication* aActionIndication ); |
|
165 |
|
166 /** |
|
167 * from base class CCFActionPlugIn |
|
168 */ |
|
169 void GetActionsL( CDesCArray& aActionList ) const; |
|
170 |
|
171 /** |
|
172 * from base class CCFActionPlugIn |
|
173 */ |
|
174 const TSecurityPolicy& SecurityPolicy() const; |
|
175 |
|
176 |
|
177 private: |
|
178 |
|
179 /** |
|
180 * Private Constructor |
|
181 */ |
|
182 CLocBtNotifierPlugIn(); |
|
183 |
|
184 |
|
185 /** |
|
186 * Checks if there is change in Battery key state with respect to the |
|
187 * previous notification and proceeds to show appropriate note |
|
188 * @param aValue - value of the action parameter |
|
189 */ |
|
190 void HandleBatteryKeyStateL( TDesC& aValue ); |
|
191 |
|
192 /** |
|
193 * Checks the Cen Rep key settings before displaying the note for |
|
194 * any Battery key change |
|
195 * @param aState - enum value based on the PS key that has changed |
|
196 */ |
|
197 void ShowBatteryNoteL( TBtGpsPsyBatteryKeyState aState ); |
|
198 |
|
199 /** |
|
200 * Verifies if the battery note can be shown |
|
201 * @param aState - enum value based on the PS key that has changed |
|
202 * @return ETrue if note can be displayed or |
|
203 * EFalse if note should not be displayed |
|
204 */ |
|
205 TBool IsBatteryNoteShownL( TBtGpsPsyBatteryKeyState aState ); |
|
206 |
|
207 /** |
|
208 * Checks if there is change in Antenna key state with respect to the |
|
209 * previous notification and proceeds to show appropriate note |
|
210 * @param aValue - value of the action parameter |
|
211 */ |
|
212 void HandleAntennaKeyStateL( TDesC& aValue ); |
|
213 |
|
214 /** |
|
215 * Checks the Cen Rep key settings before displaying the note for |
|
216 * any Antenna key change |
|
217 * @param aState - enum value based on the PS key that has changed |
|
218 */ |
|
219 void ShowAntennaNoteL( TBtGpsPsyAntennaKeyState aState ); |
|
220 |
|
221 /** |
|
222 * Verifies if the Antenna note can be shown |
|
223 * @param aState - enum value based on the PS key that has changed |
|
224 * @return ETrue if note can be displayed or |
|
225 * EFalse if note should not be displayed |
|
226 */ |
|
227 TBool IsAntennaNoteShownL( TBtGpsPsyAntennaKeyState aState ); |
|
228 |
|
229 /** |
|
230 * Checks if there is change in Power key state with respect to the |
|
231 * previous notification and proceeds to show appropriate note |
|
232 * @param aValue - value of the action parameter |
|
233 */ |
|
234 void HandlePowerKeyStateL( TDesC& aValue ); |
|
235 |
|
236 /** |
|
237 * Checks the Cen Rep key settings before displaying the note for |
|
238 * any Power key change |
|
239 * @param aState - enum value based on the PS key that has changed |
|
240 */ |
|
241 void ShowPowerNoteL( TBtGpsPsyPowerKeyState aState ); |
|
242 |
|
243 /** |
|
244 * Verifies if the Power note can be shown |
|
245 * @param aState - enum value based on the PS key that has changed |
|
246 * @return ETrue if note can be displayed or |
|
247 * EFalse if note should not be displayed |
|
248 */ |
|
249 TBool IsPowerNoteShownL( TBtGpsPsyPowerKeyState aState ); |
|
250 |
|
251 /** |
|
252 * Verifies if the dialog can be shown depending on the CenRep key value |
|
253 * @param in - aKey - CenRep Key whose value needs to be checked |
|
254 * @param out - aShown - Contains value of the key either 0 or 1 |
|
255 */ |
|
256 void IsDialogShownL( TUint32 aKey, TBool& aShown ); |
|
257 |
|
258 |
|
259 |
|
260 private: |
|
261 |
|
262 /** |
|
263 * Own : Avkon Global Note |
|
264 */ |
|
265 CAknGlobalNote* iGlobalNote; |
|
266 |
|
267 /** |
|
268 * Own : CLocBtNotifierConstantsManager handler |
|
269 */ |
|
270 CLocBtNotifierConstantsManager* iConstantsManager; |
|
271 |
|
272 /** |
|
273 * Stores the previous BluetoothGpsPsyBatteryState |
|
274 */ |
|
275 TBtGpsPsyBatteryKeyState iBatteryStatus; |
|
276 |
|
277 /** |
|
278 * Stores the previous BluetoothGpsPsyExtAntennaState |
|
279 */ |
|
280 TBtGpsPsyAntennaKeyState iAntennaStatus; |
|
281 |
|
282 /** |
|
283 * Stores the previous BluetoothGpsPsyExtPowerState |
|
284 */ |
|
285 TBtGpsPsyPowerKeyState iPowerStatus; |
|
286 |
|
287 /** |
|
288 * Pointer to the text to be displayed in the information note |
|
289 */ |
|
290 TPtr16 iInfoText; |
|
291 |
|
292 |
|
293 }; |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 #endif // C_LOCBTNOTIFIERPLUGIN_H |
|