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: 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 |
// System Includes
|
|
23 |
#include <e32keys.h>
|
|
24 |
#include <locsuplsettingsui.rsg>
|
|
25 |
#include <StringLoader.h>
|
|
26 |
#include <akntextsettingpage.h> // Text editor
|
|
27 |
#include <commdb.h> // CommsDatabase
|
|
28 |
#include <cmapplicationsettingsui.h>// Access Point Configurator
|
|
29 |
#include <cmplugincsddef.h> // For UID of CSD BearerType
|
|
30 |
#include <cmpluginpacketdatadef.h> // For UID of Packet data BearerType
|
|
31 |
#include <cmmanager.h> // For Conversion from UID to Name and Name to UID
|
|
32 |
#include <cmconnectionmethod.h> // For Conversion from UID to Name and Name to UID
|
|
33 |
#include <aknnotewrappers.h> // Error Notes
|
|
34 |
#include <textresolver.h>
|
|
35 |
#include <cdbcols.h>
|
|
36 |
#include <bldvariant.hrh> // For 3.2 SDK flag
|
|
37 |
#include <AknGlobalConfirmationQuery.h> // For Global confirmation query
|
|
38 |
#include <avkon.hrh> // For the Softkey definition
|
|
39 |
#include <aknSDData.h> // Secondary display data for confirmation
|
|
40 |
// query
|
|
41 |
#include <badesca.h> // For Radio button array
|
|
42 |
#include <aknradiobuttonsettingpage.h> // Akn Radio button page
|
|
43 |
#include "locsuplsettingscoverui.h" // Secondary display API
|
|
44 |
#include <aknViewAppUi.h>
|
|
45 |
#include <epos_csuplsettingsconstants.h>
|
|
46 |
|
|
47 |
// User Includes
|
|
48 |
#include "locsuplsettingsuiengine.h"
|
|
49 |
#include "locsuplsettingsuiengobserver.h"
|
|
50 |
#include "locsuplsettingsadapter.h"
|
|
51 |
#include "locsuplservereditor.h"
|
|
52 |
#include "locsuplsessioneditor.h"
|
|
53 |
#include "locsupldebug.h"
|
|
54 |
|
|
55 |
// Constants
|
|
56 |
const TInt KMaxBufferLength = 0x100;
|
|
57 |
const TInt KNoofUsageSettings = 4;
|
|
58 |
|
|
59 |
// ---------------------------------------------------------------------------
|
|
60 |
// CLocSUPLSettingsUiEngine::CLocSUPLSettingsUiEngine
|
|
61 |
// C++ default constructor.
|
|
62 |
// ---------------------------------------------------------------------------
|
|
63 |
//
|
|
64 |
CLocSUPLSettingsUiEngine::CLocSUPLSettingsUiEngine(
|
|
65 |
MLocSUPLSettingsUiEngObserver& aObserver )
|
|
66 |
: CActive( EPriorityStandard ),
|
|
67 |
iObserver( aObserver ),
|
|
68 |
iConversionBufferPtr( NULL, 0 ),
|
|
69 |
iSettingsBufferPtr( NULL, 0),
|
|
70 |
iCurrentSlpId( -1 ),
|
|
71 |
iEditorObserver( NULL ),
|
|
72 |
iTempAP(-1)
|
|
73 |
{
|
|
74 |
// No implementation
|
|
75 |
}
|
|
76 |
|
|
77 |
// ---------------------------------------------------------------------------
|
|
78 |
// CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine
|
|
79 |
// Destructor.
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine()
|
|
83 |
{
|
|
84 |
DEBUG( + CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine );
|
|
85 |
Cancel();
|
|
86 |
|
|
87 |
// Delete the Confirmation query
|
|
88 |
delete iConfirmQuery;
|
|
89 |
iConfirmQuery = NULL;
|
|
90 |
|
|
91 |
delete iSUPLSettingsAdapter;
|
|
92 |
iSUPLSettingsAdapter = NULL;
|
|
93 |
|
|
94 |
// Delete the Conversion buffers
|
|
95 |
delete iConversionBuffer;
|
|
96 |
iConversionBuffer = NULL;
|
|
97 |
|
|
98 |
delete iSettingsBuffer;
|
|
99 |
iSettingsBuffer = NULL;
|
|
100 |
|
|
101 |
// Delete the Error handling utilities
|
|
102 |
delete iTextResolver;
|
|
103 |
iTextResolver = NULL;
|
|
104 |
DEBUG( - CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine );
|
|
105 |
}
|
|
106 |
|
|
107 |
// ---------------------------------------------------------------------------
|
|
108 |
// CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewL
|
|
109 |
// Symbian OS two-phased constructor
|
|
110 |
//
|
|
111 |
// @return CLocSUPLSettingsUiEngine* Reference to the Settings UI Engine
|
|
112 |
// ---------------------------------------------------------------------------
|
|
113 |
//
|
|
114 |
CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewL(
|
|
115 |
MLocSUPLSettingsUiEngObserver& aObserver )
|
|
116 |
{
|
|
117 |
DEBUG( + CLocSUPLSettingsUiEngine::NewL );
|
|
118 |
CLocSUPLSettingsUiEngine* self = CLocSUPLSettingsUiEngine::NewLC(
|
|
119 |
aObserver );
|
|
120 |
CleanupStack::Pop( self );
|
|
121 |
DEBUG( - CLocSUPLSettingsUiEngine::NewL );
|
|
122 |
return self;
|
|
123 |
}
|
|
124 |
|
|
125 |
// ---------------------------------------------------------------------------
|
|
126 |
// CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewLC
|
|
127 |
// Symbian OS two-phased constructor
|
|
128 |
//
|
|
129 |
// @return CLocSUPLSettingsUiEngine* Reference to the Settings UI Engine
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
//
|
|
132 |
CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewLC(
|
|
133 |
MLocSUPLSettingsUiEngObserver& aObserver )
|
|
134 |
{
|
|
135 |
CLocSUPLSettingsUiEngine* self =
|
|
136 |
new ( ELeave ) CLocSUPLSettingsUiEngine( aObserver );
|
|
137 |
CleanupStack::PushL( self );
|
|
138 |
self->ConstructL();
|
|
139 |
return self;
|
|
140 |
}
|
|
141 |
|
|
142 |
// ---------------------------------------------------------------------------
|
|
143 |
// void CLocSUPLSettingsUiEngine::ConstructL
|
|
144 |
// Second phase constructor.
|
|
145 |
// ---------------------------------------------------------------------------
|
|
146 |
//
|
|
147 |
void CLocSUPLSettingsUiEngine::ConstructL()
|
|
148 |
{
|
|
149 |
DEBUG( + CLocSUPLSettingsUiEngine::ConstructL );
|
|
150 |
// Allocate the conversion buffers
|
|
151 |
iConversionBuffer = HBufC16::NewL( KMaxBufferLength );
|
|
152 |
iConversionBufferPtr.Set( iConversionBuffer->Des() );
|
|
153 |
|
|
154 |
iSettingsBuffer = HBufC::NewL( KMaxBufferLength );
|
|
155 |
iSettingsBufferPtr.Set( iSettingsBuffer->Des());
|
|
156 |
|
|
157 |
iTextResolver = CTextResolver::NewL( *( CCoeEnv::Static() ) );
|
|
158 |
|
|
159 |
// Create the SUPL Settings API adapter.
|
|
160 |
iSUPLSettingsAdapter = CLocSUPLSettingsAdapter::NewL( *this );
|
|
161 |
|
|
162 |
CActiveScheduler::Add( this );
|
|
163 |
DEBUG( - CLocSUPLSettingsUiEngine::ConstructL );
|
|
164 |
|
|
165 |
}
|
|
166 |
|
|
167 |
// ---------------------------------------------------------------------------
|
|
168 |
// void CLocSUPLSettingsUiEngine::Initalize
|
|
169 |
// Initializes the Settings Engine. This is an asynchronous call the
|
|
170 |
// completion of which is communicated through the observer
|
|
171 |
// ---------------------------------------------------------------------------
|
|
172 |
//
|
|
173 |
void CLocSUPLSettingsUiEngine::Initalize()
|
|
174 |
{
|
|
175 |
DEBUG( + CLocSUPLSettingsUiEngine::Initalize );
|
|
176 |
iSUPLSettingsAdapter->Initialize();
|
|
177 |
DEBUG( - CLocSUPLSettingsUiEngine::Initalize );
|
|
178 |
}
|
|
179 |
|
|
180 |
void CLocSUPLSettingsUiEngine::SelectConnectionL()
|
|
181 |
{
|
|
182 |
DEBUG( + CLocSUPLSettingsUiEngine::SelectConnectionL );
|
|
183 |
if( iDialogActive || IsActive() || iConfirmQuery )
|
|
184 |
{
|
|
185 |
User::Leave( KErrInUse );
|
|
186 |
}
|
|
187 |
|
|
188 |
// In the case of a framework launching SUPL UI, the user is ignorant
|
|
189 |
// of the action. Hence, a confirmation dialog is popped up to intimate
|
|
190 |
// the user that he needs to configure SUPL settings.
|
|
191 |
|
|
192 |
iConfirmQuery = CAknGlobalConfirmationQuery::NewL();
|
|
193 |
|
|
194 |
CAknSDData* secondaryData = CAknSDData::NewL( KCatUidLocationSuplSettingsUi,
|
|
195 |
ECmdSuplSettingsMissing,
|
|
196 |
KNullDesC8 );
|
|
197 |
|
|
198 |
// Send the Confirmation query information to the Secondary display
|
|
199 |
// The ownership of 'secondaryData' is taken up by the Global confirmation query
|
|
200 |
iConfirmQuery->SetSecondaryDisplayData( secondaryData );
|
|
201 |
|
|
202 |
// Load the SUPL IAP confirmation query prompt text from the resource file
|
|
203 |
HBufC* promptText = StringLoader::LoadL( R_LOC_SUPL_IAP_QUERY );
|
|
204 |
|
|
205 |
// Display the Confirmation query.
|
|
206 |
iConfirmQuery->ShowConfirmationQueryL( iStatus,
|
|
207 |
*promptText,
|
|
208 |
R_AVKON_SOFTKEYS_YES_NO__YES,
|
|
209 |
R_QGN_NOTE_QUERY_ANIM );
|
|
210 |
|
|
211 |
SetActive();
|
|
212 |
delete promptText; //
|
|
213 |
promptText = NULL;
|
|
214 |
DEBUG( - CLocSUPLSettingsUiEngine::SelectConnectionL );
|
|
215 |
}
|
|
216 |
|
|
217 |
// ---------------------------------------------------------------------------
|
|
218 |
// void CLocSUPLSettingsUiEngine::LaunchApConfiguratorL
|
|
219 |
// Launches the Access Point Configurator dialog
|
|
220 |
//
|
|
221 |
// ---------------------------------------------------------------------------
|
|
222 |
//
|
|
223 |
void CLocSUPLSettingsUiEngine::LaunchApConfiguratorL( TInt64 aSlpId,
|
|
224 |
MSuplServerEditorObserver* aEditorObserver )
|
|
225 |
{
|
|
226 |
DEBUG( + CLocSUPLSettingsUiEngine::LaunchApConfiguratorL );
|
|
227 |
iCurrentSlpId = aSlpId;
|
|
228 |
iEditorObserver = aEditorObserver;
|
|
229 |
|
|
230 |
if( iDialogActive )
|
|
231 |
{
|
|
232 |
User::Leave( KErrInUse );
|
|
233 |
}
|
|
234 |
|
|
235 |
// Zeroing the Temporary buffers so that it doesn't contain any
|
|
236 |
// left over value from the previous access
|
|
237 |
iSettingsBufferPtr.Zero();
|
|
238 |
|
|
239 |
// Obtain the UID for the selected Access point so that the configurator
|
|
240 |
// can be highlighted
|
|
241 |
TUint32 highlightUid( 0 );
|
|
242 |
|
|
243 |
// if AP value is NULL, or zero, no temp AP, all previous changes have been frozen.
|
|
244 |
TInt32 tempAP = GetTempAPValue();
|
|
245 |
if ( tempAP == -1)
|
|
246 |
{
|
|
247 |
// Obtain the Server address value from the SUPL settings
|
|
248 |
// API. If the value is set then it has to be shown to the user
|
|
249 |
// as the existing value when he tries to configure the UI
|
|
250 |
TRAP_IGNORE( iSUPLSettingsAdapter->GetIapNameL( iCurrentSlpId, iSettingsBufferPtr ) );
|
|
251 |
|
|
252 |
TRAPD( error, highlightUid = ConvertIAPNameToIdL( iSettingsBufferPtr ) );
|
|
253 |
|
|
254 |
if( error == KErrNotFound )
|
|
255 |
{
|
|
256 |
highlightUid = 0;
|
|
257 |
}
|
|
258 |
}
|
|
259 |
else
|
|
260 |
{
|
|
261 |
highlightUid = tempAP;
|
|
262 |
}
|
|
263 |
|
|
264 |
CCmApplicationSettingsUi* apHandler = CCmApplicationSettingsUi::NewLC();
|
|
265 |
|
|
266 |
iDialogActive = ETrue;
|
|
267 |
TBool ret = EFalse;
|
|
268 |
TCmSettingSelection selectionUid;
|
|
269 |
selectionUid.iId = highlightUid;
|
|
270 |
selectionUid.iResult = CMManager::EConnectionMethod ;
|
|
271 |
TBearerFilterArray filter;
|
|
272 |
CleanupClosePushL( filter );
|
|
273 |
|
|
274 |
// Need access points for bearer type CSD and Packet data only
|
|
275 |
filter.AppendL( KUidCSDBearerType );
|
|
276 |
filter.AppendL( KUidPacketDataBearerType );
|
|
277 |
|
|
278 |
// Run CCmApplicationSettingsUi dialog only for Access points (Connection methods)
|
|
279 |
// selectionUid contains UID to be highlighted, on return it will contain UID of selected CM
|
|
280 |
TRAPD( error, ret =
|
|
281 |
apHandler->RunApplicationSettingsL(
|
|
282 |
selectionUid , CMManager::EShowConnectionMethods, filter
|
|
283 |
) ); // | CMManager::EShowAlwaysAsk
|
|
284 |
|
|
285 |
iDialogActive = EFalse;
|
|
286 |
if( error == CMManager::KErrConnectionNotFound )
|
|
287 |
{
|
|
288 |
// No AP defined, Show Note
|
|
289 |
ShowNoteL();
|
|
290 |
//User::Leave( error );
|
|
291 |
}
|
|
292 |
CleanupStack::PopAndDestroy( &filter );
|
|
293 |
CleanupStack::PopAndDestroy( apHandler );
|
|
294 |
|
|
295 |
if( ret )
|
|
296 |
{
|
|
297 |
SetTempAPValue(selectionUid.iId);
|
|
298 |
RCmManager cmManager;
|
|
299 |
cmManager.OpenLC();
|
|
300 |
|
|
301 |
RArray< TUint32 > cmArray;
|
|
302 |
HBufC* cmName = NULL;
|
|
303 |
RCmConnectionMethod method;
|
|
304 |
// Get all the CMs into cmArray
|
|
305 |
cmManager.ConnectionMethodL( cmArray, ETrue, EFalse );
|
|
306 |
CleanupClosePushL( cmArray );
|
|
307 |
|
|
308 |
// Get name of selected CM
|
|
309 |
TInt count = cmArray.Count();
|
|
310 |
for ( TInt i = 0; i < count; i++ )
|
|
311 |
{
|
|
312 |
if (selectionUid.iId == cmArray[i] )
|
|
313 |
{
|
|
314 |
method = cmManager.ConnectionMethodL( cmArray[i] );
|
|
315 |
CleanupClosePushL( method );
|
|
316 |
cmName = method.GetStringAttributeL( CMManager::ECmName );
|
|
317 |
CleanupStack::PushL( cmName );
|
|
318 |
iSettingsBufferPtr.Copy( cmName->Des() );
|
|
319 |
CleanupStack::PopAndDestroy( cmName );
|
|
320 |
CleanupStack::PopAndDestroy( &method );
|
|
321 |
break;
|
|
322 |
}
|
|
323 |
}
|
|
324 |
CleanupStack::PopAndDestroy( &cmArray );
|
|
325 |
CleanupStack::PopAndDestroy( &cmManager );
|
|
326 |
|
|
327 |
if( iEditorObserver )
|
|
328 |
{
|
|
329 |
iEditorObserver->UpdateIapL( iSettingsBufferPtr );
|
|
330 |
}
|
|
331 |
}
|
|
332 |
|
|
333 |
DEBUG( - CLocSUPLSettingsUiEngine::LaunchApConfiguratorL );
|
|
334 |
}
|
|
335 |
|
|
336 |
// ---------------------------------------------------------------------------
|
|
337 |
// void CLocSUPLSettingsUiEngine::LaunchSuplUsageConfiguratorL
|
|
338 |
// Launches the SUPL Usage Configurator
|
|
339 |
//
|
|
340 |
// ---------------------------------------------------------------------------
|
|
341 |
//
|
|
342 |
void CLocSUPLSettingsUiEngine::LaunchSuplUsageConfiguratorL()
|
|
343 |
{
|
|
344 |
DEBUG( + CLocSUPLSettingsUiEngine::LaunchSuplUsageConfiguratorL );
|
|
345 |
if( iDialogActive )
|
|
346 |
{
|
|
347 |
User::Leave( KErrInUse );
|
|
348 |
}
|
|
349 |
|
|
350 |
// Allocate the descriptor array for Text settings for System
|
|
351 |
// of measurement
|
|
352 |
CDesCArrayFlat* items = new( ELeave ) CDesCArrayFlat( KNoofUsageSettings );
|
|
353 |
CleanupStack::PushL( items );
|
|
354 |
|
|
355 |
// Allocate all the Settings usage string
|
|
356 |
|
|
357 |
// Append the radio-button list items
|
|
358 |
items->AppendL( iSUPLSettingsAdapter->Automatic() );
|
|
359 |
items->AppendL( iSUPLSettingsAdapter->AutomaticAtHome() );
|
|
360 |
items->AppendL( iSUPLSettingsAdapter->AlwaysAsk() );
|
|
361 |
items->AppendL( iSUPLSettingsAdapter->Disable() );
|
|
362 |
|
|
363 |
// Obtain the current value for SUPL settings usage
|
|
364 |
// This would be used for setting the default value for
|
|
365 |
// the text settings page
|
|
366 |
TInt currentSettings = iSUPLSettingsAdapter->GetSuplUsageIndex();
|
|
367 |
|
|
368 |
CAknRadioButtonSettingPage* dlg =
|
|
369 |
new ( ELeave )CAknRadioButtonSettingPage( R_LOC_SUPLUSAGE_SETTINGS,
|
|
370 |
currentSettings,
|
|
371 |
items );
|
|
372 |
// Settings Outstanding flag is marked True to enable dismissal incase
|
|
373 |
// of a Cancel event
|
|
374 |
iDialogActive = ETrue;
|
|
375 |
if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
|
|
376 |
{
|
|
377 |
CLocSUPLSettingsAdapter::TLocSuplUsage newValue =
|
|
378 |
static_cast<CLocSUPLSettingsAdapter::TLocSuplUsage>( currentSettings );
|
|
379 |
|
|
380 |
iSUPLSettingsAdapter->SetSuplUsageL( newValue );
|
|
381 |
}
|
|
382 |
|
|
383 |
iDialogActive = EFalse;
|
|
384 |
|
|
385 |
// Free the items resource
|
|
386 |
CleanupStack::PopAndDestroy( items );
|
|
387 |
DEBUG( - CLocSUPLSettingsUiEngine::LaunchSuplUsageConfiguratorL );
|
|
388 |
}
|
|
389 |
|
|
390 |
// ---------------------------------------------------------------------------
|
|
391 |
// void CLocSUPLSettingsUiEngine::Close
|
|
392 |
// Closes the running Settings UI prematurely.
|
|
393 |
// ---------------------------------------------------------------------------
|
|
394 |
//
|
|
395 |
void CLocSUPLSettingsUiEngine::Close()
|
|
396 |
{
|
|
397 |
DEBUG( + CLocSUPLSettingsUiEngine::Close );
|
|
398 |
Cancel();
|
|
399 |
|
|
400 |
// Cancel the Initalization request. This call Cancels if there is an
|
|
401 |
// outstanding request. If not, does nothing
|
|
402 |
iSUPLSettingsAdapter->CancelInitialize();
|
|
403 |
|
|
404 |
// If any of the dialogs are active then issue a cancel event on the
|
|
405 |
// dialogs
|
|
406 |
if( iDialogActive )
|
|
407 |
{
|
|
408 |
TKeyEvent keyEvent;
|
|
409 |
keyEvent.iCode = EKeyCBA2;
|
|
410 |
keyEvent.iScanCode = EStdKeyDevice1;
|
|
411 |
keyEvent.iModifiers = EAllModifiers;
|
|
412 |
keyEvent.iRepeats = 0;
|
|
413 |
CCoeEnv* cCoeEnv = CCoeEnv::Static();
|
|
414 |
|
|
415 |
// Simulate a Cancel event on the running dialogs. The Simulated event
|
|
416 |
// is for the Left Soft Key.
|
|
417 |
// Ignore the error incase of a leave
|
|
418 |
|
|
419 |
TRAP_IGNORE( cCoeEnv->SimulateKeyEventL( keyEvent, EEventKey ) );
|
|
420 |
}
|
|
421 |
DEBUG( - CLocSUPLSettingsUiEngine::Close );
|
|
422 |
}
|
|
423 |
|
|
424 |
// ---------------------------------------------------------------------------
|
|
425 |
// TPtr16 CLocSUPLSettingsAdapter::GetSuplUsage
|
|
426 |
// ---------------------------------------------------------------------------
|
|
427 |
//
|
|
428 |
TPtr16 CLocSUPLSettingsUiEngine::GetSuplUsageL()
|
|
429 |
{
|
|
430 |
DEBUG( + CLocSUPLSettingsUiEngine::GetSuplUsageL );
|
|
431 |
// Zeroing the Temporary buffers so that it doesn't contain any
|
|
432 |
// left over value from the previous access
|
|
433 |
iSettingsBufferPtr.Zero();
|
|
434 |
iConversionBufferPtr.Zero();
|
|
435 |
|
|
436 |
// Obtain the Settings values from the SUPL settings API
|
|
437 |
iSUPLSettingsAdapter->GetSuplUsageL( iSettingsBufferPtr );
|
|
438 |
iConversionBufferPtr.Copy( iSettingsBufferPtr );
|
|
439 |
DEBUG( - CLocSUPLSettingsUiEngine::GetSuplUsageL );
|
|
440 |
return iConversionBufferPtr;
|
|
441 |
}
|
|
442 |
|
|
443 |
// ---------------------------------------------------------------------------
|
|
444 |
// TInt CLocSUPLSettingsAdapter::GetSuplUsage
|
|
445 |
// ---------------------------------------------------------------------------
|
|
446 |
//
|
|
447 |
TInt CLocSUPLSettingsUiEngine::GetSuplUsage()
|
|
448 |
{
|
|
449 |
return iSUPLSettingsAdapter->GetSuplUsage();
|
|
450 |
}
|
|
451 |
|
|
452 |
// ---------------------------------------------------------------------------
|
|
453 |
// void CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL
|
|
454 |
// Inherited from MLocSUPLSettingsAdapterObserver
|
|
455 |
//
|
|
456 |
// ---------------------------------------------------------------------------
|
|
457 |
//
|
|
458 |
void CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL(
|
|
459 |
TLocSUPLSettingsEvent aEvent )
|
|
460 |
{
|
|
461 |
DEBUG( + CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL );
|
|
462 |
iObserver.HandleSettingsEventL(
|
|
463 |
static_cast< MLocSUPLSettingsUiEngObserver::TSettingsEventType >( aEvent ) );
|
|
464 |
DEBUG( - CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL );
|
|
465 |
}
|
|
466 |
|
|
467 |
// ---------------------------------------------------------------------------
|
|
468 |
// void CLocSUPLSettingsUiEngine::RunL()
|
|
469 |
//
|
|
470 |
// ---------------------------------------------------------------------------
|
|
471 |
//
|
|
472 |
void CLocSUPLSettingsUiEngine::RunL()
|
|
473 |
{
|
|
474 |
DEBUG( + CLocSUPLSettingsUiEngine::RunL );
|
|
475 |
// If the Confirmation query is present then we have to Pop up the
|
|
476 |
// IAP Selection dialog based on User Action
|
|
477 |
if( iConfirmQuery )
|
|
478 |
{
|
|
479 |
// Incase there has been a response from the User then the Key pressed
|
|
480 |
// is present in the iStatus variable
|
|
481 |
if( EAknSoftkeyYes == iStatus.Int() )
|
|
482 |
{
|
|
483 |
iObserver.HandleSettingsEventL(
|
|
484 |
MLocSUPLSettingsUiEngObserver::EIAPSelectionComplete );
|
|
485 |
}
|
|
486 |
else
|
|
487 |
{
|
|
488 |
iObserver.HandleSettingsEventL(
|
|
489 |
MLocSUPLSettingsUiEngObserver::EIAPSelectionCancelled );
|
|
490 |
}
|
|
491 |
|
|
492 |
// Destroy the IAP confirmation query handle
|
|
493 |
delete iConfirmQuery;
|
|
494 |
iConfirmQuery = NULL;
|
|
495 |
}
|
|
496 |
DEBUG( - CLocSUPLSettingsUiEngine::RunL );
|
|
497 |
}
|
|
498 |
|
|
499 |
// ---------------------------------------------------------------------------
|
|
500 |
// void CLocSUPLSettingsUiEngine::DoCancel()
|
|
501 |
//
|
|
502 |
// ---------------------------------------------------------------------------
|
|
503 |
//
|
|
504 |
void CLocSUPLSettingsUiEngine::DoCancel()
|
|
505 |
{
|
|
506 |
DEBUG( + CLocSUPLSettingsUiEngine::DoCancel );
|
|
507 |
if( iConfirmQuery )
|
|
508 |
{
|
|
509 |
// If the confirmation query is running Cancel the query
|
|
510 |
iConfirmQuery->CancelConfirmationQuery();
|
|
511 |
|
|
512 |
delete iConfirmQuery;
|
|
513 |
iConfirmQuery = NULL;
|
|
514 |
|
|
515 |
}
|
|
516 |
DEBUG( - CLocSUPLSettingsUiEngine::DoCancel );
|
|
517 |
}
|
|
518 |
|
|
519 |
// ---------------------------------------------------------------------------
|
|
520 |
// TUint CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL()
|
|
521 |
// Obtains the index UID corresponding to the Access point name
|
|
522 |
//
|
|
523 |
// @param aIAPName Access point name
|
|
524 |
// @return TUint UID corresponding to the AP Name. Zero if
|
|
525 |
// the name does not exist
|
|
526 |
// ---------------------------------------------------------------------------
|
|
527 |
//
|
|
528 |
TUint CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL( const TDesC& aIAPName )
|
|
529 |
{
|
|
530 |
DEBUG( + CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL );
|
|
531 |
TUint32 idVal = 0;
|
|
532 |
|
|
533 |
RCmManager cmManager;
|
|
534 |
|
|
535 |
cmManager.OpenLC();
|
|
536 |
|
|
537 |
RArray< TUint32 > cmArray;
|
|
538 |
HBufC* name = NULL;
|
|
539 |
RCmConnectionMethod method;
|
|
540 |
// Get all the CMs into cmArray
|
|
541 |
cmManager.ConnectionMethodL( cmArray, ETrue, EFalse );
|
|
542 |
CleanupClosePushL( cmArray );
|
|
543 |
|
|
544 |
TInt count = cmArray.Count();
|
|
545 |
if( !count )
|
|
546 |
{
|
|
547 |
// No CM found
|
|
548 |
User::Leave( KErrNotFound );
|
|
549 |
}
|
|
550 |
// Get uid for CM name
|
|
551 |
for ( TInt i = 0; i < count; i++ )
|
|
552 |
{
|
|
553 |
method = cmManager.ConnectionMethodL( cmArray[i] );
|
|
554 |
CleanupClosePushL( method );
|
|
555 |
name = method.GetStringAttributeL( CMManager::ECmName );
|
|
556 |
CleanupStack::PushL( name );
|
|
557 |
if (! aIAPName.Compare( name->Des() ))
|
|
558 |
{
|
|
559 |
idVal = cmArray[i];
|
|
560 |
CleanupStack::PopAndDestroy( name );
|
|
561 |
CleanupStack::PopAndDestroy( &method );
|
|
562 |
break;
|
|
563 |
}
|
|
564 |
CleanupStack::PopAndDestroy( name );
|
|
565 |
CleanupStack::PopAndDestroy( &method );
|
|
566 |
}
|
|
567 |
CleanupStack::PopAndDestroy( &cmArray );
|
|
568 |
CleanupStack::PopAndDestroy( &cmManager );
|
|
569 |
|
|
570 |
if( !idVal )
|
|
571 |
{
|
|
572 |
User::Leave( KErrBadName );
|
|
573 |
}
|
|
574 |
DEBUG( - CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL );
|
|
575 |
return idVal;
|
|
576 |
}
|
|
577 |
|
|
578 |
// ---------------------------------------------------------------------------
|
|
579 |
// void CLocSUPLSettingsUiEngine::DisplayErrorL()
|
|
580 |
// Displays an Error note
|
|
581 |
//
|
|
582 |
// @param aError Error ID
|
|
583 |
// ---------------------------------------------------------------------------
|
|
584 |
//
|
|
585 |
void CLocSUPLSettingsUiEngine::DisplayErrorL( TInt aError )
|
|
586 |
{
|
|
587 |
DEBUG( + CLocSUPLSettingsUiEngine::DisplayErrorL );
|
|
588 |
// Show Error Note
|
|
589 |
TPtrC buffer = iTextResolver->ResolveErrorString( aError );
|
|
590 |
CAknErrorNote* errorNote = new ( ELeave ) CAknErrorNote;
|
|
591 |
TRAP_IGNORE( errorNote->ExecuteLD( buffer ) );
|
|
592 |
DEBUG( - CLocSUPLSettingsUiEngine::DisplayErrorL );
|
|
593 |
}
|
|
594 |
|
|
595 |
// ---------------------------------------------------------------------------
|
|
596 |
// void CLocSUPLSettingsUiEngine::ShowNoteL()
|
|
597 |
// Displays No access point defined note
|
|
598 |
//
|
|
599 |
// @param None
|
|
600 |
// ---------------------------------------------------------------------------
|
|
601 |
//
|
|
602 |
TInt CLocSUPLSettingsUiEngine::ShowNoteL()
|
|
603 |
{
|
|
604 |
DEBUG( + CLocSUPLSettingsUiEngine::ShowNoteL );
|
|
605 |
// Show Info Note "No Access Points Defined"
|
|
606 |
HBufC* tmp = StringLoader::LoadL( R_LOC_NO_AP_DEFINED );
|
|
607 |
CleanupStack::PushL( tmp );
|
|
608 |
CAknNoteDialog* dlg =
|
|
609 |
new ( ELeave ) CAknNoteDialog
|
|
610 |
(
|
|
611 |
REINTERPRET_CAST( CEikDialog**, &dlg ),
|
|
612 |
CAknNoteDialog::ENoTone,
|
|
613 |
CAknNoteDialog::EShortTimeout
|
|
614 |
);
|
|
615 |
dlg->PrepareLC( R_GENERAL_NOTE );
|
|
616 |
dlg->SetTextL( *tmp );
|
|
617 |
TInt retval = dlg->RunLD();
|
|
618 |
CleanupStack::PopAndDestroy( tmp ); // temp
|
|
619 |
DEBUG( - CLocSUPLSettingsUiEngine::ShowNoteL );
|
|
620 |
return retval;
|
|
621 |
}
|
|
622 |
|
|
623 |
// ---------------------------------------------------------------------------
|
|
624 |
// void CLocSUPLSettingsUiEngine::EditServerL()
|
|
625 |
// Displays No access point defined note
|
|
626 |
//
|
|
627 |
// @param iIsEditable
|
|
628 |
// @param aSlpId
|
|
629 |
// ---------------------------------------------------------------------------
|
|
630 |
//
|
|
631 |
void CLocSUPLSettingsUiEngine::EditServerL( TBool iIsEditable, TInt64 aSlpId )
|
|
632 |
{
|
|
633 |
DEBUG( + CLocSUPLSettingsUiEngine::EditServerL );
|
|
634 |
if( iEditorDlg )
|
|
635 |
{
|
|
636 |
delete iEditorDlg;
|
|
637 |
iEditorDlg = NULL;
|
|
638 |
}
|
|
639 |
iEditorDlg = CLocSUPLServerEditor::NewL( iIsEditable, *this, aSlpId );
|
|
640 |
TInt error = iEditorDlg->ExecuteLD();
|
|
641 |
if ( EEikCmdExit == error )
|
|
642 |
{
|
|
643 |
( ( CAknViewAppUi* ) CEikonEnv::Static()->EikAppUi())->HandleCommandL( EEikCmdExit );
|
|
644 |
}
|
|
645 |
iEditorDlg = NULL;
|
|
646 |
|
|
647 |
DEBUG( - CLocSUPLSettingsUiEngine::EditServerL );
|
|
648 |
}
|
|
649 |
|
|
650 |
// ---------------------------------------------------------------------------
|
|
651 |
// void CLocSUPLSettingsUiEngine::SlpCount()
|
|
652 |
// returns total no of slp entries
|
|
653 |
//
|
|
654 |
// ---------------------------------------------------------------------------
|
|
655 |
//
|
|
656 |
TInt CLocSUPLSettingsUiEngine::SlpCount()
|
|
657 |
{
|
|
658 |
TInt slpCount = 0;
|
|
659 |
TRAP_IGNORE( iSUPLSettingsAdapter->SlpCountL( slpCount ) );
|
|
660 |
return slpCount;
|
|
661 |
}
|
|
662 |
|
|
663 |
// ---------------------------------------------------------------------------
|
|
664 |
// void CLocSUPLSettingsUiEngine::AddNewServerL()
|
|
665 |
// Method to add new server entry to SUPL settings with server attributes
|
|
666 |
//
|
|
667 |
// ---------------------------------------------------------------------------
|
|
668 |
//
|
|
669 |
void CLocSUPLSettingsUiEngine::AddNewServerL(
|
|
670 |
const TDesC& aServerAddress,
|
|
671 |
const TDesC& aIapName,
|
|
672 |
const TBool aUsageInHomeNw
|
|
673 |
)
|
|
674 |
{
|
|
675 |
DEBUG( + CLocSUPLSettingsUiEngine::AddNewServerL );
|
|
676 |
iSUPLSettingsAdapter->AddNewServerL(
|
|
677 |
aServerAddress,
|
|
678 |
aIapName,
|
|
679 |
aUsageInHomeNw );
|
|
680 |
DEBUG( - CLocSUPLSettingsUiEngine::AddNewServerL );
|
|
681 |
}
|
|
682 |
|
|
683 |
// ---------------------------------------------------------------------------
|
|
684 |
// void CLocSUPLSettingsUiEngine::RemoveServerL
|
|
685 |
// ---------------------------------------------------------------------------
|
|
686 |
//
|
|
687 |
void CLocSUPLSettingsUiEngine::RemoveServerL(
|
|
688 |
const TInt64 aSlpId
|
|
689 |
)
|
|
690 |
{
|
|
691 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveServerL );
|
|
692 |
iSUPLSettingsAdapter->RemoveServerL( aSlpId );
|
|
693 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveServerL );
|
|
694 |
}
|
|
695 |
|
|
696 |
// ---------------------------------------------------------------------------
|
|
697 |
// void CLocSUPLSettingsUiEngine::ChangePriorityL
|
|
698 |
// ---------------------------------------------------------------------------
|
|
699 |
//
|
|
700 |
void CLocSUPLSettingsUiEngine::ChangePriorityL(
|
|
701 |
TInt64 aSlpId,
|
|
702 |
TInt aPriority,
|
|
703 |
TBool aDirection
|
|
704 |
)
|
|
705 |
{
|
|
706 |
DEBUG( + CLocSUPLSettingsUiEngine::ChangePriorityL );
|
|
707 |
iSUPLSettingsAdapter->ChangePriorityL( aSlpId, aPriority, aDirection );
|
|
708 |
DEBUG( - CLocSUPLSettingsUiEngine::ChangePriorityL );
|
|
709 |
}
|
|
710 |
|
|
711 |
// ---------------------------------------------------------------------------
|
|
712 |
// void CLocSUPLSettingsUiEngine::GetAllSlpL
|
|
713 |
// ---------------------------------------------------------------------------
|
|
714 |
//
|
|
715 |
void CLocSUPLSettingsUiEngine::GetAllSlpL(
|
|
716 |
RPointerArray<CServerParams>& aParamValues
|
|
717 |
) const
|
|
718 |
{
|
|
719 |
DEBUG( + CLocSUPLSettingsUiEngine::GetAllSlpL );
|
|
720 |
iSUPLSettingsAdapter->GetAllSlpL( aParamValues ) ;
|
|
721 |
DEBUG( - CLocSUPLSettingsUiEngine::GetAllSlpL );
|
|
722 |
}
|
|
723 |
|
|
724 |
// ---------------------------------------------------------------------------
|
|
725 |
// void CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL
|
|
726 |
// ---------------------------------------------------------------------------
|
|
727 |
//
|
|
728 |
void CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL(
|
|
729 |
const TInt64 aSlpId,
|
|
730 |
CServerParams *aParamValues
|
|
731 |
) const
|
|
732 |
{
|
|
733 |
DEBUG( + CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL );
|
|
734 |
iSUPLSettingsAdapter->GetSlpInfoFromIdL( aSlpId, aParamValues ) ;
|
|
735 |
DEBUG( - CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL );
|
|
736 |
}
|
|
737 |
|
|
738 |
// ---------------------------------------------------------------------------
|
|
739 |
// void CLocSUPLSettingsUiEngine::SetServerAddressL
|
|
740 |
// ---------------------------------------------------------------------------
|
|
741 |
//
|
|
742 |
void CLocSUPLSettingsUiEngine::SetServerAddressL(
|
|
743 |
const TInt64 aSlpId,
|
|
744 |
const TDesC& aServerAddress
|
|
745 |
)
|
|
746 |
{
|
|
747 |
DEBUG( + CLocSUPLSettingsUiEngine::SetServerAddressL );
|
|
748 |
iSUPLSettingsAdapter->SetServerAddressL( aSlpId, aServerAddress ) ;
|
|
749 |
DEBUG( - CLocSUPLSettingsUiEngine::SetServerAddressL );
|
|
750 |
}
|
|
751 |
|
|
752 |
// ---------------------------------------------------------------------------
|
|
753 |
// void CLocSUPLSettingsUiEngine::GetServerAddressL
|
|
754 |
// ---------------------------------------------------------------------------
|
|
755 |
//
|
|
756 |
void CLocSUPLSettingsUiEngine::GetServerAddressL(
|
|
757 |
TInt64 aSlpId,
|
|
758 |
TDes& aServerAddress
|
|
759 |
) const
|
|
760 |
{
|
|
761 |
DEBUG( + CLocSUPLSettingsUiEngine::GetServerAddressL );
|
|
762 |
iSUPLSettingsAdapter->GetServerAddressL( aSlpId, aServerAddress );
|
|
763 |
DEBUG( - CLocSUPLSettingsUiEngine::GetServerAddressL );
|
|
764 |
}
|
|
765 |
|
|
766 |
// ---------------------------------------------------------------------------
|
|
767 |
// void CLocSUPLSettingsUiEngine::SetIapNameL
|
|
768 |
// ---------------------------------------------------------------------------
|
|
769 |
//
|
|
770 |
void CLocSUPLSettingsUiEngine::SetIapNameL(
|
|
771 |
const TInt64 aSlpId,
|
|
772 |
const TDesC& aIapName
|
|
773 |
)
|
|
774 |
{
|
|
775 |
DEBUG( + CLocSUPLSettingsUiEngine::SetIapNameL );
|
|
776 |
iSUPLSettingsAdapter->SetIapNameL( aSlpId, aIapName ) ;
|
|
777 |
DEBUG( - CLocSUPLSettingsUiEngine::SetIapNameL );
|
|
778 |
}
|
|
779 |
|
|
780 |
// ---------------------------------------------------------------------------
|
|
781 |
// void CLocSUPLSettingsUiEngine::SetServerEnabledFlagL
|
|
782 |
// ---------------------------------------------------------------------------
|
|
783 |
//
|
|
784 |
void CLocSUPLSettingsUiEngine::SetServerEnabledFlagL(
|
|
785 |
const TInt64 aSlpId,
|
|
786 |
const TBool aEnable
|
|
787 |
) const
|
|
788 |
{
|
|
789 |
DEBUG( + CLocSUPLSettingsUiEngine::SetServerEnabledFlagL );
|
|
790 |
iSUPLSettingsAdapter->SetServerEnabledFlagL( aSlpId, aEnable ) ;
|
|
791 |
DEBUG( - CLocSUPLSettingsUiEngine::SetServerEnabledFlagL );
|
|
792 |
}
|
|
793 |
|
|
794 |
// ---------------------------------------------------------------------------
|
|
795 |
// void CLocSUPLSettingsUiEngine::GetServerEnabledFlagL
|
|
796 |
// ---------------------------------------------------------------------------
|
|
797 |
//
|
|
798 |
void CLocSUPLSettingsUiEngine::GetServerEnabledFlagL(
|
|
799 |
const TInt64 aSlpId,
|
|
800 |
TBool& aEnable
|
|
801 |
) const
|
|
802 |
{
|
|
803 |
DEBUG( + CLocSUPLSettingsUiEngine::GetServerEnabledFlagL );
|
|
804 |
iSUPLSettingsAdapter->GetServerEnabledFlagL( aSlpId, aEnable );
|
|
805 |
DEBUG( - CLocSUPLSettingsUiEngine::GetServerEnabledFlagL );
|
|
806 |
}
|
|
807 |
|
|
808 |
// ---------------------------------------------------------------------------
|
|
809 |
// void CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL
|
|
810 |
// ---------------------------------------------------------------------------
|
|
811 |
//
|
|
812 |
void CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL(
|
|
813 |
const TInt64 aSlpId,
|
|
814 |
const TBool aHomeNwFlag
|
|
815 |
)
|
|
816 |
{
|
|
817 |
DEBUG( + CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL );
|
|
818 |
iSUPLSettingsAdapter->SetUsageInHomwNwFlagL( aSlpId, aHomeNwFlag ) ;
|
|
819 |
DEBUG( - CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL );
|
|
820 |
}
|
|
821 |
|
|
822 |
// ---------------------------------------------------------------------------
|
|
823 |
// void CLocSUPLSettingsUiEngine::SetEditableFlagL
|
|
824 |
// ---------------------------------------------------------------------------
|
|
825 |
//
|
|
826 |
void CLocSUPLSettingsUiEngine::SetEditableFlagL(
|
|
827 |
const TInt64 aSlpId,
|
|
828 |
const TBool aEditFlag
|
|
829 |
) const
|
|
830 |
{
|
|
831 |
DEBUG( + CLocSUPLSettingsUiEngine::SetEditableFlagL );
|
|
832 |
iSUPLSettingsAdapter->SetEditableFlagL( aSlpId, aEditFlag );
|
|
833 |
DEBUG( - CLocSUPLSettingsUiEngine::SetEditableFlagL );
|
|
834 |
}
|
|
835 |
|
|
836 |
// ---------------------------------------------------------------------------
|
|
837 |
// void CLocSUPLSettingsUiEngine::GetEditableFlagL
|
|
838 |
// ---------------------------------------------------------------------------
|
|
839 |
//
|
|
840 |
void CLocSUPLSettingsUiEngine::GetEditableFlagL(
|
|
841 |
const TInt64 aSlpId,
|
|
842 |
TBool& aEditFlag
|
|
843 |
) const
|
|
844 |
{
|
|
845 |
DEBUG( + CLocSUPLSettingsUiEngine::GetEditableFlagL );
|
|
846 |
iSUPLSettingsAdapter->GetEditableFlagL( aSlpId, aEditFlag ) ;
|
|
847 |
DEBUG( - CLocSUPLSettingsUiEngine::GetEditableFlagL );
|
|
848 |
}
|
|
849 |
|
|
850 |
// ---------------------------------------------------------------------------
|
|
851 |
// void CLocSUPLSettingsUiEngine::GetActiveSessionsCountL
|
|
852 |
// ---------------------------------------------------------------------------
|
|
853 |
//
|
|
854 |
void CLocSUPLSettingsUiEngine::GetActiveSessionsCountL( TInt& aAccessPointCount )
|
|
855 |
{
|
|
856 |
DEBUG( + CLocSUPLSettingsUiEngine::GetActiveSessionsCountL );
|
|
857 |
iSUPLSettingsAdapter->GetActiveSessionsCountL( aAccessPointCount );
|
|
858 |
DEBUG( - CLocSUPLSettingsUiEngine::GetActiveSessionsCountL );
|
|
859 |
}
|
|
860 |
|
|
861 |
// ---------------------------------------------------------------------------
|
|
862 |
// void CLocSUPLSettingsUiEngine::GetTriggerParamsL
|
|
863 |
// ---------------------------------------------------------------------------
|
|
864 |
//
|
|
865 |
void CLocSUPLSettingsUiEngine::GetTriggerParamsL(
|
|
866 |
RPointerArray<CTriggerParams>& aParamValues
|
|
867 |
) const
|
|
868 |
{
|
|
869 |
DEBUG( + CLocSUPLSettingsUiEngine::GetTriggerParamsL );
|
|
870 |
iSUPLSettingsAdapter->GetTriggerParamsL( aParamValues ) ;
|
|
871 |
DEBUG( - CLocSUPLSettingsUiEngine::GetTriggerParamsL );
|
|
872 |
}
|
|
873 |
|
|
874 |
// ---------------------------------------------------------------------------
|
|
875 |
// void CLocSUPLSettingsUiEngine::GetTriggerParamsL
|
|
876 |
// ---------------------------------------------------------------------------
|
|
877 |
//
|
|
878 |
void CLocSUPLSettingsUiEngine::GetTriggerParamsL( TInt64 aSessionId,
|
|
879 |
CTriggerParams*& aTrigger
|
|
880 |
) const
|
|
881 |
{
|
|
882 |
DEBUG( + CLocSUPLSettingsUiEngine::GetTriggerParamsL );
|
|
883 |
iSUPLSettingsAdapter->GetTriggerParamsL( aSessionId, aTrigger ) ;
|
|
884 |
DEBUG( - CLocSUPLSettingsUiEngine::GetTriggerParamsL );
|
|
885 |
}
|
|
886 |
|
|
887 |
// ---------------------------------------------------------------------------
|
|
888 |
// void CLocSUPLSettingsUiEngine::OpenSessionL
|
|
889 |
// ---------------------------------------------------------------------------
|
|
890 |
//
|
|
891 |
void CLocSUPLSettingsUiEngine::OpenSessionL( TInt64 aSessionId )
|
|
892 |
{
|
|
893 |
DEBUG( + CLocSUPLSettingsUiEngine::OpenSessionL );
|
|
894 |
|
|
895 |
CLocSUPLSessionEditor* form = CLocSUPLSessionEditor::NewL( *this, aSessionId );
|
|
896 |
TInt error = form->ExecuteLD( );
|
|
897 |
if ( EEikCmdExit == error )
|
|
898 |
{
|
|
899 |
( ( CAknViewAppUi* ) CEikonEnv::Static()->EikAppUi())->HandleCommandL( EEikCmdExit );
|
|
900 |
}
|
|
901 |
|
|
902 |
DEBUG( - CLocSUPLSettingsUiEngine::OpenSessionL );
|
|
903 |
}
|
|
904 |
|
|
905 |
// ---------------------------------------------------------------------------
|
|
906 |
// void CLocSUPLSettingsUiEngine::ChangeNotificationStatusL
|
|
907 |
// ---------------------------------------------------------------------------
|
|
908 |
//
|
|
909 |
void CLocSUPLSettingsUiEngine::ChangeNotificationStatusL( TInt64 aSessionId, TBool aTriggerNotificationStatus ) const
|
|
910 |
{
|
|
911 |
DEBUG( + CLocSUPLSettingsUiEngine::ChangeNotificationStatusL );
|
|
912 |
iSUPLSettingsAdapter->ChangeNotificationStatusL( aSessionId, aTriggerNotificationStatus ) ;
|
|
913 |
DEBUG( - CLocSUPLSettingsUiEngine::ChangeNotificationStatusL );
|
|
914 |
}
|
|
915 |
|
|
916 |
// ---------------------------------------------------------------------------
|
|
917 |
// void CLocSUPLSettingsUiEngine::RemoveTriggerSessionL
|
|
918 |
// ---------------------------------------------------------------------------
|
|
919 |
//
|
|
920 |
void CLocSUPLSettingsUiEngine::RemoveTriggerSessionL( TInt64 aSessionId ) const
|
|
921 |
{
|
|
922 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveTriggerSessionL );
|
|
923 |
iSUPLSettingsAdapter->RemoveTriggerSessionL( aSessionId ) ;
|
|
924 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveTriggerSessionL );
|
|
925 |
}
|
|
926 |
|
|
927 |
// ---------------------------------------------------------------------------
|
|
928 |
// void CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL
|
|
929 |
// ---------------------------------------------------------------------------
|
|
930 |
//
|
|
931 |
void CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL( RArray< TInt64 >& aSessionIdList ) const
|
|
932 |
{
|
|
933 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL );
|
|
934 |
for( TInt i=0; i<aSessionIdList.Count(); i++ )
|
|
935 |
{
|
|
936 |
iSUPLSettingsAdapter->RemoveTriggerSessionL( aSessionIdList[i] ) ;
|
|
937 |
}
|
|
938 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL );
|
|
939 |
}
|
|
940 |
|
|
941 |
// ---------------------------------------------------------------------------
|
|
942 |
// void CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL
|
|
943 |
// ---------------------------------------------------------------------------
|
|
944 |
//
|
|
945 |
void CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL( ) const
|
|
946 |
{
|
|
947 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL );
|
|
948 |
RPointerArray<CTriggerParams> paramValues;
|
|
949 |
CleanupClosePushL( paramValues );
|
|
950 |
|
|
951 |
iSUPLSettingsAdapter->GetTriggerParamsL( paramValues ) ;
|
|
952 |
|
|
953 |
for( TInt i=0; i<paramValues.Count(); i++ )
|
|
954 |
{
|
|
955 |
TInt64 sessionId;
|
|
956 |
TUint64 outstandingTrigger;
|
|
957 |
TUint64 interval;
|
|
958 |
TBool notificationPresent;
|
|
959 |
TBool triggerNotificationStatus;
|
|
960 |
CTriggerParams::TTriggerType triggerType;
|
|
961 |
CTriggerParams::TRequestType requestType;
|
|
962 |
HBufC* sessionName = HBufC::NewLC( KMaxTriggerSessionNameLen );
|
|
963 |
|
|
964 |
TInt errParams = paramValues[i]->Get(
|
|
965 |
sessionId,
|
|
966 |
sessionName->Des(),
|
|
967 |
notificationPresent,
|
|
968 |
triggerNotificationStatus,
|
|
969 |
triggerType,
|
|
970 |
requestType,
|
|
971 |
outstandingTrigger,
|
|
972 |
interval);
|
|
973 |
iSUPLSettingsAdapter->RemoveTriggerSessionL( sessionId ) ;
|
|
974 |
|
|
975 |
CleanupStack::PopAndDestroy( sessionName );
|
|
976 |
}
|
|
977 |
|
|
978 |
paramValues.ResetAndDestroy();
|
|
979 |
CleanupStack::PopAndDestroy( ¶mValues ); // paramValues
|
|
980 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL );
|
|
981 |
}
|
|
982 |
|
|
983 |
// ---------------------------------------------------------------------------
|
|
984 |
// void CLocSUPLSettingsUiEngine::SetSessionObserver
|
|
985 |
// ---------------------------------------------------------------------------
|
|
986 |
//
|
|
987 |
void CLocSUPLSettingsUiEngine::SetSessionObserver( MLocSUPLSettingsSessionObserver* aObserver ) const
|
|
988 |
{
|
|
989 |
iSUPLSettingsAdapter->SetSessionObserver( aObserver );
|
|
990 |
}
|
|
991 |
|
|
992 |
// ---------------------------------------------------------------------------
|
|
993 |
// void CLocSUPLSettingsUiEngine::RemoveSessionObserver
|
|
994 |
// ---------------------------------------------------------------------------
|
|
995 |
//
|
|
996 |
void CLocSUPLSettingsUiEngine::RemoveSessionObserver( ) const
|
|
997 |
{
|
|
998 |
iSUPLSettingsAdapter->RemoveSessionObserver( );
|
|
999 |
}
|
|
1000 |
|
|
1001 |
// ---------------------------------------------------------------------------
|
|
1002 |
// void CLocSUPLSettingsUiEngine::GetTempAPValue
|
|
1003 |
// ---------------------------------------------------------------------------
|
|
1004 |
//
|
|
1005 |
TUint32 CLocSUPLSettingsUiEngine::GetTempAPValue()
|
|
1006 |
{
|
|
1007 |
return iTempAP;
|
|
1008 |
}
|
|
1009 |
|
|
1010 |
// ---------------------------------------------------------------------------
|
|
1011 |
// void CLocSUPLSettingsUiEngine::SetTempAPValue
|
|
1012 |
// ---------------------------------------------------------------------------
|
|
1013 |
//
|
|
1014 |
void CLocSUPLSettingsUiEngine::SetTempAPValue( TUint32 aAccessPoint)
|
|
1015 |
{
|
|
1016 |
iTempAP = aAccessPoint;
|
|
1017 |
}
|
|
1018 |
|
|
1019 |
// End of File
|