|
1 /* |
|
2 * Copyright (c) 2006 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: SUPL Settings UI Engine. The engine is resposible for handling |
|
15 * all the UI components required for SUPL Settings UI. In addition |
|
16 * to this it also is responsible for interacting with the SUPL |
|
17 * Settings API |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef C_LOCSUPLSETTINGSUIENGINE_H_ |
|
23 #define C_LOCSUPLSETTINGSUIENGINE_H_ |
|
24 |
|
25 // System Includes |
|
26 #include <e32base.h> |
|
27 #include <agentdialog.h> // for RGenConAgentDialogServer |
|
28 |
|
29 // User Includes |
|
30 #include "locsuplsettingsadapterobserver.h" |
|
31 |
|
32 // Forward Declaration |
|
33 class CLocSUPLSettingsAdapter; |
|
34 class MLocSUPLSettingsUiEngObserver; |
|
35 class CTextResolver; |
|
36 class CAknGlobalConfirmationQuery; |
|
37 class CServerParams; |
|
38 class CTriggerParams; |
|
39 class CLocSUPLServerEditor; |
|
40 class MSuplServerEditorObserver; |
|
41 class MLocSUPLSettingsSessionObserver; |
|
42 |
|
43 // Class Declaration |
|
44 /** |
|
45 * Engine for SUPL Settings UI |
|
46 * |
|
47 * Engine class for SUPL Settings UI. It is responsible for interacting with the |
|
48 * SUPL Settings API. Further, it handles all commands for SUPL settings UI. The |
|
49 * Engine launches all the dialogs associated with configuring the SUPL Settings. |
|
50 * It further observers the SUPL Settings UI for any changes to the Settings |
|
51 * values. |
|
52 */ |
|
53 class CLocSUPLSettingsUiEngine : public CBase, public MLocSUPLSettingsAdapterObserver |
|
54 { |
|
55 public: |
|
56 /** |
|
57 * Two-phased constructor |
|
58 * |
|
59 * @param aObserver Referenece to the Engine observer |
|
60 * @return CLocSUPLSettingsUiEngine* Reference to the object created |
|
61 */ |
|
62 static CLocSUPLSettingsUiEngine* NewL( |
|
63 MLocSUPLSettingsUiEngObserver& aObserver ); |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. Leaves the object on the Cleanup stack |
|
67 * |
|
68 * @param aObserver Reference to the Engine observer |
|
69 * @return CLocSUPLSettingsUiEngine* Reference to the object created |
|
70 */ |
|
71 static CLocSUPLSettingsUiEngine* NewLC( |
|
72 MLocSUPLSettingsUiEngObserver& aObserver ); |
|
73 |
|
74 /** |
|
75 * Initializes the Settings Engine. This is an asynchronous call the |
|
76 * completion of which is communicated through the observer |
|
77 * |
|
78 */ |
|
79 void Initalize(); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 virtual ~CLocSUPLSettingsUiEngine(); |
|
85 |
|
86 |
|
87 |
|
88 /** |
|
89 * Opens the exisitng server with its attributes |
|
90 * |
|
91 */ |
|
92 void EditServerL( TBool iIsEditable, TInt64 aSlpId ); |
|
93 |
|
94 /** |
|
95 * returns exisitng server entries count |
|
96 * |
|
97 */ |
|
98 TInt SlpCount(); |
|
99 |
|
100 |
|
101 /** |
|
102 * Closes the running Settings UI prematurely. |
|
103 */ |
|
104 void Close(); |
|
105 |
|
106 |
|
107 /** |
|
108 * Creates a new server entry in Supl Settings. |
|
109 */ |
|
110 void AddNewServerL( |
|
111 const TDesC& aServerAddress, |
|
112 const TDesC& aIapName, |
|
113 const TBool aUsageInHomeNw |
|
114 ); |
|
115 |
|
116 /** |
|
117 * Deletes server entry from SUPL settings storage. |
|
118 */ |
|
119 void RemoveServerL( |
|
120 const TInt64 aSlpId |
|
121 ); |
|
122 |
|
123 /** |
|
124 * Sets the priority of the server to the specified priority. |
|
125 */ |
|
126 void ChangePriorityL( |
|
127 TInt64 aSlpId, |
|
128 TInt aPriority, |
|
129 TBool aDirection |
|
130 ); |
|
131 |
|
132 /** |
|
133 * Gets properties of all servers from SUPL settings storage. |
|
134 * This method retrieves all properties for each server. |
|
135 */ |
|
136 void GetAllSlpL( |
|
137 RPointerArray<CServerParams>& aParamValues |
|
138 ) const; |
|
139 |
|
140 /** |
|
141 * Gets all properties of server from SUPL settings storage |
|
142 * based on SLP identification. |
|
143 */ |
|
144 void GetSlpInfoFromIdL( |
|
145 const TInt64 aSlpId, |
|
146 CServerParams *aParamValues |
|
147 ) const; |
|
148 |
|
149 /** |
|
150 * Sets the server address parameter in server settings |
|
151 */ |
|
152 void SetServerAddressL( |
|
153 const TInt64 aSlpId, |
|
154 const TDesC& aServerAddress |
|
155 ); |
|
156 |
|
157 /** |
|
158 * Obtains the server address parameter from server settings. Client |
|
159 * has to allocate memory for server address parameter. |
|
160 */ |
|
161 void GetServerAddressL( |
|
162 TInt64 aSlpId, |
|
163 TDes& aServerAddress |
|
164 ) const; |
|
165 |
|
166 /** |
|
167 * Sets the IAP Name in server parameters. IAP name refers to |
|
168 * the access point which is used to access the HSLP over the internet. |
|
169 */ |
|
170 void SetIapNameL( |
|
171 const TInt64 aSlpId, |
|
172 const TDesC& aIapName |
|
173 ); |
|
174 |
|
175 /** |
|
176 * Sets the parameter which indicates whether server |
|
177 * can be used for SUPL session or not. |
|
178 */ |
|
179 void SetServerEnabledFlagL( |
|
180 const TInt64 aSlpId, |
|
181 const TBool aEnable |
|
182 ) const; |
|
183 |
|
184 /** |
|
185 * Obtains the parameter which indicates whether server |
|
186 * can be used for SUPL session or not. |
|
187 */ |
|
188 void GetServerEnabledFlagL( |
|
189 const TInt64 aSlpId, |
|
190 TBool& aEnable |
|
191 ) const; |
|
192 |
|
193 /** |
|
194 * Sets the parameter which indicates whether server |
|
195 * can be used out side home network or not. |
|
196 */ |
|
197 void SetUsageInHomwNwFlagL( |
|
198 const TInt64 aSlpId, |
|
199 const TBool aHomeNwFlag |
|
200 ); |
|
201 |
|
202 |
|
203 /** |
|
204 * Sets the parameter which indicates whether server |
|
205 * details are editable or not. |
|
206 */ |
|
207 void SetEditableFlagL( |
|
208 const TInt64 aSlpId, |
|
209 const TBool aEditFlag |
|
210 ) const; |
|
211 |
|
212 /** |
|
213 * Gets the parameter which indicates whether server |
|
214 * details are editable or not. |
|
215 */ |
|
216 void GetEditableFlagL( |
|
217 const TInt64 aSlpId, |
|
218 TBool& aEditFlag |
|
219 ) const; |
|
220 |
|
221 /** |
|
222 * Obtains the count of active Supl sessions |
|
223 * |
|
224 */ |
|
225 void GetActiveSessionsCountL( TInt& aAccessPointCount ); |
|
226 |
|
227 /** |
|
228 * Gets properties of all triggers from SUPL settings storage. |
|
229 * This method retrieves all properties for each trigger. |
|
230 */ |
|
231 void GetTriggerParamsL( |
|
232 RPointerArray<CTriggerParams>& aParamValues |
|
233 ) const; |
|
234 |
|
235 /** |
|
236 * Gets properties of all triggers from SUPL settings storage. |
|
237 * This method retrieves all properties for each trigger based on session id. |
|
238 */ |
|
239 void GetTriggerParamsL( TInt64 aSessionId, |
|
240 CTriggerParams*& aTrigger |
|
241 ) const; |
|
242 |
|
243 /** |
|
244 * Open the Active Session for the specified session id. |
|
245 * |
|
246 */ |
|
247 void OpenSessionL( TInt64 aSessionId ); |
|
248 |
|
249 /** |
|
250 * Deletes a trigger session based on session id |
|
251 * |
|
252 */ |
|
253 void RemoveTriggerSessionL( TInt64 aSessionId ) const; |
|
254 |
|
255 /** |
|
256 * Deletes a trigger sessions based on session ids |
|
257 * |
|
258 */ |
|
259 void RemoveTriggerSessionsL( RArray< TInt64 >& aSessionIdList ) const; |
|
260 |
|
261 /** |
|
262 * Deletes all the trigger sessions |
|
263 * |
|
264 */ |
|
265 void RemoveAllTriggerSessionsL( ) const; |
|
266 |
|
267 /** |
|
268 * Changes the notification status of an active session based on session id |
|
269 * |
|
270 */ |
|
271 void ChangeNotificationStatusL( TInt64 aSessionId, TBool aTriggerNotificationStatus ) const; |
|
272 |
|
273 /** |
|
274 * Set the Observer for the specific Session |
|
275 * |
|
276 */ |
|
277 void SetSessionObserver( MLocSUPLSettingsSessionObserver* aObserver ) const; |
|
278 |
|
279 /** |
|
280 * Remove the Session observer |
|
281 * |
|
282 */ |
|
283 void RemoveSessionObserver( ) const; |
|
284 |
|
285 /** |
|
286 * Sets value of highlighted AP |
|
287 */ |
|
288 void SetTempAPValue( TUint32 aAccessPoint); |
|
289 |
|
290 /** |
|
291 * Generates IMSI address |
|
292 */ |
|
293 void GenerateHslpAddressFromImsi(TDes& aIMSIAddress ); |
|
294 public: |
|
295 /** |
|
296 * Inherited from MLocSUPLSettingsAdapterObserver |
|
297 */ |
|
298 void HandleSuplSettingsChangeL( TLocSUPLSettingsEvent aEvent ); |
|
299 |
|
300 |
|
301 private: |
|
302 /** |
|
303 * C++ constructor. |
|
304 */ |
|
305 CLocSUPLSettingsUiEngine( MLocSUPLSettingsUiEngObserver& aObserver ); |
|
306 |
|
307 /** |
|
308 * Second Phase constructor |
|
309 */ |
|
310 void ConstructL(); |
|
311 |
|
312 /** |
|
313 * Obtains the index UID corresponding to the Access point name |
|
314 * |
|
315 * @param aIAPName Access point name |
|
316 * @return TUint UID corresponding to the AP Name. Zero if |
|
317 * the name does not exist |
|
318 */ |
|
319 TUint ConvertIAPNameToIdL( const TDesC& aIAPName ); |
|
320 |
|
321 /** |
|
322 * Displays an Error note |
|
323 * |
|
324 * @param aError Error ID |
|
325 */ |
|
326 void DisplayErrorL( TInt aError ); |
|
327 |
|
328 |
|
329 /** |
|
330 * Returns value of last highlighted AP |
|
331 */ |
|
332 TUint32 GetTempAPValue(); |
|
333 |
|
334 private: |
|
335 /** |
|
336 * Reference to the Engine Observer |
|
337 */ |
|
338 MLocSUPLSettingsUiEngObserver& iObserver; |
|
339 |
|
340 /** |
|
341 * SUPL Settings API Adapter |
|
342 * Owns |
|
343 */ |
|
344 CLocSUPLSettingsAdapter* iSUPLSettingsAdapter; |
|
345 |
|
346 |
|
347 /** |
|
348 * Temporary Buffer for returning values to the Accessor |
|
349 * functions. The accessor expects a 16 bit variant of the descriptor |
|
350 * Owns |
|
351 */ |
|
352 HBufC16* iConversionBuffer; |
|
353 |
|
354 /** |
|
355 * Pointer to the Conversion Buffer |
|
356 */ |
|
357 TPtr16 iConversionBufferPtr; |
|
358 |
|
359 /** |
|
360 * Temporary Buffer to hand over to the UI components and |
|
361 * access data from the Settinga API |
|
362 * Owns |
|
363 */ |
|
364 HBufC* iSettingsBuffer; |
|
365 |
|
366 |
|
367 /** |
|
368 * Standard Text resolver for converting Error codes to |
|
369 * standard texts |
|
370 */ |
|
371 CTextResolver* iTextResolver; |
|
372 |
|
373 |
|
374 /** |
|
375 * Selected IAP ID |
|
376 */ |
|
377 TUint32 iSelectedIap; |
|
378 |
|
379 /** |
|
380 * Launch Paramters |
|
381 */ |
|
382 TInt iLaunchParams; |
|
383 |
|
384 |
|
385 /** |
|
386 * Flag to denote whether access point selection requested or not |
|
387 */ |
|
388 TBool iRequestIapSelect; |
|
389 |
|
390 |
|
391 /** |
|
392 * Supl Server Editor |
|
393 * Owns |
|
394 */ |
|
395 CLocSUPLServerEditor* iEditorDlg; |
|
396 |
|
397 |
|
398 /* |
|
399 * Current highlighted AP |
|
400 * Set to -1 if no changes made in edit dialog box, Set to Uid of access |
|
401 * point if changes made |
|
402 */ |
|
403 TUint32 iTempAP; |
|
404 |
|
405 }; |
|
406 |
|
407 #endif // C_LOCSUPLSETTINGSUIENGINE_H_ |
|
408 |