56
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-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: Settings database handler...
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef __CSETTINGSDATABASEHANDLER__
|
|
21 |
#define __CSETTINGSDATABASEHANDLER__
|
|
22 |
|
|
23 |
|
|
24 |
#include <e32std.h>
|
|
25 |
#include <badesca.h> // CDesCArrayFlat (cannot be forward declarated)
|
|
26 |
#include <e32des16.h>
|
|
27 |
#include <sqldb.h>
|
|
28 |
#include <flogger.h>
|
|
29 |
#include <f32file.h>
|
|
30 |
|
|
31 |
#include "epos_csuplsettings.h"
|
|
32 |
#include "epos_csuplsettingsinternal.h" //for TServerParam
|
|
33 |
#include "epos_msuplsettingsobserver.h"
|
|
34 |
#include "epos_msuplsessionobserver.h"
|
|
35 |
|
|
36 |
_LIT( KLoggingFolder, "suplsettingsdb" );
|
|
37 |
_LIT( KLoggingFile, "log.txt" );
|
|
38 |
_LIT( KLoggingFullName, "c:\\logs\\suplsettingsdb\\log.TXT" );
|
|
39 |
|
|
40 |
const int KCustomSqlMaxLength = 1024; //max len of a sql string
|
|
41 |
#define TRACESTRING( S1 ) { \
|
|
42 |
_LIT( tempLogDes, S1 ); \
|
|
43 |
RFileLogger::Write( KLoggingFolder(), KLoggingFile(), \
|
|
44 |
EFileLoggingModeAppend, tempLogDes() );}
|
|
45 |
|
|
46 |
|
|
47 |
#define TRACETEXT( S1 ) {RFileLogger::Write( KLoggingFolder(),KLoggingFile(),EFileLoggingModeAppend, S1 ); }
|
|
48 |
|
|
49 |
|
|
50 |
class CServerParams;
|
|
51 |
class CRepository;
|
|
52 |
class CTriggerParams;
|
|
53 |
class CServerExtensionParams;
|
|
54 |
|
|
55 |
/**
|
|
56 |
* This class is used for creating, accessing and storing SUPL Settings
|
|
57 |
* onto the SUPL settings DB.
|
|
58 |
*
|
|
59 |
* This is part of @lib epos_suplsettings.lib
|
|
60 |
* @since
|
|
61 |
*/
|
|
62 |
class CSettingsDatabaseHandler : public CBase
|
|
63 |
{
|
|
64 |
public: // Creation and destruction
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Function: NewL
|
|
68 |
*
|
|
69 |
* Description: Get instance of a CSettingsDatabaseHandler object.
|
|
70 |
*/
|
|
71 |
static CSettingsDatabaseHandler* NewL();
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Function: ~CSettingsDatabaseHandler
|
|
75 |
*
|
|
76 |
* Description: Destroy the object.
|
|
77 |
*/
|
|
78 |
~CSettingsDatabaseHandler();
|
|
79 |
|
|
80 |
|
|
81 |
public: // Public API for database operations
|
|
82 |
|
|
83 |
|
|
84 |
private: // Construction
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Function: ConstructL
|
|
88 |
*
|
|
89 |
* Description: Perform the second phase construction of a CSettingsDatabaseHandler
|
|
90 |
* object
|
|
91 |
*/
|
|
92 |
void ConstructL();
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Function: CSettingsDatabaseHandler
|
|
96 |
*
|
|
97 |
* Description: Perform the first phase of two phase construction.
|
|
98 |
*/
|
|
99 |
CSettingsDatabaseHandler();
|
|
100 |
|
|
101 |
private: // Helpers
|
|
102 |
|
|
103 |
/**
|
|
104 |
* This method is used to Create a new database and open.
|
|
105 |
* The database will be in exclusive access mode.
|
|
106 |
*
|
|
107 |
* @since
|
|
108 |
*
|
|
109 |
* @param [IN] aDbFile The name of the database file to be opened
|
|
110 |
*
|
|
111 |
*/
|
|
112 |
void CreateOpenSecureDatabaseL(/*const TDesC& aDbFile*/);
|
|
113 |
|
|
114 |
/**
|
|
115 |
* This method is used to close and remove the settings DB
|
|
116 |
*
|
|
117 |
* @since
|
|
118 |
*/
|
|
119 |
TInt RemoveDb();
|
|
120 |
|
|
121 |
/**
|
|
122 |
* This method is used to close and remove the settings DB
|
|
123 |
*
|
|
124 |
* @since
|
|
125 |
*/
|
|
126 |
TInt Close();
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Creates the SUPL Settings table. Leaves, if the table cannot be created.
|
|
130 |
*
|
|
131 |
* @since
|
|
132 |
*/
|
|
133 |
void CreateTableL();
|
|
134 |
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Forms part of the query string, used to form a query string that contains a TTIme value in it
|
|
138 |
*
|
|
139 |
* @since
|
|
140 |
*
|
|
141 |
* @param [IN] aParameter The TServerParam enum which indicates which property is to be updated
|
|
142 |
* @param [IN] aValue The TTime value to be included in the query string
|
|
143 |
* @param [OUT] aQueryString The resultant Query String is returned in this
|
|
144 |
*/
|
|
145 |
void FormSLPQueryL(CSuplSettingsInternal::TServerParam aParameter,TTime aValue,TDes& aQueryString);
|
|
146 |
/**
|
|
147 |
* Forms part of the query string, used to form a query string that contains a TInt value in it
|
|
148 |
*
|
|
149 |
* @since
|
|
150 |
*
|
|
151 |
* @param [IN] aParameter The TServerParam enum which indicates which property is to be updated
|
|
152 |
* @param [IN] aValue The TInt value to be included in the query string
|
|
153 |
* @param [OUT] aQueryString The resultant Query String is returned in this
|
|
154 |
*/
|
|
155 |
void FormSLPQueryL(CSuplSettingsInternal::TServerParam aParameter,TInt aValue,TDes& aQueryString);
|
|
156 |
/**
|
|
157 |
* Forms part of the query string, used to form a query string that contains a String value in it
|
|
158 |
*
|
|
159 |
* @since
|
|
160 |
*
|
|
161 |
* @param [IN] aParameter The TServerParam enum which indicates which property is to be updated
|
|
162 |
* @param [IN] aValue The string value to be included in the query string
|
|
163 |
* @param [OUT] aQueryString The resultant Query String is returned in this
|
|
164 |
*/
|
|
165 |
void FormSLPQueryL(CSuplSettingsInternal::TServerParam aParameter,const TDesC& aValue,TDes& aQueryString);
|
|
166 |
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Used to form part of a query string and set one of the boolen flags as part of the query
|
|
170 |
*
|
|
171 |
* @param[IN] aParameter Indicates which property is being manipulated
|
|
172 |
* @param[IN] aValue The value of the flag to be set as part of query
|
|
173 |
* @since
|
|
174 |
*/
|
|
175 |
TInt SetOtherPropertiesL(CSuplSettingsInternal::TServerParam aParameter,TInt aValue);
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Returns the SlpId of the Server that was last added into the records
|
|
179 |
*
|
|
180 |
* @since
|
|
181 |
*/
|
|
182 |
TInt64 GetLastInsertedSLPID();
|
|
183 |
|
|
184 |
/**
|
|
185 |
* Used to get the integer representation of all boolean flags as stored in the database
|
|
186 |
*
|
|
187 |
* @param[IN] aSLPId The slp id of the slp for which the value is required
|
|
188 |
* @param[OUT] aOtherPropertyValue The value of the int representation of the flags is returned in this
|
|
189 |
* @since
|
|
190 |
*/
|
|
191 |
TInt GetOtherPropertyValue(TInt64 aSLPId,TInt& aOtherPropertyValue);
|
|
192 |
|
|
193 |
/**
|
|
194 |
* This method is used to log query strings. Used for logging purposes only
|
|
195 |
* @since
|
|
196 |
*
|
|
197 |
* @param [IN] aBuffer The buffer containing the string to be logged
|
|
198 |
*
|
|
199 |
*/
|
|
200 |
void LogQuery(const TDesC& aBuffer);
|
|
201 |
|
|
202 |
/**
|
|
203 |
* This method is used to log query strings along with the error code.
|
|
204 |
* Used for logging purposes only
|
|
205 |
* @since
|
|
206 |
*
|
|
207 |
* @param [IN] aQueryFired The buffer containing the query that was fired.
|
|
208 |
* @param [IN] aErrorCode The error code that resulted due to the query.
|
|
209 |
* @param [IN] aOperationCode The operation code which the query was used to perform.
|
|
210 |
*
|
|
211 |
*/
|
|
212 |
void PrintErrorMessage(const TDesC& aQueryFired,TInt aErrorCode,TInt aOperationCode);
|
|
213 |
|
|
214 |
/**
|
|
215 |
* This method is used to log all SLPs currently in the database
|
|
216 |
* @since
|
|
217 |
*
|
|
218 |
*/
|
|
219 |
void LogAllSLP();
|
|
220 |
|
|
221 |
/**
|
|
222 |
* This method is used to retrieve default settings value from the cen rep
|
|
223 |
* @since
|
|
224 |
* @param [IN] aKey The CenRep Key correspnding to the value that is to be retrieved
|
|
225 |
* @param [OUT] aValue The value of the key is returned in this OUT parameter
|
|
226 |
*/
|
|
227 |
TInt GetDefaultCRValues(TInt aKey,TInt& aValue);
|
|
228 |
|
|
229 |
/**
|
|
230 |
* This method is used to retrieve Settings DB Path value from the cen rep
|
|
231 |
* @since
|
|
232 |
* @param [OUT] aPath The value of the DB Path is returned in this OUT parameter
|
|
233 |
*/
|
|
234 |
TInt GetDBPathFromCR(TDes& aPath);
|
|
235 |
|
|
236 |
/**
|
|
237 |
* This method is used to store Settings DB Path value in the cen rep
|
|
238 |
* @since
|
|
239 |
* @param [IN] aPath The value of the DB Path to be stored in CenRep
|
|
240 |
*/
|
|
241 |
TInt StoreDBPathToCR(TDes& aPath);
|
|
242 |
/*
|
|
243 |
* This method is used to notify that a change has occured in the DB via the CR
|
|
244 |
* @since
|
|
245 |
* @param [IN] aChangeEventType The type of event that occured on the DB ex.Update Delete etc
|
|
246 |
* @param [IN] aSlpId The slpId for which the record was updated
|
|
247 |
*
|
|
248 |
*/
|
|
249 |
TInt NotifyDBChange(MSuplSettingsObserver::TSuplSettingsEventType aChangedEventType,TInt64 aSlpId);
|
|
250 |
|
|
251 |
/*
|
|
252 |
* This method is used to retrieve priority of a particular SLP
|
|
253 |
* @since
|
|
254 |
* @param [IN] aSlpId The slp id for which the priority is required
|
|
255 |
* @param [OUT] aPriority The current priority is returned in this
|
|
256 |
*
|
|
257 |
*/
|
|
258 |
void GetPriorityL(TInt aSlpId,TInt& aPriority);
|
|
259 |
|
|
260 |
/**
|
|
261 |
* This method is used to alter priority of a particular server
|
|
262 |
* @since
|
|
263 |
* @param [IN] aSlpId The Slp Id for which new priority is to be assigned.
|
|
264 |
* @param [IN] aValue The new priority value to be assigned to the server.
|
|
265 |
*/
|
|
266 |
void SetPriorityL(TInt aSlpId,TInt aValue);
|
|
267 |
/**
|
|
268 |
* This method is used to alter priority of a particular server
|
|
269 |
* @since
|
|
270 |
* @param [IN] aSlpId The Slp Id for which new priority is to be assigned.
|
|
271 |
* @param [IN] aValue The new priority value to be assigned to the server.
|
|
272 |
*/
|
|
273 |
void GetMaxPriorityL(TInt& aPriorityValue);
|
|
274 |
/**
|
|
275 |
* This method is used to order the priority values in proper incremental sequence
|
|
276 |
* @since
|
|
277 |
*
|
|
278 |
*/
|
|
279 |
void NormalizePriorityL();
|
|
280 |
|
|
281 |
/**
|
|
282 |
* Creates the SUPL session table. Leaves, if the table cannot be created.
|
|
283 |
*
|
|
284 |
* @since
|
|
285 |
*/
|
|
286 |
void CreateSessionTableL();
|
|
287 |
|
|
288 |
|
|
289 |
/* Forms part of the query string, used to form a query string that contains a TInt value in it
|
|
290 |
*
|
|
291 |
* @since
|
|
292 |
*
|
|
293 |
* @param [IN] aParameter The TSessionParam enum which indicates which property is to be updated
|
|
294 |
* @param [IN] aValue The TInt value to be included in the query string
|
|
295 |
* @param [OUT] aQueryString The resultant Query String is returned in this
|
|
296 |
*/
|
|
297 |
void FormSessionQueryL(CSuplSettingsInternal::TSessionParam aParameter,TUint64 aValue,TDes& aQueryString);
|
|
298 |
|
|
299 |
/*
|
|
300 |
* This method is used to notify that a change has occured in the DB via the CR
|
|
301 |
* @since
|
|
302 |
* @param [IN] aChangeEventType The type of event that occured on the DB ex.Update Delete etc
|
|
303 |
* @param [IN] aSessionId The aSessionId for which the record was updated
|
|
304 |
*
|
|
305 |
*/
|
|
306 |
TInt NotifySessionDBChange(MSuplSessionObserver::TSuplSessionEventType aChangedEventType,TInt64 aSessionId);
|
|
307 |
public:
|
|
308 |
|
|
309 |
/**
|
|
310 |
* This method is used to insert SLP record into the SUPL Settings DB
|
|
311 |
* @since
|
|
312 |
*
|
|
313 |
* @param [IN] aServParamValues The CServerParams pointer containing server params
|
|
314 |
* to be added to the DB
|
|
315 |
* @param [OUT] aSlpId The SLP ID of the SLP that was successfully inserted
|
|
316 |
*/
|
|
317 |
void InsertSLPRecordL(const CServerParams* aServParamValues,TInt64& aSlpId);
|
|
318 |
|
|
319 |
/**
|
|
320 |
* This method is used to delete a SLP record corresponding to the given SLP ID
|
|
321 |
* @since
|
|
322 |
* @param [OUT] aSlpId The SLP ID of the SLP that is to be deleted
|
|
323 |
*/
|
|
324 |
void DeleteSLPRecordL(TInt64 aSLPId);
|
|
325 |
/**
|
|
326 |
* This method is used to update a column of string value corresponding to a particular slp
|
|
327 |
* @since
|
|
328 |
* @param [IN] aSlpId The SLP ID of the SLP that is to be updated
|
|
329 |
* @param [IN] aParameter The TServerParam enum which indicates which property is to be updated
|
|
330 |
* @param [IN] aValue The new value to be updated to the setings db
|
|
331 |
*/
|
|
332 |
void UpdateSLPRecordL(TInt64 aSLPId,CSuplSettingsInternal::TServerParam aParameter,const TDesC& aValue);
|
|
333 |
/**
|
|
334 |
* This method is used to update a column corresponding to version number of a particular slp
|
|
335 |
* @since
|
|
336 |
* @param [IN] aSlpId The SLP ID of the SLP that is to be updated
|
|
337 |
* @param [IN] aMajor The Major Version Number
|
|
338 |
* @param [IN] aValue The minor version number
|
|
339 |
*/
|
|
340 |
void UpdateSLPRecordL(TInt64 aSLPId,TInt aMajor, TInt aMinor);
|
|
341 |
/**
|
|
342 |
* This method is used to update a column corresponding to N/w Info Last Use/ lAst Success
|
|
343 |
* of a particular slp
|
|
344 |
* @since
|
|
345 |
* @param [IN] aNetType The network type
|
|
346 |
* @param [IN] aMcc Mobile country code. It can have value from 0 to 999
|
|
347 |
* @param [IN] aMnc Mobile network code. It can have value from 0 to 999
|
|
348 |
* @param [IN] aCid Cell Identity. It can have value from 0 to 65535 if aNetType is GSM or
|
|
349 |
* it can have value from 0 to 268435455 if aNetType is WCDMA
|
|
350 |
* @param [IN] aLac Location Aread Code. This parameter is written to settings only if aNetType is GSM.
|
|
351 |
*/
|
|
352 |
void UpdateSLPRecordL(TInt64 aSLPId,CSuplSettingsInternal::TServerParam aParamType,const CSuplSettingsInternal::TSuplSettingsNetworkType aNetType,
|
|
353 |
const TInt aMcc, const TInt aMnc, const TInt aCid, const TInt aLac);
|
|
354 |
/**
|
|
355 |
* This method is used to update a column of integer value corresponding to a particular slp
|
|
356 |
* @since
|
|
357 |
* @param [IN] aSlpId The SLP ID of the SLP that is to be updated
|
|
358 |
* @param [IN] aParameter The TServerParam enum which indicates which property is to be updated
|
|
359 |
* @param [IN] aValue The new value to be updated to the setings db
|
|
360 |
*/
|
|
361 |
void UpdateSLPRecordL(TInt64 aSLPId,CSuplSettingsInternal::TServerParam aParameter,TInt aValue);
|
|
362 |
/**
|
|
363 |
* This method is used to update a column of TTime value corresponding to a particular slp
|
|
364 |
* @since
|
|
365 |
* @param [IN] aSlpId The SLP ID of the SLP that is to be updated
|
|
366 |
* @param [IN] aParameter The TServerParam enum which indicates which property is to be updated
|
|
367 |
* @param [IN] aValue The new value to be updated to the setings db
|
|
368 |
*/
|
|
369 |
void UpdateSLPRecordL(TInt64 aSLPId,CSuplSettingsInternal::TServerParam aParameter,TTime aValue);
|
|
370 |
/**
|
|
371 |
* This method is used to update all configurable parameters corresponding to a partiular SLP
|
|
372 |
* @since
|
|
373 |
* @param [IN] aParamValues The CServerParams containing valid values to be updated to
|
|
374 |
* a particular SLP.
|
|
375 |
*/
|
|
376 |
void UpdateSLPRecordL(const CServerParams* aParamValues);
|
|
377 |
/**
|
|
378 |
* This method is used to update all configurable parameters corresponding to a default SLP
|
|
379 |
* @since
|
|
380 |
* @param [IN] aParamValues The CServerParams containing valid values to be updated to
|
|
381 |
* default SLP.
|
|
382 |
*/
|
|
383 |
void UpdateDefaultServerL(const CServerParams* aParamValues);
|
|
384 |
|
|
385 |
/**
|
|
386 |
* This synchronous method is retrieve parameters corresponding to all existing SLP records
|
|
387 |
* @since
|
|
388 |
* @param [OUT] aParamValues The Array of CServerParams which needs
|
|
389 |
* to filled with server parameters
|
|
390 |
*/
|
|
391 |
void GetAllSLPL(RPointerArray<CServerParams>& aParamValues);
|
|
392 |
/**
|
|
393 |
* This asynchronous method is retrieve parameters corresponding to all existing SLP records
|
|
394 |
* @since
|
|
395 |
* @param [OUT] aParamValues The Array of CServerParams which needs
|
|
396 |
* to filled with server parameters
|
|
397 |
*/
|
|
398 |
void GetAllSLPL(RPointerArray<CServerParams>& aParamValues,TRequestStatus& aStatus);
|
|
399 |
/**
|
|
400 |
* This method is used to set a SLP with a particular id as default
|
|
401 |
* @since
|
|
402 |
* @param [IN] aSLPId The SLP ID of the server entry to be set as default server
|
|
403 |
*/
|
|
404 |
void SetSLPAsDefaultL(TInt64 aSLPId);
|
|
405 |
/**
|
|
406 |
* This method is used to get SLP Id of the default server
|
|
407 |
* @since
|
|
408 |
* @param [OUT] aSLPId The SLP ID of the default server
|
|
409 |
*/
|
|
410 |
TInt GetDefaultSLPId(TInt64& aSLPId);
|
|
411 |
/**
|
|
412 |
* This method is used to get other flags associated with a slp
|
|
413 |
* @since
|
|
414 |
* @param [IN] aSLPId The SLP ID of the default server
|
|
415 |
* @param [IN] aParameter Indicates which parameter is requested for
|
|
416 |
* @param [OUT] aValue The retrieved value is returned in this.
|
|
417 |
*/
|
|
418 |
void GetOtherPropertiesL(TInt64 aSLPId,CSuplSettingsInternal::TServerParam aParameter,TInt& aValue);
|
|
419 |
|
|
420 |
/**
|
|
421 |
* This method is to Get Server Addresss of a SLP corresponding to a particular Slp Id
|
|
422 |
* @since
|
|
423 |
* @param [IN] aSlpId The Slp Id for which server address is required
|
|
424 |
* @param [OUT] aServerAddress Is used to return the server address
|
|
425 |
*/
|
|
426 |
TInt GetServerAddress(const TInt64 aSlpId, TDes& aServerAddress);
|
|
427 |
/**
|
|
428 |
* This method is to Get manufacturer name of a SLP corresponding to a particular Slp Id
|
|
429 |
* @since
|
|
430 |
* @param [IN] aSlpId The Slp Id for which server address is required
|
|
431 |
* @param [OUT] aManuName Is used to return the manufacturer name
|
|
432 |
*/
|
|
433 |
TInt GetManufacturer(const TInt64 aSlpId, TDes& aManuName);
|
|
434 |
/**
|
|
435 |
* This method is to Get IAP name of a SLP corresponding to a particular Slp Id
|
|
436 |
* @since
|
|
437 |
* @param [IN] aSlpId The Slp Id for which server address is required
|
|
438 |
* @param [OUT] aIAPName Is used to return the IAP name
|
|
439 |
*/
|
|
440 |
TInt GetIAPName(const TInt64 aSlpId, TDes& aIAPName);
|
|
441 |
/**
|
|
442 |
* This method is to last tried time of a SLP corresponding to a particular Slp Id
|
|
443 |
* @since
|
|
444 |
* @param [IN] aSlpId The Slp Id for which server address is required
|
|
445 |
* @param [OUT] aLastTriedTime Is used to return the last tried time
|
|
446 |
*/
|
|
447 |
TInt GetLastTriedTime(const TInt64 aSlpId, TTime& aLastTriedTime);
|
|
448 |
/**
|
|
449 |
* This method is to last used time of a SLP corresponding to a particular Slp Id
|
|
450 |
* @since
|
|
451 |
* @param [IN] aSlpId The Slp Id for which server address is required
|
|
452 |
* @param [OUT] aLastUsedTime Is used to return the last used time
|
|
453 |
*/
|
|
454 |
TInt GetLastUsedTime(const TInt64 aSlpId, TTime& aLastUsedTime);
|
|
455 |
|
|
456 |
/**
|
|
457 |
* This method is retrieve all configurable parameters corresponding to a particular SLP
|
|
458 |
* @since
|
|
459 |
* @param [IN] aSlpId The Slp Id for which values are required
|
|
460 |
* @param [OUT] aParamValues The CServerParams is updated with the values corresponding
|
|
461 |
* to the server.
|
|
462 |
*/
|
|
463 |
TInt GetSlpInfoFromId(const TInt64 aSlpId,CServerParams* aParamValues);
|
|
464 |
/**
|
|
465 |
* This method is retrieve all configurable parameters corresponding to a particular SLP
|
|
466 |
* @since
|
|
467 |
* @param [IN] aServerAddress The server address of the slp for which values are required
|
|
468 |
* @param [OUT] aParamValues The CServerParams is updated with the values corresponding
|
|
469 |
* to the server.
|
|
470 |
*/
|
|
471 |
TInt GetSlpInfoFromAddress(const TDesC& aServerAddress,CServerParams* aParamValues);
|
|
472 |
/**
|
|
473 |
* This method is retrieve all configurable parameters corresponding to the default SLP
|
|
474 |
* @since
|
|
475 |
* @param [IN] aParamValues The CServerParams to be updated with the values corresponding
|
|
476 |
* to the default server.
|
|
477 |
*/
|
|
478 |
TInt GetDefaultServer(CServerParams* aParamValues);
|
|
479 |
/**
|
|
480 |
* This method is retrieve the count of slp entries present
|
|
481 |
* @since
|
|
482 |
* @param [OUT] aCount Contains the number of slp entries as output
|
|
483 |
*/
|
|
484 |
TInt SlpCount(TInt& aCount);
|
|
485 |
/**
|
|
486 |
* This method is to check is a slp entry exists corresponding to a particular SLP Id
|
|
487 |
* @since
|
|
488 |
* @param [IN] aSlpId The Slp ID whcih is to be serached for.
|
|
489 |
*/
|
|
490 |
TBool IsSlpExists(const TInt64 aSlpId);
|
|
491 |
/**
|
|
492 |
* This method is to check is a slp entry exists corresponding to a particular SLP Address
|
|
493 |
* @since
|
|
494 |
* @param [IN] aServerAddress The Slp Address which is to be searched for.
|
|
495 |
*/
|
|
496 |
TBool IsSlpExists(const TDesC& aServerAddress);
|
|
497 |
/**
|
|
498 |
* This method is to check is a slp entry exists corresponding to a particular SLP Address
|
|
499 |
* @since
|
|
500 |
* @param [IN] aServerAddress The Slp Address which is to be searched for.
|
|
501 |
* @param [OUT] aSlpId The SLP Id of the server if found is returned in this
|
|
502 |
*/
|
|
503 |
TBool IsSlpExists(const TDesC& aServerAddress,TInt64& aSlpId);
|
|
504 |
|
|
505 |
/**
|
|
506 |
* This method is to Get Protocol Version of a SLP corresponding to a particular Slp Id
|
|
507 |
* @since
|
|
508 |
* @param [IN] aSlpId The Slp Id for which version number is required
|
|
509 |
* @param [OUT] aMajor Is used to return the Major Version Number]
|
|
510 |
* @param [OUT] aMinor Is used to return the Minor Version Number
|
|
511 |
*/
|
|
512 |
TInt GetVersion(const TInt64 aSlpId,TInt& aMajor, TInt& aMinor);
|
|
513 |
/**
|
|
514 |
* This method is used to retrieve a colummn corresponding to N/w Info Last Use/Last Success
|
|
515 |
* of a particular slp
|
|
516 |
* @since
|
|
517 |
* @param [IN] aParamType Used to indicate which property is requested for
|
|
518 |
* @param [OUT] aNetType The network type
|
|
519 |
* @param [OUT] aMcc Mobile country code. It can have value from 0 to 999
|
|
520 |
* @param [OUT] aMnc Mobile network code. It can have value from 0 to 999
|
|
521 |
* @param [OUT] aCid Cell Identity. It can have value from 0 to 65535 if aNetType is GSM or
|
|
522 |
* it can have value from 0 to 268435455 if aNetType is WCDMA
|
|
523 |
* @param [OUT] aLac Location Aread Code. This parameter is written to settings only if aNetType is GSM.
|
|
524 |
*/
|
|
525 |
void GetNwInfoPropertiesL(TInt64 aSLPId,CSuplSettingsInternal::TServerParam& aParamType ,
|
|
526 |
CSuplSettingsInternal::TSuplSettingsNetworkType& aNetType,TInt& aMcc,TInt& aMnc,
|
|
527 |
TInt& aCid, TInt& aLac);
|
|
528 |
|
|
529 |
/**
|
|
530 |
* This method is used to alter priority of a particular server
|
|
531 |
* @since
|
|
532 |
* @param [IN] aSlpId The Slp Id for which new priority is to be assigned.
|
|
533 |
* @param [IN] aValue The new priority value to be assigned to the server.
|
|
534 |
* @param [IN] aDirection Whether to increase or decrease priority.
|
|
535 |
*/
|
|
536 |
void ChangePriorityL(TInt aSlpId,TInt aValue,TBool aDirection);
|
|
537 |
|
|
538 |
/**
|
|
539 |
* This method deletes all slps which has the sim change remove flag set
|
|
540 |
* @since
|
|
541 |
*/
|
|
542 |
void RemoveOnSimChangeL();
|
|
543 |
|
|
544 |
/**
|
|
545 |
* This method is used to insert Active session record into the SUPL session DB
|
|
546 |
* @since S60 5.2
|
|
547 |
*
|
|
548 |
* @param [IN] aSessionParamValues The CServerParams pointer containing trigger session params
|
|
549 |
* to be added to the DB
|
|
550 |
*/
|
|
551 |
void InsertSessionRecordL(const CTriggerParams* aSessionParamValues);
|
|
552 |
|
|
553 |
/**
|
|
554 |
* This method is used to delete a session record corresponding to the given session ID
|
|
555 |
* @since S60 5.2
|
|
556 |
* @param [OUT] aSessionId The session ID of the session that is to be deleted
|
|
557 |
*/
|
|
558 |
void DeleteSessionRecordL(TInt64 aSessionId);
|
|
559 |
|
|
560 |
|
|
561 |
/**
|
|
562 |
* This method is used to delete all session records from session table
|
|
563 |
* @since S60 5.2
|
|
564 |
*/
|
|
565 |
|
|
566 |
void DeleteAllSessionRecordsL();
|
|
567 |
|
|
568 |
/**
|
|
569 |
* This method is used to update a column of string value corresponding to a particular session record
|
|
570 |
* @since S60 5.2
|
|
571 |
* @param [IN] aSessionId The session ID of the session that is to be updated
|
|
572 |
* @param [IN] aParameter The TSessionParam enum which indicates which property is to be updated
|
|
573 |
* @param [IN] aValue The new value to be updated to the session db
|
|
574 |
*/
|
|
575 |
void UpdateSessionRecordL(TInt64 aSessionId,CSuplSettingsInternal::TSessionParam aParameter,TUint64 aValue);
|
|
576 |
|
|
577 |
/**
|
|
578 |
* This synchronous method is retrieve parameters corresponding to all existing session records
|
|
579 |
* @since S60 5.2
|
|
580 |
* @param [OUT] aParamValues The Array of CTriggerParams which needs
|
|
581 |
* to filled with session parameters
|
|
582 |
*/
|
|
583 |
void GetAllSessionsL(RPointerArray<CTriggerParams>& aParamValues);
|
|
584 |
|
|
585 |
/**
|
|
586 |
* This synchronous method is retrieve parameters corresponding to given session
|
|
587 |
* @since S60 5.2
|
|
588 |
* @param [IN] aSessionId Session id to get parameters
|
|
589 |
* @param [OUT] aParamValues Parameters of a given session
|
|
590 |
*/
|
|
591 |
void GetSessionL(TInt64 aSessionId,
|
|
592 |
CTriggerParams*& aParamValues);
|
|
593 |
|
|
594 |
/**
|
|
595 |
* This method is retrieve the count of session entries present
|
|
596 |
* @since S60 5.2
|
|
597 |
* @param [OUT] aCount Contains the number of session entries as output
|
|
598 |
*/
|
|
599 |
TInt SessionCount(TInt& aCount);
|
|
600 |
/**
|
|
601 |
* This method is to check is a session entry exists corresponding to a particular session Id
|
|
602 |
* @since S60 5.2
|
|
603 |
* @param [IN] aSessionId The session ID whcih is to be searched for.
|
|
604 |
*/
|
|
605 |
TBool IsSessionExists(const TInt64 aSessionId);
|
|
606 |
|
|
607 |
/**
|
|
608 |
* This method is used to retrieve extended parameters of given server
|
|
609 |
* @since S60 5.2
|
|
610 |
*/
|
|
611 |
void GetServerExtensionParamsL( TInt64 aSlpId,CServerExtensionParams* aServerExtnParams );
|
|
612 |
|
|
613 |
/**
|
|
614 |
* This method is used to set extended parameters of a given server.
|
|
615 |
* @since S60 5.2
|
|
616 |
*/
|
|
617 |
void UpdateServerExtensionParamsL( TInt64 aSlpId,CServerExtensionParams* aServerExtnParams );
|
|
618 |
|
|
619 |
private: // Member data
|
|
620 |
|
|
621 |
|
|
622 |
// RSqlDatabase Instance
|
|
623 |
RSqlDatabase iDb;
|
|
624 |
|
|
625 |
//holds current slp id for which the request was made
|
|
626 |
TInt64 iSLPId;
|
|
627 |
|
|
628 |
|
|
629 |
TRequestStatus* iStatus;
|
|
630 |
|
|
631 |
//used to access central repository for retrieving default settings values
|
|
632 |
CRepository* iSettingsRep;
|
|
633 |
//used to access central repository for incdicating change in settings values
|
|
634 |
CRepository* iSettingsNotifierRep;
|
|
635 |
//To hold the SQL Query String
|
|
636 |
TBuf<KCustomSqlMaxLength> iSQLString;
|
|
637 |
};
|
|
638 |
|
|
639 |
#endif // __CSETTINGSDATABASEHANDLER__
|
|
640 |
|
|
641 |
|