author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:40:28 +0300 | |
branch | RCL_3 |
changeset 49 | 10852b179f64 |
parent 45 | 6b6920c56e2f |
child 55 | ea98413ce11f |
permissions | -rw-r--r-- |
45 | 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: Adapter to the SUPL Settings API |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// System Includes |
|
20 |
#include <epos_csuplsettings.h> |
|
21 |
#include <locsuplsettingsui.rsg> |
|
22 |
#include <StringLoader.h> |
|
23 |
||
24 |
// User Includes |
|
25 |
#include "locsuplsettingsadapter.h" |
|
26 |
#include "locsuplsettingsadapterobserver.h" |
|
27 |
#include "locsuplsettingssessionobserver.h" |
|
28 |
#include "locsupldebug.h" |
|
29 |
||
30 |
||
31 |
||
32 |
// --------------------------------------------------------------------------- |
|
33 |
// Private Constructor |
|
34 |
// --------------------------------------------------------------------------- |
|
35 |
// |
|
36 |
CLocSUPLSettingsAdapter::CLocSUPLSettingsAdapter( |
|
37 |
MLocSUPLSettingsAdapterObserver& aObserver ) |
|
38 |
:CActive( EPriorityStandard ), |
|
39 |
iObserver( aObserver ) |
|
40 |
{ |
|
41 |
} |
|
42 |
||
43 |
// --------------------------------------------------------------------------- |
|
44 |
// Destructor |
|
45 |
// --------------------------------------------------------------------------- |
|
46 |
// |
|
47 |
CLocSUPLSettingsAdapter::~CLocSUPLSettingsAdapter() |
|
48 |
{ |
|
49 |
DEBUG( + CLocSUPLSettingsAdapter::~CLocSUPLSettingsAdapter ); |
|
50 |
Cancel(); |
|
51 |
||
52 |
if( iSUPLSettings ) |
|
53 |
{ |
|
54 |
iSUPLSettings->RemoveObserver(); |
|
55 |
iSUPLSettings->RemoveSessionObserver(); |
|
56 |
} |
|
57 |
||
58 |
delete iSUPLSettings; |
|
59 |
iSUPLSettings = NULL; |
|
60 |
||
61 |
DEBUG( - CLocSUPLSettingsAdapter::~CLocSUPLSettingsAdapter ); |
|
62 |
} |
|
63 |
||
64 |
// --------------------------------------------------------------------------- |
|
65 |
// CLocSUPLSettingsAdapter* CLocSUPLSettingsAdapter::NewL |
|
66 |
// Static Two phase contructor that instantiates the CLocSUPLSettingsAdapter |
|
67 |
// |
|
68 |
// @param aObserver Observer to the SUPL settings adapter |
|
69 |
// @return CLocSUPLSettingsAdapter* Reference to the object created |
|
70 |
// --------------------------------------------------------------------------- |
|
71 |
// |
|
72 |
CLocSUPLSettingsAdapter* CLocSUPLSettingsAdapter::NewL( |
|
73 |
MLocSUPLSettingsAdapterObserver& aObserver ) |
|
74 |
{ |
|
75 |
DEBUG( + CLocSUPLSettingsAdapter::NewL ); |
|
76 |
CLocSUPLSettingsAdapter* self = |
|
77 |
new ( ELeave ) CLocSUPLSettingsAdapter( aObserver ); |
|
78 |
CleanupStack::PushL( self ); |
|
79 |
self->ConstructL(); |
|
80 |
CleanupStack::Pop( self ); |
|
81 |
DEBUG( - CLocSUPLSettingsAdapter::NewL ); |
|
82 |
return self; |
|
83 |
} |
|
84 |
||
85 |
// --------------------------------------------------------------------------- |
|
86 |
// void CLocSUPLSettingsAdapter::ConstructL |
|
87 |
// Second phase of the two phase constructor |
|
88 |
// --------------------------------------------------------------------------- |
|
89 |
// |
|
90 |
void CLocSUPLSettingsAdapter::ConstructL() |
|
91 |
{ |
|
92 |
DEBUG( + CLocSUPLSettingsAdapter::ConstructL ); |
|
93 |
// Create the SUPL Settings |
|
94 |
iSUPLSettings = CSuplSettings::NewL(); |
|
95 |
||
96 |
// Set the Observer for SUPL Settings |
|
97 |
iSUPLSettings->SetObserverL( *this ); |
|
98 |
||
99 |
// Set the Observer for SUPL Sessions |
|
100 |
iSUPLSettings->SetSessionObserverL( *this ); |
|
101 |
||
102 |
||
103 |
CActiveScheduler::Add( this ); |
|
104 |
DEBUG( - CLocSUPLSettingsAdapter::ConstructL ); |
|
105 |
} |
|
106 |
||
107 |
// --------------------------------------------------------------------------- |
|
108 |
// void CLocSUPLSettingsAdapter::Initialize |
|
109 |
// Initializes the SUPL Settings API. This is an asynchronus call, the call |
|
110 |
// back for which is given through the observer |
|
111 |
// --------------------------------------------------------------------------- |
|
112 |
// |
|
113 |
void CLocSUPLSettingsAdapter::Initialize() |
|
114 |
{ |
|
115 |
DEBUG( + CLocSUPLSettingsAdapter::Initialize ); |
|
116 |
if( !IsActive()) |
|
117 |
{ |
|
118 |
iSUPLSettings->Initialize( iStatus ); |
|
119 |
SetActive(); |
|
120 |
} |
|
121 |
DEBUG( - CLocSUPLSettingsAdapter::Initialize ); |
|
122 |
} |
|
123 |
||
124 |
// --------------------------------------------------------------------------- |
|
125 |
// void CLocSUPLSettingsAdapter::CancelInitialize |
|
126 |
// Cancels the Initialization |
|
127 |
// --------------------------------------------------------------------------- |
|
128 |
// |
|
129 |
void CLocSUPLSettingsAdapter::CancelInitialize() |
|
130 |
{ |
|
131 |
Cancel(); |
|
132 |
} |
|
133 |
||
134 |
||
135 |
||
136 |
// --------------------------------------------------------------------------- |
|
137 |
// void CLocSUPLSettingsAdapter::HandleSuplSettingsChangeL |
|
138 |
// Handle the Settings UI changes |
|
139 |
// --------------------------------------------------------------------------- |
|
140 |
// |
|
141 |
void CLocSUPLSettingsAdapter::HandleSuplSettingsChangeL( |
|
142 |
TSuplSettingsEventType /*aEvent*/, |
|
143 |
TInt /*aSlpId*/ |
|
144 |
) |
|
145 |
{ |
|
146 |
DEBUG( + CLocSUPLSettingsAdapter::HandleSuplSettingsChangeL ); |
|
147 |
iObserver.HandleSuplSettingsChangeL( |
|
148 |
MLocSUPLSettingsAdapterObserver::ESUPLSettingsChanged ); |
|
149 |
DEBUG( - CLocSUPLSettingsAdapter::HandleSuplSettingsChangeL ); |
|
150 |
} |
|
151 |
||
152 |
// --------------------------------------------------------------------------- |
|
153 |
// void CLocSUPLSettingsAdapter::HandleSuplSessionChangeL |
|
154 |
// Handle the Supl Session changes |
|
155 |
// --------------------------------------------------------------------------- |
|
156 |
// |
|
157 |
void CLocSUPLSettingsAdapter::HandleSuplSessionChangeL( |
|
158 |
TSuplSessionEventType aEvent, |
|
159 |
TInt64 aSessionId |
|
160 |
) |
|
161 |
{ |
|
162 |
DEBUG( + CLocSUPLSettingsAdapter::HandleSuplSessionChangeL ); |
|
163 |
if( iSessionObserver && iSessionObserver->SessionId() == aSessionId ) |
|
164 |
{ |
|
165 |
MLocSUPLSettingsSessionObserver::TUpdateType updateType = |
|
166 |
MLocSUPLSettingsSessionObserver::ESessionModified; |
|
167 |
||
168 |
if( MSuplSessionObserver::ESuplSessionDBDeleteEvent == aEvent ) |
|
169 |
updateType = MLocSUPLSettingsSessionObserver::ESessionDeleted; |
|
170 |
||
171 |
iSessionObserver->UpdateSessionL( updateType ); |
|
172 |
} |
|
173 |
||
174 |
iObserver.HandleSuplSettingsChangeL( |
|
175 |
MLocSUPLSettingsAdapterObserver::ESUPLSettingsChanged ); |
|
176 |
DEBUG( - CLocSUPLSettingsAdapter::HandleSuplSessionChangeL ); |
|
177 |
} |
|
178 |
||
179 |
// --------------------------------------------------------------------------- |
|
180 |
// void CLocSUPLSettingsAdapter::RunL |
|
181 |
// Inherited from CActive |
|
182 |
// --------------------------------------------------------------------------- |
|
183 |
// |
|
184 |
void CLocSUPLSettingsAdapter::RunL() |
|
185 |
{ |
|
186 |
DEBUG( + CLocSUPLSettingsAdapter::RunL ); |
|
187 |
// If the SUPL settings API has been successfull initalized then a success |
|
188 |
// call back needs to be issued. In all other cases, other than a KErrCancel |
|
189 |
// it is assumed that the initailization has failed. |
|
190 |
if( iStatus.Int() == KErrNone ) |
|
191 |
{ |
|
192 |
iObserver.HandleSuplSettingsChangeL( |
|
193 |
MLocSUPLSettingsAdapterObserver::ESUPLSettingsIntialized ); |
|
194 |
} |
|
195 |
else if( iStatus.Int() != KErrCancel ) |
|
196 |
{ |
|
197 |
iObserver.HandleSuplSettingsChangeL( |
|
198 |
MLocSUPLSettingsAdapterObserver::ESUPLSettingsInitalizeError ); |
|
199 |
} |
|
200 |
DEBUG( - CLocSUPLSettingsAdapter::RunL ); |
|
201 |
} |
|
202 |
||
203 |
// --------------------------------------------------------------------------- |
|
204 |
// void CLocSUPLSettingsAdapter::DoCancel |
|
205 |
// Inherited from CActive |
|
206 |
// --------------------------------------------------------------------------- |
|
207 |
// |
|
208 |
void CLocSUPLSettingsAdapter::DoCancel() |
|
209 |
{ |
|
210 |
iSUPLSettings->CancelInitialize(); |
|
211 |
} |
|
212 |
||
213 |
||
214 |
//*************************************************************************** |
|
215 |
// |
|
216 |
// @since S60 9.1TB |
|
217 |
// |
|
218 |
// *************************************************************************** |
|
219 |
||
220 |
// --------------------------------------------------------------------------- |
|
221 |
// void CLocSUPLSettingsAdapter::AddNewServerL |
|
222 |
// --------------------------------------------------------------------------- |
|
223 |
// |
|
224 |
void CLocSUPLSettingsAdapter::AddNewServerL( |
|
225 |
const TDesC& aServerAddress, |
|
226 |
const TDesC& aIapName, |
|
227 |
const TBool aUsageInHomeNw |
|
228 |
) |
|
229 |
{ |
|
230 |
DEBUG( + CLocSUPLSettingsAdapter::AddNewServerL ); |
|
231 |
CServerParams* serverParam = CServerParams::NewL(); |
|
232 |
CleanupStack::PushL( serverParam ); |
|
233 |
User::LeaveIfError(serverParam->Set( |
|
234 |
aServerAddress, |
|
235 |
aIapName, |
|
236 |
ETrue, |
|
237 |
EFalse, // default value |
|
238 |
aUsageInHomeNw, |
|
239 |
ETrue )); |
|
240 |
||
241 |
TInt64 slpId; |
|
242 |
User::LeaveIfError( iSUPLSettings->AddNewServer( serverParam, slpId ) ); |
|
243 |
CleanupStack::PopAndDestroy(); |
|
244 |
DEBUG( - CLocSUPLSettingsAdapter::AddNewServerL ); |
|
245 |
} |
|
246 |
||
247 |
// --------------------------------------------------------------------------- |
|
248 |
// void CLocSUPLSettingsAdapter::RemoveServerL |
|
249 |
// --------------------------------------------------------------------------- |
|
250 |
// |
|
251 |
void CLocSUPLSettingsAdapter::RemoveServerL( |
|
252 |
const TInt64 aSlpId |
|
253 |
) |
|
254 |
{ |
|
255 |
DEBUG( + CLocSUPLSettingsAdapter::RemoveServerL ); |
|
256 |
User::LeaveIfError( iSUPLSettings->RemoveServer( aSlpId ) ); |
|
257 |
DEBUG( - CLocSUPLSettingsAdapter::RemoveServerL ); |
|
258 |
} |
|
259 |
||
260 |
// --------------------------------------------------------------------------- |
|
261 |
// void CLocSUPLSettingsAdapter::GetAllSlpL |
|
262 |
// --------------------------------------------------------------------------- |
|
263 |
// |
|
264 |
void CLocSUPLSettingsAdapter::GetAllSlpL( |
|
265 |
RPointerArray<CServerParams>& aParamValues |
|
266 |
) const |
|
267 |
{ |
|
268 |
DEBUG( + CLocSUPLSettingsAdapter::GetAllSlpL ); |
|
269 |
User::LeaveIfError( iSUPLSettings->GetAllSlp( aParamValues ) ); |
|
270 |
DEBUG( - CLocSUPLSettingsAdapter::GetAllSlpL ); |
|
271 |
} |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
272 |
|
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
273 |
// --------------------------------------------------------------------------- |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
274 |
// void CLocSUPLSettingsAdapter::GenerateHslpAddressFromImsi() |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
275 |
// |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
276 |
// --------------------------------------------------------------------------- |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
277 |
// |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
278 |
void CLocSUPLSettingsAdapter::GenerateHslpAddressFromImsi(TDes& aIMSIAddress) |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
279 |
{ |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
280 |
DEBUG( + CLocSUPLSettingsAdapter::GenerateHslpAddressFromImsi ); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
281 |
iSUPLSettings->GenerateHslpAddressFromImsi(aIMSIAddress); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
282 |
DEBUG( - CLocSUPLSettingsAdapter::GenerateHslpAddressFromImsi ); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
283 |
} |
45 | 284 |
|
285 |
// --------------------------------------------------------------------------- |
|
286 |
// void CLocSUPLSettingsAdapter::GetSlpInfoFromIdL |
|
287 |
// --------------------------------------------------------------------------- |
|
288 |
// |
|
289 |
void CLocSUPLSettingsAdapter::GetSlpInfoFromIdL( |
|
290 |
const TInt64 aSlpId, |
|
291 |
CServerParams *aParamValues |
|
292 |
) const |
|
293 |
{ |
|
294 |
DEBUG( + CLocSUPLSettingsAdapter::GetSlpInfoFromIdL ); |
|
295 |
User::LeaveIfError( iSUPLSettings->GetSlpInfoFromId( aSlpId, aParamValues ) ); |
|
296 |
DEBUG( - CLocSUPLSettingsAdapter::GetSlpInfoFromIdL ); |
|
297 |
} |
|
298 |
||
299 |
// --------------------------------------------------------------------------- |
|
300 |
// void CLocSUPLSettingsAdapter::ChangePriorityL |
|
301 |
// --------------------------------------------------------------------------- |
|
302 |
// |
|
303 |
void CLocSUPLSettingsAdapter::ChangePriorityL( |
|
304 |
TInt64 aSlpId, |
|
305 |
TInt aPriority, |
|
306 |
TBool aDirection |
|
307 |
) |
|
308 |
{ |
|
309 |
DEBUG( + CLocSUPLSettingsAdapter::ChangePriorityL ); |
|
310 |
User::LeaveIfError( |
|
311 |
iSUPLSettings->ChangePriority( aSlpId, aPriority, aDirection ) ); |
|
312 |
DEBUG( - CLocSUPLSettingsAdapter::ChangePriorityL ); |
|
313 |
} |
|
314 |
||
315 |
// --------------------------------------------------------------------------- |
|
316 |
// void CLocSUPLSettingsAdapter::SetServerAddressL |
|
317 |
// --------------------------------------------------------------------------- |
|
318 |
// |
|
319 |
void CLocSUPLSettingsAdapter::SetServerAddressL( |
|
320 |
const TInt64 aSlpId, |
|
321 |
const TDesC& aServerAddress |
|
322 |
) |
|
323 |
{ |
|
324 |
DEBUG( + CLocSUPLSettingsAdapter::SetServerAddressL ); |
|
325 |
User::LeaveIfError( iSUPLSettings->SetServerAddress( aSlpId, aServerAddress ) ); |
|
326 |
DEBUG( - CLocSUPLSettingsAdapter::SetServerAddressL ); |
|
327 |
} |
|
328 |
||
329 |
// --------------------------------------------------------------------------- |
|
330 |
// void CLocSUPLSettingsAdapter::GetServerAddressL |
|
331 |
// --------------------------------------------------------------------------- |
|
332 |
// |
|
333 |
void CLocSUPLSettingsAdapter::GetServerAddressL( |
|
334 |
TInt64 aSlpId, |
|
335 |
TDes& aServerAddress |
|
336 |
) const |
|
337 |
{ |
|
338 |
DEBUG( + CLocSUPLSettingsAdapter::GetServerAddressL ); |
|
339 |
User::LeaveIfError( iSUPLSettings->GetServerAddress( aSlpId, aServerAddress ) ); |
|
340 |
DEBUG( - CLocSUPLSettingsAdapter::GetServerAddressL ); |
|
341 |
} |
|
342 |
||
343 |
// --------------------------------------------------------------------------- |
|
344 |
// void CLocSUPLSettingsAdapter::SetIapNameL |
|
345 |
// --------------------------------------------------------------------------- |
|
346 |
// |
|
347 |
void CLocSUPLSettingsAdapter::SetIapNameL( |
|
348 |
const TInt64 aSlpId, |
|
349 |
const TDesC& aIapName |
|
350 |
) |
|
351 |
{ |
|
352 |
DEBUG( + CLocSUPLSettingsAdapter::SetIapNameL ); |
|
353 |
User::LeaveIfError( iSUPLSettings->SetIapName( aSlpId, aIapName ) ); |
|
354 |
DEBUG( - CLocSUPLSettingsAdapter::SetIapNameL ); |
|
355 |
} |
|
356 |
||
357 |
// --------------------------------------------------------------------------- |
|
358 |
// void CLocSUPLSettingsAdapter::GetIapNameL |
|
359 |
// --------------------------------------------------------------------------- |
|
360 |
// |
|
361 |
void CLocSUPLSettingsAdapter::GetIapNameL( |
|
362 |
const TInt64 aSlpId, |
|
363 |
TDes& aIapName |
|
364 |
) const |
|
365 |
{ |
|
366 |
DEBUG( + CLocSUPLSettingsAdapter::GetIapNameL ); |
|
367 |
User::LeaveIfError( iSUPLSettings->GetIapName( aSlpId, aIapName ) ); |
|
368 |
DEBUG( - CLocSUPLSettingsAdapter::GetIapNameL ); |
|
369 |
} |
|
370 |
||
371 |
// --------------------------------------------------------------------------- |
|
372 |
// void CLocSUPLSettingsAdapter::SetServerEnabledFlagL |
|
373 |
// --------------------------------------------------------------------------- |
|
374 |
// |
|
375 |
void CLocSUPLSettingsAdapter::SetServerEnabledFlagL( |
|
376 |
const TInt64 aSlpId, |
|
377 |
const TBool aEnable |
|
378 |
) |
|
379 |
{ |
|
380 |
DEBUG( + CLocSUPLSettingsAdapter::SetServerEnabledFlagL ); |
|
381 |
User::LeaveIfError( iSUPLSettings->SetServerEnabledFlag( aSlpId, aEnable ) ); |
|
382 |
DEBUG( - CLocSUPLSettingsAdapter::SetServerEnabledFlagL ); |
|
383 |
} |
|
384 |
||
385 |
// --------------------------------------------------------------------------- |
|
386 |
// void CLocSUPLSettingsAdapter::GetServerEnabledFlagL |
|
387 |
// --------------------------------------------------------------------------- |
|
388 |
// |
|
389 |
void CLocSUPLSettingsAdapter::GetServerEnabledFlagL( |
|
390 |
const TInt64 aSlpId, |
|
391 |
TBool& aEnable |
|
392 |
) const |
|
393 |
{ |
|
394 |
DEBUG( + CLocSUPLSettingsAdapter::GetServerEnabledFlagL ); |
|
395 |
User::LeaveIfError( iSUPLSettings->GetServerEnabledFlag( aSlpId, aEnable ) ); |
|
396 |
DEBUG( - CLocSUPLSettingsAdapter::GetServerEnabledFlagL ); |
|
397 |
} |
|
398 |
||
399 |
// --------------------------------------------------------------------------- |
|
400 |
// void CLocSUPLSettingsAdapter::SetUsageInHomwNwFlagL |
|
401 |
// --------------------------------------------------------------------------- |
|
402 |
// |
|
403 |
void CLocSUPLSettingsAdapter::SetUsageInHomwNwFlagL( |
|
404 |
const TInt64 aSlpId, |
|
405 |
const TBool aHomeNwFlag |
|
406 |
) |
|
407 |
{ |
|
408 |
DEBUG( + CLocSUPLSettingsAdapter::SetUsageInHomwNwFlagL ); |
|
409 |
User::LeaveIfError( iSUPLSettings->SetUsageInHomwNwFlag( aSlpId, aHomeNwFlag ) ); |
|
410 |
DEBUG( - CLocSUPLSettingsAdapter::SetUsageInHomwNwFlagL ); |
|
411 |
} |
|
412 |
||
413 |
// --------------------------------------------------------------------------- |
|
414 |
// void CLocSUPLSettingsAdapter::GetUsageInHomwNwFlagL |
|
415 |
// --------------------------------------------------------------------------- |
|
416 |
// |
|
417 |
void CLocSUPLSettingsAdapter::GetUsageInHomwNwFlagL( |
|
418 |
const TInt64 aSlpId, |
|
419 |
TBool& aHomeNwFlag |
|
420 |
) const |
|
421 |
{ |
|
422 |
DEBUG( + CLocSUPLSettingsAdapter::SetUsageInHomwNwFlagL ); |
|
423 |
User::LeaveIfError( iSUPLSettings->GetUsageInHomwNwFlag( aSlpId, aHomeNwFlag ) ); |
|
424 |
DEBUG( - CLocSUPLSettingsAdapter::GetServerEnabledFlagL ); |
|
425 |
} |
|
426 |
||
427 |
// --------------------------------------------------------------------------- |
|
428 |
// void CLocSUPLSettingsAdapter::SetEditableFlagL |
|
429 |
// --------------------------------------------------------------------------- |
|
430 |
// |
|
431 |
void CLocSUPLSettingsAdapter::SetEditableFlagL( |
|
432 |
const TInt64 aSlpId, |
|
433 |
const TBool aEditFlag |
|
434 |
) const |
|
435 |
{ |
|
436 |
DEBUG( + CLocSUPLSettingsAdapter::SetEditableFlagL ); |
|
437 |
User::LeaveIfError( iSUPLSettings->SetEditableFlag( aSlpId, aEditFlag ) ); |
|
438 |
DEBUG( - CLocSUPLSettingsAdapter::SetEditableFlagL ); |
|
439 |
} |
|
440 |
||
441 |
// --------------------------------------------------------------------------- |
|
442 |
// void CLocSUPLSettingsAdapter::GetEditableFlagL |
|
443 |
// --------------------------------------------------------------------------- |
|
444 |
// |
|
445 |
void CLocSUPLSettingsAdapter::GetEditableFlagL( |
|
446 |
const TInt64 aSlpId, |
|
447 |
TBool& aEditFlag |
|
448 |
) const |
|
449 |
{ |
|
450 |
DEBUG( + CLocSUPLSettingsAdapter::GetEditableFlagL ); |
|
451 |
User::LeaveIfError( iSUPLSettings->GetEditableFlag( aSlpId, aEditFlag ) ); |
|
452 |
DEBUG( - CLocSUPLSettingsAdapter::GetEditableFlagL ); |
|
453 |
} |
|
454 |
||
455 |
// --------------------------------------------------------------------------- |
|
456 |
// void CLocSUPLSettingsAdapter::SlpCountL |
|
457 |
// --------------------------------------------------------------------------- |
|
458 |
// |
|
459 |
void CLocSUPLSettingsAdapter::SlpCountL( |
|
460 |
TInt& aCount |
|
461 |
) |
|
462 |
{ |
|
463 |
DEBUG( + CLocSUPLSettingsAdapter::SlpCountL ); |
|
464 |
User::LeaveIfError( iSUPLSettings->SlpCount( aCount ) ); |
|
465 |
DEBUG( - CLocSUPLSettingsAdapter::SlpCountL ); |
|
466 |
} |
|
467 |
||
468 |
// --------------------------------------------------------------------------- |
|
469 |
// void CLocSUPLSettingsAdapter::GetActiveSessionsCountL |
|
470 |
// --------------------------------------------------------------------------- |
|
471 |
// |
|
472 |
void CLocSUPLSettingsAdapter::GetActiveSessionsCountL( TInt& aActiveSessionsCount ) |
|
473 |
{ |
|
474 |
DEBUG( + CLocSUPLSettingsAdapter::GetActiveSessionsCountL ); |
|
475 |
RPointerArray< CTriggerParams > aParamValues; |
|
476 |
TInt ret = iSUPLSettings->GetTriggerParams( aParamValues ); |
|
477 |
if( ret == KErrNotFound ) |
|
478 |
{ |
|
479 |
aParamValues.ResetAndDestroy(); |
|
480 |
aParamValues.Close(); |
|
481 |
aActiveSessionsCount = 0; |
|
482 |
} |
|
483 |
else if ( ret == KErrNone ) |
|
484 |
{ |
|
485 |
TInt activeSessionsCount = aParamValues.Count(); |
|
486 |
aParamValues.ResetAndDestroy(); |
|
487 |
aParamValues.Close(); |
|
488 |
aActiveSessionsCount = activeSessionsCount; |
|
489 |
} |
|
490 |
else |
|
491 |
{ |
|
492 |
aParamValues.ResetAndDestroy(); |
|
493 |
aParamValues.Close(); |
|
494 |
//Leave with error |
|
495 |
User::Leave( ret ); |
|
496 |
} |
|
497 |
DEBUG( - CLocSUPLSettingsAdapter::GetActiveSessionsCountL ); |
|
498 |
} |
|
499 |
||
500 |
// --------------------------------------------------------------------------- |
|
501 |
// void CLocSUPLSettingsAdapter::GetTriggerParamsL |
|
502 |
// --------------------------------------------------------------------------- |
|
503 |
// |
|
504 |
void CLocSUPLSettingsAdapter::GetTriggerParamsL( RPointerArray<CTriggerParams>& aParamValues ) const |
|
505 |
{ |
|
506 |
DEBUG( + CLocSUPLSettingsAdapter::GetTriggerParamsL ); |
|
507 |
TInt ret = iSUPLSettings->GetTriggerParams( aParamValues ); |
|
508 |
if(( ret != KErrNotFound ) && ( ret != KErrNone )) |
|
509 |
{ |
|
510 |
User::Leave( ret ); |
|
511 |
} |
|
512 |
DEBUG( - CLocSUPLSettingsAdapter::GetTriggerParamsL ); |
|
513 |
} |
|
514 |
||
515 |
// --------------------------------------------------------------------------- |
|
516 |
// void CLocSUPLSettingsAdapter::GetTriggerParamsL |
|
517 |
// --------------------------------------------------------------------------- |
|
518 |
// |
|
519 |
void CLocSUPLSettingsAdapter::GetTriggerParamsL( TInt64 aSessionId, CTriggerParams*& aTrigger ) const |
|
520 |
{ |
|
521 |
DEBUG( + CLocSUPLSettingsAdapter::GetTriggerParamsL ); |
|
522 |
TInt ret = iSUPLSettings->GetTriggerParams( aSessionId, aTrigger ); |
|
523 |
if( !ret ) |
|
524 |
{ |
|
525 |
User::Leave( ret ); |
|
526 |
} |
|
527 |
DEBUG( - CLocSUPLSettingsAdapter::GetTriggerParamsL ); |
|
528 |
} |
|
529 |
||
530 |
// --------------------------------------------------------------------------- |
|
531 |
// void CLocSUPLSettingsAdapter::ChangeNotificationStatusL |
|
532 |
// --------------------------------------------------------------------------- |
|
533 |
// |
|
534 |
void CLocSUPLSettingsAdapter::ChangeNotificationStatusL( TInt64 aSessionId, TBool aTriggerNotificationStatus ) const |
|
535 |
{ |
|
536 |
DEBUG( + CLocSUPLSettingsAdapter::ChangeNotificationStatusL ); |
|
537 |
TInt ret = iSUPLSettings->SetNotificationStatus( aSessionId, aTriggerNotificationStatus ); |
|
538 |
if(( ret != KErrNotFound ) && ( ret != KErrNone )) |
|
539 |
{ |
|
540 |
User::Leave( ret ); |
|
541 |
} |
|
542 |
DEBUG( - CLocSUPLSettingsAdapter::ChangeNotificationStatusL ); |
|
543 |
} |
|
544 |
||
545 |
// --------------------------------------------------------------------------- |
|
546 |
// void CLocSUPLSettingsAdapter::RemoveTriggerSessionL |
|
547 |
// --------------------------------------------------------------------------- |
|
548 |
// |
|
549 |
void CLocSUPLSettingsAdapter::RemoveTriggerSessionL( TInt64 aSessionId ) const |
|
550 |
{ |
|
551 |
DEBUG( + CLocSUPLSettingsAdapter::RemoveTriggerSessionL ); |
|
552 |
iSUPLSettings->CancelTriggerSession( aSessionId ); |
|
553 |
DEBUG( - CLocSUPLSettingsAdapter::RemoveTriggerSessionL ); |
|
554 |
} |
|
555 |
||
556 |
// --------------------------------------------------------------------------- |
|
557 |
// void CLocSUPLSettingsAdapter::SetSessionObserver |
|
558 |
// --------------------------------------------------------------------------- |
|
559 |
// |
|
560 |
void CLocSUPLSettingsAdapter::SetSessionObserver( MLocSUPLSettingsSessionObserver* aObserver ) |
|
561 |
{ |
|
562 |
iSessionObserver = aObserver; |
|
563 |
} |
|
564 |
||
565 |
// --------------------------------------------------------------------------- |
|
566 |
// void CLocSUPLSettingsAdapter::RemoveSessionObserver |
|
567 |
// --------------------------------------------------------------------------- |
|
568 |
// |
|
569 |
void CLocSUPLSettingsAdapter::RemoveSessionObserver( ) |
|
570 |
{ |
|
571 |
iSessionObserver = NULL; |
|
572 |
} |
|
573 |
||
574 |
// End of file |