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: 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 ) |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
66 |
: iObserver( aObserver ), |
45 | 67 |
iConversionBufferPtr( NULL, 0 ), |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
68 |
iEditorDlg(NULL), |
45 | 69 |
iTempAP(-1) |
70 |
{ |
|
71 |
// No implementation |
|
72 |
} |
|
73 |
||
74 |
// --------------------------------------------------------------------------- |
|
75 |
// CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine |
|
76 |
// Destructor. |
|
77 |
// --------------------------------------------------------------------------- |
|
78 |
// |
|
79 |
CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine() |
|
80 |
{ |
|
81 |
DEBUG( + CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine ); |
|
82 |
||
83 |
||
84 |
delete iSUPLSettingsAdapter; |
|
85 |
iSUPLSettingsAdapter = NULL; |
|
86 |
||
87 |
// Delete the Conversion buffers |
|
88 |
delete iConversionBuffer; |
|
89 |
iConversionBuffer = NULL; |
|
90 |
||
91 |
||
92 |
// Delete the Error handling utilities |
|
93 |
delete iTextResolver; |
|
94 |
iTextResolver = NULL; |
|
95 |
DEBUG( - CLocSUPLSettingsUiEngine::~CLocSUPLSettingsUiEngine ); |
|
96 |
} |
|
97 |
||
98 |
// --------------------------------------------------------------------------- |
|
99 |
// CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewL |
|
100 |
// Symbian OS two-phased constructor |
|
101 |
// |
|
102 |
// @return CLocSUPLSettingsUiEngine* Reference to the Settings UI Engine |
|
103 |
// --------------------------------------------------------------------------- |
|
104 |
// |
|
105 |
CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewL( |
|
106 |
MLocSUPLSettingsUiEngObserver& aObserver ) |
|
107 |
{ |
|
108 |
DEBUG( + CLocSUPLSettingsUiEngine::NewL ); |
|
109 |
CLocSUPLSettingsUiEngine* self = CLocSUPLSettingsUiEngine::NewLC( |
|
110 |
aObserver ); |
|
111 |
CleanupStack::Pop( self ); |
|
112 |
DEBUG( - CLocSUPLSettingsUiEngine::NewL ); |
|
113 |
return self; |
|
114 |
} |
|
115 |
||
116 |
// --------------------------------------------------------------------------- |
|
117 |
// CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewLC |
|
118 |
// Symbian OS two-phased constructor |
|
119 |
// |
|
120 |
// @return CLocSUPLSettingsUiEngine* Reference to the Settings UI Engine |
|
121 |
// --------------------------------------------------------------------------- |
|
122 |
// |
|
123 |
CLocSUPLSettingsUiEngine* CLocSUPLSettingsUiEngine::NewLC( |
|
124 |
MLocSUPLSettingsUiEngObserver& aObserver ) |
|
125 |
{ |
|
126 |
CLocSUPLSettingsUiEngine* self = |
|
127 |
new ( ELeave ) CLocSUPLSettingsUiEngine( aObserver ); |
|
128 |
CleanupStack::PushL( self ); |
|
129 |
self->ConstructL(); |
|
130 |
return self; |
|
131 |
} |
|
132 |
||
133 |
// --------------------------------------------------------------------------- |
|
134 |
// void CLocSUPLSettingsUiEngine::ConstructL |
|
135 |
// Second phase constructor. |
|
136 |
// --------------------------------------------------------------------------- |
|
137 |
// |
|
138 |
void CLocSUPLSettingsUiEngine::ConstructL() |
|
139 |
{ |
|
140 |
DEBUG( + CLocSUPLSettingsUiEngine::ConstructL ); |
|
141 |
// Allocate the conversion buffers |
|
142 |
iConversionBuffer = HBufC16::NewL( KMaxBufferLength ); |
|
143 |
iConversionBufferPtr.Set( iConversionBuffer->Des() ); |
|
144 |
||
145 |
||
146 |
iTextResolver = CTextResolver::NewL( *( CCoeEnv::Static() ) ); |
|
147 |
||
148 |
// Create the SUPL Settings API adapter. |
|
149 |
iSUPLSettingsAdapter = CLocSUPLSettingsAdapter::NewL( *this ); |
|
150 |
||
151 |
DEBUG( - CLocSUPLSettingsUiEngine::ConstructL ); |
|
152 |
||
153 |
} |
|
154 |
||
155 |
// --------------------------------------------------------------------------- |
|
156 |
// void CLocSUPLSettingsUiEngine::Initalize |
|
157 |
// Initializes the Settings Engine. This is an asynchronous call the |
|
158 |
// completion of which is communicated through the observer |
|
159 |
// --------------------------------------------------------------------------- |
|
160 |
// |
|
161 |
void CLocSUPLSettingsUiEngine::Initalize() |
|
162 |
{ |
|
163 |
DEBUG( + CLocSUPLSettingsUiEngine::Initalize ); |
|
164 |
iSUPLSettingsAdapter->Initialize(); |
|
165 |
DEBUG( - CLocSUPLSettingsUiEngine::Initalize ); |
|
166 |
} |
|
167 |
||
168 |
||
169 |
||
170 |
||
171 |
// --------------------------------------------------------------------------- |
|
172 |
// void CLocSUPLSettingsUiEngine::Close |
|
173 |
// Closes the running Settings UI prematurely. |
|
174 |
// --------------------------------------------------------------------------- |
|
175 |
// |
|
176 |
void CLocSUPLSettingsUiEngine::Close() |
|
177 |
{ |
|
178 |
DEBUG( + CLocSUPLSettingsUiEngine::Close ); |
|
179 |
||
180 |
// Cancel the Initalization request. This call Cancels if there is an |
|
181 |
// outstanding request. If not, does nothing |
|
182 |
iSUPLSettingsAdapter->CancelInitialize(); |
|
183 |
||
184 |
DEBUG( - CLocSUPLSettingsUiEngine::Close ); |
|
185 |
} |
|
186 |
||
187 |
||
188 |
// --------------------------------------------------------------------------- |
|
189 |
// void CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL |
|
190 |
// Inherited from MLocSUPLSettingsAdapterObserver |
|
191 |
// |
|
192 |
// --------------------------------------------------------------------------- |
|
193 |
// |
|
194 |
void CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL( |
|
195 |
TLocSUPLSettingsEvent aEvent ) |
|
196 |
{ |
|
197 |
DEBUG( + CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL ); |
|
198 |
iObserver.HandleSettingsEventL( |
|
199 |
static_cast< MLocSUPLSettingsUiEngObserver::TSettingsEventType >( aEvent ) ); |
|
200 |
DEBUG( - CLocSUPLSettingsUiEngine::HandleSuplSettingsChangeL ); |
|
201 |
} |
|
202 |
||
203 |
// --------------------------------------------------------------------------- |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
204 |
// void CLocSUPLSettingsUiEngine::GenerateHslpAddressFromImsi() |
45 | 205 |
// |
206 |
// --------------------------------------------------------------------------- |
|
207 |
// |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
208 |
void CLocSUPLSettingsUiEngine::GenerateHslpAddressFromImsi(TDes& aIMSIAddress) |
45 | 209 |
{ |
210 |
DEBUG( + CLocSUPLSettingsUiEngine::DoCancel ); |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
211 |
iSUPLSettingsAdapter->GenerateHslpAddressFromImsi(aIMSIAddress); |
45 | 212 |
DEBUG( - CLocSUPLSettingsUiEngine::DoCancel ); |
213 |
} |
|
214 |
||
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
215 |
|
45 | 216 |
// --------------------------------------------------------------------------- |
217 |
// TUint CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL() |
|
218 |
// Obtains the index UID corresponding to the Access point name |
|
219 |
// |
|
220 |
// @param aIAPName Access point name |
|
221 |
// @return TUint UID corresponding to the AP Name. Zero if |
|
222 |
// the name does not exist |
|
223 |
// --------------------------------------------------------------------------- |
|
224 |
// |
|
225 |
TUint CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL( const TDesC& aIAPName ) |
|
226 |
{ |
|
227 |
DEBUG( + CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL ); |
|
228 |
TUint32 idVal = 0; |
|
229 |
||
230 |
RCmManager cmManager; |
|
231 |
||
232 |
cmManager.OpenLC(); |
|
233 |
||
234 |
RArray< TUint32 > cmArray; |
|
235 |
HBufC* name = NULL; |
|
236 |
RCmConnectionMethod method; |
|
237 |
// Get all the CMs into cmArray |
|
238 |
cmManager.ConnectionMethodL( cmArray, ETrue, EFalse ); |
|
239 |
CleanupClosePushL( cmArray ); |
|
240 |
||
241 |
TInt count = cmArray.Count(); |
|
242 |
if( !count ) |
|
243 |
{ |
|
244 |
// No CM found |
|
245 |
User::Leave( KErrNotFound ); |
|
246 |
} |
|
247 |
// Get uid for CM name |
|
248 |
for ( TInt i = 0; i < count; i++ ) |
|
249 |
{ |
|
250 |
method = cmManager.ConnectionMethodL( cmArray[i] ); |
|
251 |
CleanupClosePushL( method ); |
|
252 |
name = method.GetStringAttributeL( CMManager::ECmName ); |
|
253 |
CleanupStack::PushL( name ); |
|
254 |
if (! aIAPName.Compare( name->Des() )) |
|
255 |
{ |
|
256 |
idVal = cmArray[i]; |
|
257 |
CleanupStack::PopAndDestroy( name ); |
|
258 |
CleanupStack::PopAndDestroy( &method ); |
|
259 |
break; |
|
260 |
} |
|
261 |
CleanupStack::PopAndDestroy( name ); |
|
262 |
CleanupStack::PopAndDestroy( &method ); |
|
263 |
} |
|
264 |
CleanupStack::PopAndDestroy( &cmArray ); |
|
265 |
CleanupStack::PopAndDestroy( &cmManager ); |
|
266 |
||
267 |
if( !idVal ) |
|
268 |
{ |
|
269 |
User::Leave( KErrBadName ); |
|
270 |
} |
|
271 |
DEBUG( - CLocSUPLSettingsUiEngine::ConvertIAPNameToIdL ); |
|
272 |
return idVal; |
|
273 |
} |
|
274 |
||
275 |
// --------------------------------------------------------------------------- |
|
276 |
// void CLocSUPLSettingsUiEngine::DisplayErrorL() |
|
277 |
// Displays an Error note |
|
278 |
// |
|
279 |
// @param aError Error ID |
|
280 |
// --------------------------------------------------------------------------- |
|
281 |
// |
|
282 |
void CLocSUPLSettingsUiEngine::DisplayErrorL( TInt aError ) |
|
283 |
{ |
|
284 |
DEBUG( + CLocSUPLSettingsUiEngine::DisplayErrorL ); |
|
285 |
// Show Error Note |
|
286 |
TPtrC buffer = iTextResolver->ResolveErrorString( aError ); |
|
287 |
CAknErrorNote* errorNote = new ( ELeave ) CAknErrorNote; |
|
288 |
TRAP_IGNORE( errorNote->ExecuteLD( buffer ) ); |
|
289 |
DEBUG( - CLocSUPLSettingsUiEngine::DisplayErrorL ); |
|
290 |
} |
|
291 |
||
292 |
||
293 |
// --------------------------------------------------------------------------- |
|
294 |
// void CLocSUPLSettingsUiEngine::EditServerL() |
|
295 |
// Displays No access point defined note |
|
296 |
// |
|
297 |
// @param iIsEditable |
|
298 |
// @param aSlpId |
|
299 |
// --------------------------------------------------------------------------- |
|
300 |
// |
|
301 |
void CLocSUPLSettingsUiEngine::EditServerL( TBool iIsEditable, TInt64 aSlpId ) |
|
302 |
{ |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
303 |
DEBUG( + CLocSUPLSettingsUiEngine::EditServerL ); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
304 |
if (iEditorDlg) |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
305 |
{ |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
306 |
delete iEditorDlg; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
307 |
iEditorDlg = NULL; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
308 |
} |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
309 |
iEditorDlg = CLocSUPLServerEditor::NewL(iIsEditable, *this, aSlpId); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
310 |
if (aSlpId > 0) |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
311 |
{ |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
312 |
CServerParams *params = CServerParams::NewL(); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
313 |
CleanupStack::PushL(params); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
314 |
GetSlpInfoFromIdL(aSlpId, params); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
315 |
|
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
316 |
HBufC* hslpAddr = HBufC::NewLC(KMaxHSLPAddrLen); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
317 |
HBufC* iapName = HBufC::NewLC(KMaxIAPLen); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
318 |
TInt64 slpId; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
319 |
TBool enabledFlag, simChangeFlag, usageInHomeNwFlag, editFlag; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
320 |
|
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
321 |
TInt errParams = params->Get(slpId, hslpAddr->Des(), iapName->Des(), |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
322 |
enabledFlag, simChangeFlag, usageInHomeNwFlag, editFlag); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
323 |
if (iapName->Length() > 0) |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
324 |
{ |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
325 |
iEditorDlg->SetAccessPointEnabled(ETrue); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
326 |
} |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
327 |
|
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
328 |
CleanupStack::PopAndDestroy(3, params); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
329 |
} |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
330 |
|
45 | 331 |
TInt error = iEditorDlg->ExecuteLD(); |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
332 |
if (EEikCmdExit == error) |
45 | 333 |
{ |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
334 |
((CAknViewAppUi*) CEikonEnv::Static()->EikAppUi())->HandleCommandL( |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
335 |
EEikCmdExit); |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
336 |
} |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
337 |
iEditorDlg = NULL; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
338 |
|
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
339 |
DEBUG( - CLocSUPLSettingsUiEngine::EditServerL ); |
45 | 340 |
} |
341 |
||
342 |
// --------------------------------------------------------------------------- |
|
343 |
// void CLocSUPLSettingsUiEngine::SlpCount() |
|
344 |
// returns total no of slp entries |
|
345 |
// |
|
346 |
// --------------------------------------------------------------------------- |
|
347 |
// |
|
348 |
TInt CLocSUPLSettingsUiEngine::SlpCount() |
|
349 |
{ |
|
350 |
TInt slpCount = 0; |
|
351 |
TRAP_IGNORE( iSUPLSettingsAdapter->SlpCountL( slpCount ) ); |
|
352 |
return slpCount; |
|
353 |
} |
|
354 |
||
355 |
// --------------------------------------------------------------------------- |
|
356 |
// void CLocSUPLSettingsUiEngine::AddNewServerL() |
|
357 |
// Method to add new server entry to SUPL settings with server attributes |
|
358 |
// |
|
359 |
// --------------------------------------------------------------------------- |
|
360 |
// |
|
361 |
void CLocSUPLSettingsUiEngine::AddNewServerL( |
|
362 |
const TDesC& aServerAddress, |
|
363 |
const TDesC& aIapName, |
|
364 |
const TBool aUsageInHomeNw |
|
365 |
) |
|
366 |
{ |
|
367 |
DEBUG( + CLocSUPLSettingsUiEngine::AddNewServerL ); |
|
368 |
iSUPLSettingsAdapter->AddNewServerL( |
|
369 |
aServerAddress, |
|
370 |
aIapName, |
|
371 |
aUsageInHomeNw ); |
|
372 |
DEBUG( - CLocSUPLSettingsUiEngine::AddNewServerL ); |
|
373 |
} |
|
374 |
||
375 |
// --------------------------------------------------------------------------- |
|
376 |
// void CLocSUPLSettingsUiEngine::RemoveServerL |
|
377 |
// --------------------------------------------------------------------------- |
|
378 |
// |
|
379 |
void CLocSUPLSettingsUiEngine::RemoveServerL( |
|
380 |
const TInt64 aSlpId |
|
381 |
) |
|
382 |
{ |
|
383 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveServerL ); |
|
384 |
iSUPLSettingsAdapter->RemoveServerL( aSlpId ); |
|
385 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveServerL ); |
|
386 |
} |
|
387 |
||
388 |
// --------------------------------------------------------------------------- |
|
389 |
// void CLocSUPLSettingsUiEngine::ChangePriorityL |
|
390 |
// --------------------------------------------------------------------------- |
|
391 |
// |
|
392 |
void CLocSUPLSettingsUiEngine::ChangePriorityL( |
|
393 |
TInt64 aSlpId, |
|
394 |
TInt aPriority, |
|
395 |
TBool aDirection |
|
396 |
) |
|
397 |
{ |
|
398 |
DEBUG( + CLocSUPLSettingsUiEngine::ChangePriorityL ); |
|
399 |
iSUPLSettingsAdapter->ChangePriorityL( aSlpId, aPriority, aDirection ); |
|
400 |
DEBUG( - CLocSUPLSettingsUiEngine::ChangePriorityL ); |
|
401 |
} |
|
402 |
||
403 |
// --------------------------------------------------------------------------- |
|
404 |
// void CLocSUPLSettingsUiEngine::GetAllSlpL |
|
405 |
// --------------------------------------------------------------------------- |
|
406 |
// |
|
407 |
void CLocSUPLSettingsUiEngine::GetAllSlpL( |
|
408 |
RPointerArray<CServerParams>& aParamValues |
|
409 |
) const |
|
410 |
{ |
|
411 |
DEBUG( + CLocSUPLSettingsUiEngine::GetAllSlpL ); |
|
412 |
iSUPLSettingsAdapter->GetAllSlpL( aParamValues ) ; |
|
413 |
DEBUG( - CLocSUPLSettingsUiEngine::GetAllSlpL ); |
|
414 |
} |
|
415 |
||
416 |
// --------------------------------------------------------------------------- |
|
417 |
// void CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL |
|
418 |
// --------------------------------------------------------------------------- |
|
419 |
// |
|
420 |
void CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL( |
|
421 |
const TInt64 aSlpId, |
|
422 |
CServerParams *aParamValues |
|
423 |
) const |
|
424 |
{ |
|
425 |
DEBUG( + CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL ); |
|
426 |
iSUPLSettingsAdapter->GetSlpInfoFromIdL( aSlpId, aParamValues ) ; |
|
427 |
DEBUG( - CLocSUPLSettingsUiEngine::GetSlpInfoFromIdL ); |
|
428 |
} |
|
429 |
||
430 |
// --------------------------------------------------------------------------- |
|
431 |
// void CLocSUPLSettingsUiEngine::SetServerAddressL |
|
432 |
// --------------------------------------------------------------------------- |
|
433 |
// |
|
434 |
void CLocSUPLSettingsUiEngine::SetServerAddressL( |
|
435 |
const TInt64 aSlpId, |
|
436 |
const TDesC& aServerAddress |
|
437 |
) |
|
438 |
{ |
|
439 |
DEBUG( + CLocSUPLSettingsUiEngine::SetServerAddressL ); |
|
440 |
iSUPLSettingsAdapter->SetServerAddressL( aSlpId, aServerAddress ) ; |
|
441 |
DEBUG( - CLocSUPLSettingsUiEngine::SetServerAddressL ); |
|
442 |
} |
|
443 |
||
444 |
// --------------------------------------------------------------------------- |
|
445 |
// void CLocSUPLSettingsUiEngine::GetServerAddressL |
|
446 |
// --------------------------------------------------------------------------- |
|
447 |
// |
|
448 |
void CLocSUPLSettingsUiEngine::GetServerAddressL( |
|
449 |
TInt64 aSlpId, |
|
450 |
TDes& aServerAddress |
|
451 |
) const |
|
452 |
{ |
|
453 |
DEBUG( + CLocSUPLSettingsUiEngine::GetServerAddressL ); |
|
454 |
iSUPLSettingsAdapter->GetServerAddressL( aSlpId, aServerAddress ); |
|
455 |
DEBUG( - CLocSUPLSettingsUiEngine::GetServerAddressL ); |
|
456 |
} |
|
457 |
||
458 |
// --------------------------------------------------------------------------- |
|
459 |
// void CLocSUPLSettingsUiEngine::SetIapNameL |
|
460 |
// --------------------------------------------------------------------------- |
|
461 |
// |
|
462 |
void CLocSUPLSettingsUiEngine::SetIapNameL( |
|
463 |
const TInt64 aSlpId, |
|
464 |
const TDesC& aIapName |
|
465 |
) |
|
466 |
{ |
|
467 |
DEBUG( + CLocSUPLSettingsUiEngine::SetIapNameL ); |
|
468 |
iSUPLSettingsAdapter->SetIapNameL( aSlpId, aIapName ) ; |
|
469 |
DEBUG( - CLocSUPLSettingsUiEngine::SetIapNameL ); |
|
470 |
} |
|
471 |
||
472 |
// --------------------------------------------------------------------------- |
|
473 |
// void CLocSUPLSettingsUiEngine::SetServerEnabledFlagL |
|
474 |
// --------------------------------------------------------------------------- |
|
475 |
// |
|
476 |
void CLocSUPLSettingsUiEngine::SetServerEnabledFlagL( |
|
477 |
const TInt64 aSlpId, |
|
478 |
const TBool aEnable |
|
479 |
) const |
|
480 |
{ |
|
481 |
DEBUG( + CLocSUPLSettingsUiEngine::SetServerEnabledFlagL ); |
|
482 |
iSUPLSettingsAdapter->SetServerEnabledFlagL( aSlpId, aEnable ) ; |
|
483 |
DEBUG( - CLocSUPLSettingsUiEngine::SetServerEnabledFlagL ); |
|
484 |
} |
|
485 |
||
486 |
// --------------------------------------------------------------------------- |
|
487 |
// void CLocSUPLSettingsUiEngine::GetServerEnabledFlagL |
|
488 |
// --------------------------------------------------------------------------- |
|
489 |
// |
|
490 |
void CLocSUPLSettingsUiEngine::GetServerEnabledFlagL( |
|
491 |
const TInt64 aSlpId, |
|
492 |
TBool& aEnable |
|
493 |
) const |
|
494 |
{ |
|
495 |
DEBUG( + CLocSUPLSettingsUiEngine::GetServerEnabledFlagL ); |
|
496 |
iSUPLSettingsAdapter->GetServerEnabledFlagL( aSlpId, aEnable ); |
|
497 |
DEBUG( - CLocSUPLSettingsUiEngine::GetServerEnabledFlagL ); |
|
498 |
} |
|
499 |
||
500 |
// --------------------------------------------------------------------------- |
|
501 |
// void CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL |
|
502 |
// --------------------------------------------------------------------------- |
|
503 |
// |
|
504 |
void CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL( |
|
505 |
const TInt64 aSlpId, |
|
506 |
const TBool aHomeNwFlag |
|
507 |
) |
|
508 |
{ |
|
509 |
DEBUG( + CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL ); |
|
510 |
iSUPLSettingsAdapter->SetUsageInHomwNwFlagL( aSlpId, aHomeNwFlag ) ; |
|
511 |
DEBUG( - CLocSUPLSettingsUiEngine::SetUsageInHomwNwFlagL ); |
|
512 |
} |
|
513 |
||
514 |
// --------------------------------------------------------------------------- |
|
515 |
// void CLocSUPLSettingsUiEngine::SetEditableFlagL |
|
516 |
// --------------------------------------------------------------------------- |
|
517 |
// |
|
518 |
void CLocSUPLSettingsUiEngine::SetEditableFlagL( |
|
519 |
const TInt64 aSlpId, |
|
520 |
const TBool aEditFlag |
|
521 |
) const |
|
522 |
{ |
|
523 |
DEBUG( + CLocSUPLSettingsUiEngine::SetEditableFlagL ); |
|
524 |
iSUPLSettingsAdapter->SetEditableFlagL( aSlpId, aEditFlag ); |
|
525 |
DEBUG( - CLocSUPLSettingsUiEngine::SetEditableFlagL ); |
|
526 |
} |
|
527 |
||
528 |
// --------------------------------------------------------------------------- |
|
529 |
// void CLocSUPLSettingsUiEngine::GetEditableFlagL |
|
530 |
// --------------------------------------------------------------------------- |
|
531 |
// |
|
532 |
void CLocSUPLSettingsUiEngine::GetEditableFlagL( |
|
533 |
const TInt64 aSlpId, |
|
534 |
TBool& aEditFlag |
|
535 |
) const |
|
536 |
{ |
|
537 |
DEBUG( + CLocSUPLSettingsUiEngine::GetEditableFlagL ); |
|
538 |
iSUPLSettingsAdapter->GetEditableFlagL( aSlpId, aEditFlag ) ; |
|
539 |
DEBUG( - CLocSUPLSettingsUiEngine::GetEditableFlagL ); |
|
540 |
} |
|
541 |
||
542 |
// --------------------------------------------------------------------------- |
|
543 |
// void CLocSUPLSettingsUiEngine::GetActiveSessionsCountL |
|
544 |
// --------------------------------------------------------------------------- |
|
545 |
// |
|
546 |
void CLocSUPLSettingsUiEngine::GetActiveSessionsCountL( TInt& aAccessPointCount ) |
|
547 |
{ |
|
548 |
DEBUG( + CLocSUPLSettingsUiEngine::GetActiveSessionsCountL ); |
|
549 |
iSUPLSettingsAdapter->GetActiveSessionsCountL( aAccessPointCount ); |
|
550 |
DEBUG( - CLocSUPLSettingsUiEngine::GetActiveSessionsCountL ); |
|
551 |
} |
|
552 |
||
553 |
// --------------------------------------------------------------------------- |
|
554 |
// void CLocSUPLSettingsUiEngine::GetTriggerParamsL |
|
555 |
// --------------------------------------------------------------------------- |
|
556 |
// |
|
557 |
void CLocSUPLSettingsUiEngine::GetTriggerParamsL( |
|
558 |
RPointerArray<CTriggerParams>& aParamValues |
|
559 |
) const |
|
560 |
{ |
|
561 |
DEBUG( + CLocSUPLSettingsUiEngine::GetTriggerParamsL ); |
|
562 |
iSUPLSettingsAdapter->GetTriggerParamsL( aParamValues ) ; |
|
563 |
DEBUG( - CLocSUPLSettingsUiEngine::GetTriggerParamsL ); |
|
564 |
} |
|
565 |
||
566 |
// --------------------------------------------------------------------------- |
|
567 |
// void CLocSUPLSettingsUiEngine::GetTriggerParamsL |
|
568 |
// --------------------------------------------------------------------------- |
|
569 |
// |
|
570 |
void CLocSUPLSettingsUiEngine::GetTriggerParamsL( TInt64 aSessionId, |
|
571 |
CTriggerParams*& aTrigger |
|
572 |
) const |
|
573 |
{ |
|
574 |
DEBUG( + CLocSUPLSettingsUiEngine::GetTriggerParamsL ); |
|
575 |
iSUPLSettingsAdapter->GetTriggerParamsL( aSessionId, aTrigger ) ; |
|
576 |
DEBUG( - CLocSUPLSettingsUiEngine::GetTriggerParamsL ); |
|
577 |
} |
|
578 |
||
579 |
// --------------------------------------------------------------------------- |
|
580 |
// void CLocSUPLSettingsUiEngine::OpenSessionL |
|
581 |
// --------------------------------------------------------------------------- |
|
582 |
// |
|
583 |
void CLocSUPLSettingsUiEngine::OpenSessionL( TInt64 aSessionId ) |
|
584 |
{ |
|
585 |
DEBUG( + CLocSUPLSettingsUiEngine::OpenSessionL ); |
|
586 |
||
587 |
CLocSUPLSessionEditor* form = CLocSUPLSessionEditor::NewL( *this, aSessionId ); |
|
588 |
TInt error = form->ExecuteLD( ); |
|
589 |
if ( EEikCmdExit == error ) |
|
590 |
{ |
|
591 |
( ( CAknViewAppUi* ) CEikonEnv::Static()->EikAppUi())->HandleCommandL( EEikCmdExit ); |
|
592 |
} |
|
593 |
||
594 |
DEBUG( - CLocSUPLSettingsUiEngine::OpenSessionL ); |
|
595 |
} |
|
596 |
||
597 |
// --------------------------------------------------------------------------- |
|
598 |
// void CLocSUPLSettingsUiEngine::ChangeNotificationStatusL |
|
599 |
// --------------------------------------------------------------------------- |
|
600 |
// |
|
601 |
void CLocSUPLSettingsUiEngine::ChangeNotificationStatusL( TInt64 aSessionId, TBool aTriggerNotificationStatus ) const |
|
602 |
{ |
|
603 |
DEBUG( + CLocSUPLSettingsUiEngine::ChangeNotificationStatusL ); |
|
604 |
iSUPLSettingsAdapter->ChangeNotificationStatusL( aSessionId, aTriggerNotificationStatus ) ; |
|
605 |
DEBUG( - CLocSUPLSettingsUiEngine::ChangeNotificationStatusL ); |
|
606 |
} |
|
607 |
||
608 |
// --------------------------------------------------------------------------- |
|
609 |
// void CLocSUPLSettingsUiEngine::RemoveTriggerSessionL |
|
610 |
// --------------------------------------------------------------------------- |
|
611 |
// |
|
612 |
void CLocSUPLSettingsUiEngine::RemoveTriggerSessionL( TInt64 aSessionId ) const |
|
613 |
{ |
|
614 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveTriggerSessionL ); |
|
615 |
iSUPLSettingsAdapter->RemoveTriggerSessionL( aSessionId ) ; |
|
616 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveTriggerSessionL ); |
|
617 |
} |
|
618 |
||
619 |
// --------------------------------------------------------------------------- |
|
620 |
// void CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL |
|
621 |
// --------------------------------------------------------------------------- |
|
622 |
// |
|
623 |
void CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL( RArray< TInt64 >& aSessionIdList ) const |
|
624 |
{ |
|
625 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL ); |
|
626 |
for( TInt i=0; i<aSessionIdList.Count(); i++ ) |
|
627 |
{ |
|
628 |
iSUPLSettingsAdapter->RemoveTriggerSessionL( aSessionIdList[i] ) ; |
|
629 |
} |
|
630 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveTriggerSessionsL ); |
|
631 |
} |
|
632 |
||
633 |
// --------------------------------------------------------------------------- |
|
634 |
// void CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL |
|
635 |
// --------------------------------------------------------------------------- |
|
636 |
// |
|
637 |
void CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL( ) const |
|
638 |
{ |
|
639 |
DEBUG( + CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL ); |
|
640 |
RPointerArray<CTriggerParams> paramValues; |
|
641 |
CleanupClosePushL( paramValues ); |
|
642 |
||
643 |
iSUPLSettingsAdapter->GetTriggerParamsL( paramValues ) ; |
|
644 |
||
645 |
for( TInt i=0; i<paramValues.Count(); i++ ) |
|
646 |
{ |
|
647 |
TInt64 sessionId; |
|
648 |
TUint64 outstandingTrigger; |
|
649 |
TUint64 interval; |
|
650 |
TBool notificationPresent; |
|
651 |
TBool triggerNotificationStatus; |
|
652 |
CTriggerParams::TTriggerType triggerType; |
|
653 |
CTriggerParams::TRequestType requestType; |
|
654 |
HBufC* sessionName = HBufC::NewLC( KMaxTriggerSessionNameLen ); |
|
655 |
||
656 |
TInt errParams = paramValues[i]->Get( |
|
657 |
sessionId, |
|
658 |
sessionName->Des(), |
|
659 |
notificationPresent, |
|
660 |
triggerNotificationStatus, |
|
661 |
triggerType, |
|
662 |
requestType, |
|
663 |
outstandingTrigger, |
|
664 |
interval); |
|
665 |
iSUPLSettingsAdapter->RemoveTriggerSessionL( sessionId ) ; |
|
666 |
||
667 |
CleanupStack::PopAndDestroy( sessionName ); |
|
668 |
} |
|
669 |
||
670 |
paramValues.ResetAndDestroy(); |
|
671 |
CleanupStack::PopAndDestroy( ¶mValues ); // paramValues |
|
672 |
DEBUG( - CLocSUPLSettingsUiEngine::RemoveAllTriggerSessionsL ); |
|
673 |
} |
|
674 |
||
675 |
// --------------------------------------------------------------------------- |
|
676 |
// void CLocSUPLSettingsUiEngine::SetSessionObserver |
|
677 |
// --------------------------------------------------------------------------- |
|
678 |
// |
|
679 |
void CLocSUPLSettingsUiEngine::SetSessionObserver( MLocSUPLSettingsSessionObserver* aObserver ) const |
|
680 |
{ |
|
681 |
iSUPLSettingsAdapter->SetSessionObserver( aObserver ); |
|
682 |
} |
|
683 |
||
684 |
// --------------------------------------------------------------------------- |
|
685 |
// void CLocSUPLSettingsUiEngine::RemoveSessionObserver |
|
686 |
// --------------------------------------------------------------------------- |
|
687 |
// |
|
688 |
void CLocSUPLSettingsUiEngine::RemoveSessionObserver( ) const |
|
689 |
{ |
|
690 |
iSUPLSettingsAdapter->RemoveSessionObserver( ); |
|
691 |
} |
|
692 |
||
693 |
// --------------------------------------------------------------------------- |
|
694 |
// void CLocSUPLSettingsUiEngine::GetTempAPValue |
|
695 |
// --------------------------------------------------------------------------- |
|
696 |
// |
|
697 |
TUint32 CLocSUPLSettingsUiEngine::GetTempAPValue() |
|
698 |
{ |
|
699 |
return iTempAP; |
|
700 |
} |
|
701 |
||
702 |
// --------------------------------------------------------------------------- |
|
703 |
// void CLocSUPLSettingsUiEngine::SetTempAPValue |
|
704 |
// --------------------------------------------------------------------------- |
|
705 |
// |
|
706 |
void CLocSUPLSettingsUiEngine::SetTempAPValue( TUint32 aAccessPoint) |
|
707 |
{ |
|
708 |
iTempAP = aAccessPoint; |
|
709 |
} |
|
710 |
||
711 |
// End of File |