58
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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: Methods for Server Profile Settings dialog
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include <akntextsettingpage.h>
|
|
21 |
#include <aknpasswordsettingpage.h>
|
|
22 |
#include <aknnotewrappers.h>
|
|
23 |
#include <aknnavi.h>
|
|
24 |
#include <StringLoader.h>
|
|
25 |
#include <featmgr.h>
|
|
26 |
#include <ConnectionUiUtilities.h>
|
|
27 |
#include <aknradiobuttonsettingpage.h>
|
|
28 |
#include <cmapplicationsettingsui.h>
|
|
29 |
#include <cmmanager.h>
|
|
30 |
#include <cmconnectionmethod.h>
|
|
31 |
#include "NSmlDMSyncApp.h"
|
|
32 |
#include "NSmlDMSyncDocument.h"
|
|
33 |
#include "NSmlDMSyncAppUi.h"
|
|
34 |
#include "NSmlDMDlgProfileView.h"
|
|
35 |
#include "NSmlDMSyncProfile.h"
|
|
36 |
#include "NSmlDMSyncAppEngine.h"
|
|
37 |
#include "NSmlDMSyncDebug.h"
|
|
38 |
#include "NSmlDMItemData.h"
|
|
39 |
#include "nsmldmsyncinternalpskeys.h"
|
|
40 |
#include <nsmldmsync.rsg>
|
|
41 |
#include <cmmanager.rsg>
|
|
42 |
#include <connectionuiutilities.rsg>
|
|
43 |
#include <bautils.h>
|
|
44 |
|
|
45 |
#include <hlplch.h>
|
|
46 |
#include <csxhelp/dm.hlp.hrh>
|
|
47 |
|
|
48 |
_LIT( KACMManagerResDirAndFileName, "z:cmmanager.rsc" );
|
|
49 |
_LIT(KConnectionUiUtilitiesRscPath, "z:ConnectionUiUtilities.rsc");
|
|
50 |
_LIT(KDC_RESOURCE_FILES_DIR,"\\resource\\");
|
|
51 |
|
|
52 |
|
|
53 |
// ============================= MEMBER FUNCTIONS ==============================
|
|
54 |
|
|
55 |
// -----------------------------------------------------------------------------
|
|
56 |
// CNSmlDMDlgProfileView::NewL
|
|
57 |
// -----------------------------------------------------------------------------
|
|
58 |
//
|
|
59 |
CNSmlDMDlgProfileView* CNSmlDMDlgProfileView::NewL( CNSmlDMSyncDocument* aDoc,
|
|
60 |
TNSmlEditMode aMode,
|
|
61 |
TInt aProfileId )
|
|
62 |
{
|
|
63 |
FLOG( "CNSmlDMDlgProfileView::NewL" );
|
|
64 |
|
|
65 |
CNSmlDMDlgProfileView* self =
|
|
66 |
new ( ELeave ) CNSmlDMDlgProfileView( aDoc,
|
|
67 |
aMode,
|
|
68 |
aProfileId );
|
|
69 |
CleanupStack::PushL( self );
|
|
70 |
self->ConstructL( R_SETTINGS_PROFILEMENU );
|
|
71 |
CleanupStack::Pop();
|
|
72 |
return( self );
|
|
73 |
}
|
|
74 |
|
|
75 |
// -----------------------------------------------------------------------------
|
|
76 |
// CNSmlDMDlgProfileView::CNSmlDMDlgProfileView
|
|
77 |
// C++ default constructor can NOT contain any code, that
|
|
78 |
// might leave.
|
|
79 |
// -----------------------------------------------------------------------------
|
|
80 |
//
|
|
81 |
CNSmlDMDlgProfileView::CNSmlDMDlgProfileView( CNSmlDMSyncDocument* aDoc,
|
|
82 |
TNSmlEditMode aMode,
|
|
83 |
TInt aProfileId )
|
|
84 |
: iDoc( aDoc ),
|
|
85 |
iEditMode( aMode ),
|
|
86 |
iProfileId( aProfileId ),
|
|
87 |
iResourceOffset(KErrNotFound),
|
|
88 |
iConnUtilResourceOffset(KErrNotFound)
|
|
89 |
{
|
|
90 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::CNSmlDMDlgProfileView" );
|
|
91 |
}
|
|
92 |
|
|
93 |
// -----------------------------------------------------------------------------
|
|
94 |
// Destructor
|
|
95 |
// -----------------------------------------------------------------------------
|
|
96 |
//
|
|
97 |
CNSmlDMDlgProfileView::~CNSmlDMDlgProfileView()
|
|
98 |
{
|
|
99 |
FLOG( "[OMADM] ~CNSmlDMDlgProfileView:" );
|
|
100 |
if(iResourceOffset >= 0)
|
|
101 |
{
|
|
102 |
CCoeEnv::Static()->DeleteResourceFile(iResourceOffset);
|
|
103 |
}
|
|
104 |
if(iConnUtilResourceOffset >= 0)
|
|
105 |
{
|
|
106 |
CCoeEnv::Static()->DeleteResourceFile(iConnUtilResourceOffset);
|
|
107 |
}
|
|
108 |
if ( iNaviPane )
|
|
109 |
{
|
|
110 |
iNaviPane->Pop();
|
|
111 |
}
|
|
112 |
|
|
113 |
if ( iProfileList )
|
|
114 |
{
|
|
115 |
iProfileList->ResetAndDestroy();
|
|
116 |
delete iProfileList;
|
|
117 |
}
|
|
118 |
iAvkonAppUi->RemoveFromStack( this );
|
|
119 |
FeatureManager::UnInitializeLib();
|
|
120 |
}
|
|
121 |
|
|
122 |
// -----------------------------------------------------------------------------
|
|
123 |
// CNSmlDMDlgProfileView::OkToExitL
|
|
124 |
// -----------------------------------------------------------------------------
|
|
125 |
//
|
|
126 |
TBool CNSmlDMDlgProfileView::OkToExitL( TInt aButtonId )
|
|
127 |
{
|
|
128 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::OkToExitL:" );
|
|
129 |
|
|
130 |
|
|
131 |
if ( aButtonId == EAknSoftkeyChange )
|
|
132 |
{
|
|
133 |
HandleOKL();
|
|
134 |
return EFalse;
|
|
135 |
}
|
|
136 |
|
|
137 |
if ( aButtonId == EAknSoftkeyBack )
|
|
138 |
{
|
|
139 |
TBool closeDlg = ETrue;
|
|
140 |
TBool saveProfile = ETrue;
|
|
141 |
//TInt index;
|
|
142 |
TInt retValue = CheckMandatoryFieldsL();
|
|
143 |
if ( retValue != KErrNotFound )
|
|
144 |
{
|
|
145 |
if(CheckUniqueFieldsL()== ENSmlServerId )
|
|
146 |
{
|
|
147 |
STATIC_CAST( CNSmlDMSyncAppUi*,
|
|
148 |
iEikonEnv->EikAppUi())->ShowResourceErrorNoteL(R_QTN_DM_CONF_SET_DUP_SERVER_ID );
|
|
149 |
closeDlg = EFalse;
|
|
150 |
iProfileListBox->SetCurrentItemIndexAndDraw( retValue );
|
|
151 |
saveProfile = EFalse;
|
|
152 |
}
|
|
153 |
else if(ShowConfirmationNoteL( R_NSML_SETTINGS_SAVE_ANYWAY ))
|
|
154 |
{
|
|
155 |
|
|
156 |
if ( iEditMode == ESmlCopyProfile )
|
|
157 |
{
|
|
158 |
iDoc->MoveIndexToProfile( iProfileId );
|
|
159 |
// This deletes the source profile
|
|
160 |
//iDoc->DeleteProfile( index );
|
|
161 |
iDoc->AppEngine()->DeleteProfileL( iProfileId );
|
|
162 |
iDoc->MoveIndexToProfile( iOldProfileId );
|
|
163 |
}
|
|
164 |
else if ( iEditMode == ESmlNewProfile )
|
|
165 |
{
|
|
166 |
iDoc->AppEngine()->DeleteProfileL( iProfileId );
|
|
167 |
}
|
|
168 |
//For CP stored umcompleted message
|
|
169 |
else if ( iEditMode == ESmlEditProfile )
|
|
170 |
{
|
|
171 |
iDoc->AppEngine()->DeleteProfileL( iProfileId );
|
|
172 |
iDoc->RefreshProfileListL();
|
|
173 |
iDoc->MoveIndexToProfile( iProfileId );
|
|
174 |
}
|
|
175 |
//For CP umcompleted message
|
|
176 |
saveProfile = EFalse;
|
|
177 |
}
|
|
178 |
else
|
|
179 |
{
|
|
180 |
closeDlg = EFalse;
|
|
181 |
iProfileListBox->SetCurrentItemIndexAndDraw( retValue );
|
|
182 |
saveProfile = EFalse;
|
|
183 |
}
|
|
184 |
|
|
185 |
}
|
|
186 |
|
|
187 |
if ( saveProfile )
|
|
188 |
{
|
|
189 |
SaveProfileL();
|
|
190 |
}
|
|
191 |
if ( closeDlg )
|
|
192 |
{
|
|
193 |
((CNSmlDMSyncAppUi*)iDoc->AppUi())->ChangeViewL( ETrue );
|
|
194 |
}
|
|
195 |
return closeDlg;
|
|
196 |
}
|
|
197 |
return CAknDialog::OkToExitL( aButtonId );
|
|
198 |
}
|
|
199 |
|
|
200 |
// -----------------------------------------------------------------------------
|
|
201 |
// CNSmlDMDlgProfileView::ProcessCommandL
|
|
202 |
// -----------------------------------------------------------------------------
|
|
203 |
//
|
|
204 |
void CNSmlDMDlgProfileView::ProcessCommandL( TInt aCommandId )
|
|
205 |
{
|
|
206 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::ProcessCommandL:" );
|
|
207 |
|
|
208 |
HideMenu();
|
|
209 |
switch ( aCommandId )
|
|
210 |
{
|
|
211 |
case EAknCmdHelp:
|
|
212 |
{
|
|
213 |
if (FeatureManager::FeatureSupported( KFeatureIdHelp ))
|
|
214 |
{
|
|
215 |
HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), ((CNSmlDMSyncAppUi*)iDoc->AppUi())->AppHelpContextL() );
|
|
216 |
}
|
|
217 |
|
|
218 |
|
|
219 |
break;
|
|
220 |
}
|
|
221 |
case ENSmlSettChange:
|
|
222 |
{
|
|
223 |
CNSmlDMProfileData* item =
|
|
224 |
GetItemForIndex( iProfileListBox->CurrentItemIndex());
|
|
225 |
if ( item->iItemType == CNSmlDMProfileData::ENSmlTypeListYesNo ||
|
|
226 |
item->iItemType == CNSmlDMProfileData::ENSmlTypehttpListYesNo ||
|
|
227 |
item->iItemType == CNSmlDMProfileData::ENSmlTypeList
|
|
228 |
)
|
|
229 |
{
|
|
230 |
if ( EditSettingItemListL( *item ) )
|
|
231 |
{
|
|
232 |
//update listbox
|
|
233 |
AddProfileListItemL( iProfileListBox, iProfileList );
|
|
234 |
}
|
|
235 |
iProfileListBox->HandleItemAdditionL();
|
|
236 |
}
|
|
237 |
else
|
|
238 |
{
|
|
239 |
HandleOKL();
|
|
240 |
}
|
|
241 |
}
|
|
242 |
break;
|
|
243 |
|
|
244 |
case ENSmlSettExit:
|
|
245 |
case EAknCmdExit:
|
|
246 |
case EEikCmdExit:
|
|
247 |
{
|
|
248 |
if ( CheckMandatoryFieldsL() >= KErrNone)
|
|
249 |
{
|
|
250 |
if ( !ShowConfirmationNoteL( R_NSML_SETTINGS_SAVE_ANYWAY ) )
|
|
251 |
{
|
|
252 |
return;
|
|
253 |
}
|
|
254 |
else if( iEditMode == ESmlEditProfile )
|
|
255 |
{
|
|
256 |
iDoc->AppEngine()->DeleteProfileL( iProfileId );
|
|
257 |
}
|
|
258 |
else if ( iEditMode == ESmlNewProfile )
|
|
259 |
{
|
|
260 |
iDoc->AppEngine()->DeleteProfileL( iProfileId );
|
|
261 |
}
|
|
262 |
}
|
|
263 |
TApaTaskList taskList(CEikonEnv::Static()->WsSession());
|
|
264 |
TApaTask task1(taskList.FindApp( KFotaServerAppUid));
|
|
265 |
if(task1.Exists())
|
|
266 |
{
|
|
267 |
FLOG( "ending fotaserver 1..." );
|
|
268 |
task1.EndTask();
|
|
269 |
}
|
|
270 |
TApaTask task2(taskList.FindApp( KFotaServerAppUid));
|
|
271 |
if(task2.Exists())
|
|
272 |
{
|
|
273 |
FLOG( "ending fotaserver 2..." );
|
|
274 |
task2.EndTask();
|
|
275 |
}
|
|
276 |
TApaTask task3(taskList.FindApp( KFotaServerAppUid));
|
|
277 |
if(task3.Exists())
|
|
278 |
{
|
|
279 |
FLOG( "ending fotaserver 3..." );
|
|
280 |
task3.EndTask();
|
|
281 |
}
|
|
282 |
STATIC_CAST( CNSmlDMSyncAppUi*, iEikonEnv->EikAppUi() )->DoExit();
|
|
283 |
}
|
|
284 |
break;
|
|
285 |
|
|
286 |
default:
|
|
287 |
break;
|
|
288 |
}
|
|
289 |
}
|
|
290 |
|
|
291 |
// -----------------------------------------------------------------------------
|
|
292 |
// CNSmlDMDlgProfileView::PreLayoutDynInitL
|
|
293 |
// -----------------------------------------------------------------------------
|
|
294 |
//
|
|
295 |
void CNSmlDMDlgProfileView::PreLayoutDynInitL()
|
|
296 |
{
|
|
297 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::PreLayoutDynInitL:");
|
|
298 |
TParse parse;
|
|
299 |
parse.Set(KACMManagerResDirAndFileName, &KDC_RESOURCE_FILES_DIR, NULL);
|
|
300 |
TFileName resourceFile;
|
|
301 |
resourceFile.Append(parse.FullName());
|
|
302 |
CEikonEnv* coeEnv = CEikonEnv::Static();
|
|
303 |
RFs& fileSession = coeEnv->FsSession();
|
|
304 |
BaflUtils::NearestLanguageFile( fileSession, resourceFile );
|
|
305 |
if ( !BaflUtils::FileExists( fileSession, resourceFile ) )
|
|
306 |
{
|
|
307 |
User::Leave( KErrNotFound );
|
|
308 |
}
|
|
309 |
iResourceOffset = coeEnv->AddResourceFileL( resourceFile );
|
|
310 |
|
|
311 |
TParse connutilname;
|
|
312 |
connutilname.Set(KConnectionUiUtilitiesRscPath, &KDC_RESOURCE_FILES_DIR, NULL);
|
|
313 |
resourceFile.Zero();
|
|
314 |
resourceFile.Append(connutilname.FullName());
|
|
315 |
BaflUtils::NearestLanguageFile( fileSession, resourceFile );
|
|
316 |
if ( !BaflUtils::FileExists( fileSession, resourceFile ) )
|
|
317 |
{
|
|
318 |
User::Leave( KErrNotFound );
|
|
319 |
}
|
|
320 |
iConnUtilResourceOffset = coeEnv->AddResourceFileL( resourceFile );
|
|
321 |
|
|
322 |
iAvkonAppUi->AddToStackL( this );
|
|
323 |
FeatureManager::InitializeLibL();
|
|
324 |
|
|
325 |
iProfileListBox = (CAknSettingStyleListBox*)Control( ENSmlSettingList );
|
|
326 |
iProfileListBox->SetListBoxObserver( this );
|
|
327 |
iProfileListBox->CreateScrollBarFrameL( ETrue );
|
|
328 |
iProfileListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
|
|
329 |
CEikScrollBarFrame::EOn,
|
|
330 |
CEikScrollBarFrame::EAuto );
|
|
331 |
|
|
332 |
iSyncAppEngine = iDoc->AppEngine();
|
|
333 |
iProfileList = new (ELeave) CArrayPtrFlat<CNSmlDMProfileData>(1);
|
|
334 |
|
|
335 |
if ( iEditMode == ESmlCopyProfile )
|
|
336 |
{
|
|
337 |
iOldProfileId = iProfileId;
|
|
338 |
iDoc->GetCopyProfileL( iProfileId );
|
|
339 |
iDoc->RefreshProfileListL();
|
|
340 |
iDoc->MoveIndexToProfile( iProfileId );
|
|
341 |
iServerIdChanged = ETrue;
|
|
342 |
}
|
|
343 |
else if ( iEditMode == ESmlNewProfile )
|
|
344 |
{
|
|
345 |
iProfileId = iSyncAppEngine->CreateProfileL();
|
|
346 |
}
|
|
347 |
CreateProfileSettingsListL();
|
|
348 |
SetSettingTitleL();
|
|
349 |
}
|
|
350 |
|
|
351 |
// -----------------------------------------------------------------------------
|
|
352 |
// CNSmlDMDlgProfileView::DynInitMenuPaneL
|
|
353 |
// -----------------------------------------------------------------------------
|
|
354 |
//
|
|
355 |
void CNSmlDMDlgProfileView::DynInitMenuPaneL( TInt aResourceID,
|
|
356 |
CEikMenuPane* aMenuPane )
|
|
357 |
{
|
|
358 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::DynInitMenuPaneL:" );
|
|
359 |
|
|
360 |
|
|
361 |
if (aResourceID == R_SETTINGS_MENU &&
|
|
362 |
!FeatureManager::FeatureSupported( KFeatureIdHelp ))
|
|
363 |
{ aMenuPane->SetItemDimmed( EAknCmdHelp , ETrue );
|
|
364 |
}
|
|
365 |
}
|
|
366 |
|
|
367 |
// -----------------------------------------------------------------------------
|
|
368 |
// CNSmlDMDlgProfileView::HandleListBoxEventL
|
|
369 |
// -----------------------------------------------------------------------------
|
|
370 |
//
|
|
371 |
void CNSmlDMDlgProfileView::HandleListBoxEventL( CEikListBox* /*aListBox*/,
|
|
372 |
TListBoxEvent aEventType )
|
|
373 |
{
|
|
374 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::HandleListBoxEventL:" );
|
|
375 |
|
|
376 |
if ( aEventType == EEventEnterKeyPressed ||
|
|
377 |
aEventType == EEventItemSingleClicked )
|
|
378 |
{
|
|
379 |
HandleOKL();
|
|
380 |
}
|
|
381 |
}
|
|
382 |
|
|
383 |
// -----------------------------------------------------------------------------
|
|
384 |
// CNSmlDMDlgProfileView::HandleOKL
|
|
385 |
// -----------------------------------------------------------------------------
|
|
386 |
//
|
|
387 |
void CNSmlDMDlgProfileView::HandleOKL()
|
|
388 |
{
|
|
389 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::HandleOKL:");
|
|
390 |
|
|
391 |
CNSmlDMProfileData* item =
|
|
392 |
GetItemForIndex( iProfileListBox->CurrentItemIndex() );
|
|
393 |
if ( PrepareToEditSettingItemL( *item ) )
|
|
394 |
{
|
|
395 |
if ( iProfileListBox->CurrentItemIndex() == ENSmlServerId )
|
|
396 |
{
|
|
397 |
iServerIdChanged = ETrue;
|
|
398 |
if ( CheckUniqueFieldsL() != KErrNotFound )
|
|
399 |
{
|
|
400 |
STATIC_CAST( CNSmlDMSyncAppUi*,
|
|
401 |
iEikonEnv->EikAppUi())->ShowResourceErrorNoteL(
|
|
402 |
R_QTN_DM_CONF_SET_DUP_SERVER_ID );
|
|
403 |
}
|
|
404 |
else
|
|
405 |
{
|
|
406 |
iServerIdChanged = EFalse;
|
|
407 |
}
|
|
408 |
}
|
|
409 |
else if ( iProfileListBox->CurrentItemIndex() == ENSmlConnType )
|
|
410 |
{
|
|
411 |
TBool hidden =
|
|
412 |
( Item( ENSmlConnType )->iNumberData != EProfileInternet );
|
|
413 |
Item( ENSmlAccessPoint )->iHidden = hidden;
|
|
414 |
Item( ENSmlProfilePort )->iHidden = hidden;
|
|
415 |
Item( ENSmlHttpsUsed )->iHidden = hidden;
|
|
416 |
if(Item( ENSmlHttpsUsed )->iNumberData == 0 || hidden )
|
|
417 |
{
|
|
418 |
Item( ENSmlHttpsUsername )->iHidden = ETrue;
|
|
419 |
Item( ENSmlHttpsPassword )->iHidden = ETrue;
|
|
420 |
}
|
|
421 |
else
|
|
422 |
{
|
|
423 |
Item( ENSmlHttpsUsername )->iHidden = EFalse;
|
|
424 |
Item( ENSmlHttpsPassword )->iHidden = EFalse;
|
|
425 |
}
|
|
426 |
}
|
|
427 |
//update listbox items
|
|
428 |
AddProfileListItemL( iProfileListBox, iProfileList );
|
|
429 |
}
|
|
430 |
iProfileListBox->HandleItemAdditionL();
|
|
431 |
}
|
|
432 |
|
|
433 |
// -----------------------------------------------------------------------------
|
|
434 |
// CNSmlDMDlgProfileView::OfferKeyEventL
|
|
435 |
// -----------------------------------------------------------------------------
|
|
436 |
//
|
|
437 |
TKeyResponse CNSmlDMDlgProfileView::OfferKeyEventL( const TKeyEvent& aKeyEvent,
|
|
438 |
TEventCode aType )
|
|
439 |
{
|
|
440 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::OfferKeyEventL:" );
|
|
441 |
|
|
442 |
if ( aType == EEventKey )
|
|
443 |
{
|
|
444 |
switch ( aKeyEvent.iCode )
|
|
445 |
{
|
|
446 |
case EKeyEscape:
|
|
447 |
{
|
|
448 |
iAvkonAppUi->ProcessCommandL( EAknCmdExit );
|
|
449 |
}
|
|
450 |
break;
|
|
451 |
case EKeyEnter:
|
|
452 |
case EKeyOK: // OK button
|
|
453 |
{
|
|
454 |
HandleOKL();
|
|
455 |
return EKeyWasConsumed;
|
|
456 |
}
|
|
457 |
default:
|
|
458 |
break;
|
|
459 |
}
|
|
460 |
}
|
|
461 |
return CEikDialog::OfferKeyEventL( aKeyEvent, aType);
|
|
462 |
}
|
|
463 |
|
|
464 |
// -----------------------------------------------------------------------------
|
|
465 |
// CNSmlDMDlgProfileView::AddProfileListItemL
|
|
466 |
// -----------------------------------------------------------------------------
|
|
467 |
//
|
|
468 |
void CNSmlDMDlgProfileView::AddProfileListItemL(
|
|
469 |
CEikTextListBox* aListBox,
|
|
470 |
CNSmlDMSettingItemList* aItemList )
|
|
471 |
{
|
|
472 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::AddProfileListItemL:" );
|
|
473 |
|
|
474 |
if ( ( !aListBox ) || ( !aItemList ) )
|
|
475 |
{
|
|
476 |
User::Leave( KErrNotFound );
|
|
477 |
}
|
|
478 |
CDesCArray* arr = (CDesCArray*)aListBox->Model()->ItemTextArray();
|
|
479 |
arr->Reset();
|
|
480 |
|
|
481 |
for ( TInt index = 0; index < aItemList->Count(); index++ )
|
|
482 |
{
|
|
483 |
if ( !(aItemList->At( index ))->iHidden )
|
|
484 |
{
|
|
485 |
TBool convert =
|
|
486 |
!( index == ENSmlProfileURL || index == ENSmlUsername /*|| index == ENSmlProfilePort*/ );
|
|
487 |
|
|
488 |
arr->AppendL( (aItemList->At(index))->ItemToListLC( convert )->Des() );
|
|
489 |
(aItemList->At( index ))->iIndex = arr->Count() - 1;
|
|
490 |
|
|
491 |
CleanupStack::PopAndDestroy(); //ItemToListLC()
|
|
492 |
}
|
|
493 |
else
|
|
494 |
{
|
|
495 |
(aItemList->At( index ))->iIndex = KErrNotFound;
|
|
496 |
}
|
|
497 |
}
|
|
498 |
}
|
|
499 |
|
|
500 |
// -----------------------------------------------------------------------------
|
|
501 |
// CNSmlDMDlgProfileView::CreateProfileSettingsListL
|
|
502 |
// -----------------------------------------------------------------------------
|
|
503 |
//
|
|
504 |
void CNSmlDMDlgProfileView::CreateProfileSettingsListL()
|
|
505 |
{
|
|
506 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::CreateProfileSettingsListL:" );
|
|
507 |
|
|
508 |
CDesCArrayFlat* items =
|
|
509 |
iEikonEnv->ReadDesCArrayResourceL( R_SML_SETTINGS_ITEMS );
|
|
510 |
CleanupStack::PushL( items );
|
|
511 |
TInt index;
|
|
512 |
for ( index = 0; index < items->Count(); index++ )
|
|
513 |
{
|
|
514 |
iProfileList->AppendL( CNSmlDMProfileData::NewLC() );
|
|
515 |
CleanupStack::Pop();
|
|
516 |
}
|
|
517 |
BuildHeaders( items );
|
|
518 |
BuildItemIds();
|
|
519 |
// Open profile
|
|
520 |
iProfile = iSyncAppEngine->OpenProfileL( iProfileId, ESmlOpenReadWrite );
|
|
521 |
|
|
522 |
BuildProfileNameItemL();
|
|
523 |
BuildProfileServerIdItemL();
|
|
524 |
BuildProfileServerPasswordItemL();
|
|
525 |
BuildProfileConnectionTypeItemL();
|
|
526 |
BuildProfileAccessPointItemL();
|
|
527 |
BuildProfileUrlItemL();
|
|
528 |
BuildProfilePortItemL();
|
|
529 |
BuildProfileUserNameandPassWordItemL();
|
|
530 |
BuildProfileActiveAcceptedItemL();
|
|
531 |
BuildProfileHttpsUsedItemL();
|
|
532 |
BuildProfileHttpsUserNameAndPasswordItemL();
|
|
533 |
|
|
534 |
// Close profile
|
|
535 |
iSyncAppEngine->CloseProfile();
|
|
536 |
|
|
537 |
AddProfileListItemL( iProfileListBox, iProfileList );
|
|
538 |
CleanupStack::PopAndDestroy( items );
|
|
539 |
}
|
|
540 |
|
|
541 |
|
|
542 |
// -----------------------------------------------------------------------------
|
|
543 |
// void CNSmlDMDlgProfileView::SaveProfileL
|
|
544 |
// -----------------------------------------------------------------------------
|
|
545 |
//
|
|
546 |
void CNSmlDMDlgProfileView::SaveProfileL()
|
|
547 |
{
|
|
548 |
FLOG( "[OMADM] void CNSmlDMDlgProfileView::SaveProfileL:" );
|
|
549 |
|
|
550 |
TRAPD( err, iProfile = iSyncAppEngine->OpenProfileL( iProfileId, ESmlOpenReadWrite ) );
|
|
551 |
if( err != KErrNone )
|
|
552 |
{
|
|
553 |
FLOG( "[OMADM] err != KErrNone--problem in opening the profile" );
|
|
554 |
// Profile could not be opened for saving
|
|
555 |
iDoc->RefreshProfileListL();
|
|
556 |
iDoc->MoveIndexToProfile( iProfileId );
|
|
557 |
return;
|
|
558 |
}
|
|
559 |
|
|
560 |
// Server name
|
|
561 |
iProfile->SetNameL( Item(ENSmlProfileName)->Value()->Des() );
|
|
562 |
// Server Id
|
|
563 |
iProfile->SetServerIdL( Item(ENSmlServerId)->Value()->Des() );
|
|
564 |
// Server password
|
|
565 |
iProfile->SetServerPasswordL( Item(ENSmlProfileDMServerPassword)->iValue );
|
|
566 |
// connection type
|
|
567 |
iProfile->SetBearerTypeL( Item(ENSmlConnType)->iNumberData );
|
|
568 |
// Accesspoint
|
|
569 |
if ( Item(ENSmlAccessPoint)->iWapAPInUse )
|
|
570 |
{
|
|
571 |
// User has not edited accesspoint fiels so convert it back to iap
|
|
572 |
SetAccessPointInfoL( Item(ENSmlAccessPoint)->iNumberData );
|
|
573 |
}
|
|
574 |
iProfile->SetAccessPointL( Item(ENSmlAccessPoint)->iNumberData );
|
|
575 |
// Host address
|
|
576 |
TInt num = Item( ENSmlProfilePort )->iNumberData;
|
|
577 |
iProfile->SetHostAddressL( Item(ENSmlProfileURL)->Value()->Des(), num );
|
|
578 |
// User name
|
|
579 |
iProfile->SetUserNameL( Item(ENSmlUsername)->Value()->Des() );
|
|
580 |
// User password
|
|
581 |
iProfile->SetPasswordL( Item(ENSmlPassword)->iValue );
|
|
582 |
// Active profile
|
|
583 |
if (Item(ENSmlServerAlertAllowed)->iNumberData)
|
|
584 |
{
|
|
585 |
iProfile->SetSASyncStateL( ESASyncStateEnable );
|
|
586 |
}
|
|
587 |
else
|
|
588 |
{
|
|
589 |
iProfile->SetSASyncStateL( ESASyncStateDisable );
|
|
590 |
}
|
|
591 |
// Server alert allowed
|
|
592 |
if ( Item(ENSmlServerAlertAllowed)->iNumberData )
|
|
593 |
{
|
|
594 |
if ( !Item(ENSmlServerAccept)->iNumberData )
|
|
595 |
{
|
|
596 |
iProfile->SetSASyncStateL( ESASyncStateConfirm );
|
|
597 |
}
|
|
598 |
}
|
|
599 |
// Http authentication
|
|
600 |
iProfile->SetHttpUsedL( Item(ENSmlHttpsUsed)->iNumberData );
|
|
601 |
// http username
|
|
602 |
iProfile->SetHttpUserNameL( Item(ENSmlHttpsUsername)->Value()->Des() );
|
|
603 |
// http password
|
|
604 |
iProfile->SetHttpPasswordL( Item(ENSmlHttpsPassword)->iValue );
|
|
605 |
|
|
606 |
iProfile->SetCreatorId( KUidSmlSyncApp.iUid );
|
|
607 |
iProfileId = iProfile->ProfileId();
|
|
608 |
iProfile->SaveL();
|
|
609 |
iSyncAppEngine->CloseProfile();
|
|
610 |
|
|
611 |
iDoc->RefreshProfileListL();
|
|
612 |
iDoc->MoveIndexToProfile( iProfileId );
|
|
613 |
}
|
|
614 |
|
|
615 |
//-----------------------------------------------------------------------------
|
|
616 |
// CNSmlDMDlgProfileView::Item
|
|
617 |
//-----------------------------------------------------------------------------
|
|
618 |
//
|
|
619 |
CNSmlDMProfileData* CNSmlDMDlgProfileView::Item( TInt aItemId )
|
|
620 |
{
|
|
621 |
return iProfileList->At( aItemId );
|
|
622 |
}
|
|
623 |
|
|
624 |
// -----------------------------------------------------------------------------
|
|
625 |
// CNSmlDMDlgProfileView::CheckMandatoryFieldsL
|
|
626 |
// -----------------------------------------------------------------------------
|
|
627 |
//
|
|
628 |
TInt CNSmlDMDlgProfileView::CheckMandatoryFieldsL()
|
|
629 |
{
|
|
630 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::CheckMandatoryFieldsL:" );
|
|
631 |
|
|
632 |
TInt returnValue = KErrNotFound;
|
|
633 |
|
|
634 |
HBufC* emptyText =
|
|
635 |
iEikonEnv->AllocReadResourceLC( R_QTN_SML_SET_VAL_FIELD_NONE );
|
|
636 |
HBufC* emptyAddr =
|
|
637 |
iEikonEnv->AllocReadResourceLC( R_QTN_SML_SET_VAL_HOSTADDR_FIELD_NONE );
|
|
638 |
|
|
639 |
for ( TInt index = 0; index < iProfileList->Count(); index++ )
|
|
640 |
{
|
|
641 |
if ( Item(index)->iMandatory &&
|
|
642 |
( ( index == ENSmlServerId &&
|
|
643 |
Item(index)->Value()->Des() == emptyText->Des() ) ||
|
|
644 |
( index == ENSmlProfileURL &&
|
|
645 |
Item(index)->Value()->Des() == emptyAddr->Des() ) ||
|
|
646 |
( index == ENSmlUsername &&
|
|
647 |
Item(index)->Value()->Des() == emptyText->Des() ) ||
|
|
648 |
( Item(index)->Value()->Des().Length() == 0 ) ) )
|
|
649 |
{
|
|
650 |
returnValue = Item(index)->iIndex;
|
|
651 |
break;
|
|
652 |
}
|
|
653 |
}
|
|
654 |
if ( returnValue == KErrNotFound )
|
|
655 |
{
|
|
656 |
returnValue = CheckUniqueFieldsL();
|
|
657 |
}
|
|
658 |
CleanupStack::PopAndDestroy( emptyAddr );
|
|
659 |
CleanupStack::PopAndDestroy( emptyText );
|
|
660 |
return returnValue;
|
|
661 |
}
|
|
662 |
|
|
663 |
// -----------------------------------------------------------------------------
|
|
664 |
// CNSmlDMDlgProfileView::CheckUniqueFieldsL
|
|
665 |
// -----------------------------------------------------------------------------
|
|
666 |
//
|
|
667 |
TInt CNSmlDMDlgProfileView::CheckUniqueFieldsL()
|
|
668 |
{
|
|
669 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::CheckUniqueFieldsL:" );
|
|
670 |
|
|
671 |
TInt returnValue( KErrNotFound );
|
|
672 |
CNSmlDMProfileData* item = Item(ENSmlServerId);
|
|
673 |
|
|
674 |
if ( iServerIdChanged )
|
|
675 |
{
|
|
676 |
if ( iEditMode != ESmlEditProfile )
|
|
677 |
{
|
|
678 |
if ( iSyncAppEngine->ServerIdFoundL( item->Value()->Des(),
|
|
679 |
iProfileId ) )
|
|
680 |
{
|
|
681 |
returnValue = ENSmlServerId;
|
|
682 |
}
|
|
683 |
}
|
|
684 |
else if ( ( iEditMode == ESmlEditProfile ) &&
|
|
685 |
( item->Value()->Des() != item->iValue ) )
|
|
686 |
{
|
|
687 |
if ( iSyncAppEngine->ServerIdFoundL( item->Value()->Des(),
|
|
688 |
iProfileId ) )
|
|
689 |
{
|
|
690 |
returnValue = ENSmlServerId;
|
|
691 |
}
|
|
692 |
}
|
|
693 |
}
|
|
694 |
|
|
695 |
return returnValue;
|
|
696 |
}
|
|
697 |
|
|
698 |
// -----------------------------------------------------------------------------
|
|
699 |
// CNSmlDMDlgProfileView::PrepareToEditSettingItemL
|
|
700 |
// -----------------------------------------------------------------------------
|
|
701 |
//
|
|
702 |
TBool CNSmlDMDlgProfileView::PrepareToEditSettingItemL(
|
|
703 |
CNSmlDMProfileData& aItem )
|
|
704 |
{
|
|
705 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::PrepareToEditSettingItemL:" );
|
|
706 |
|
|
707 |
TInt prompt = WarnUserOfChangeL();
|
|
708 |
if ( prompt ) //show confirmation if needed
|
|
709 |
{
|
|
710 |
if ( !ShowConfirmationNoteL( prompt ) )
|
|
711 |
{
|
|
712 |
return EFalse;
|
|
713 |
}
|
|
714 |
}
|
|
715 |
switch ( aItem.iItemType )
|
|
716 |
{
|
|
717 |
case CNSmlDMProfileData::ENSmlTypeIAP:
|
|
718 |
{
|
|
719 |
return EditSettingItemAccessPointL( aItem );
|
|
720 |
}
|
|
721 |
|
|
722 |
case CNSmlDMProfileData::ENSmlTypeText:
|
|
723 |
{
|
|
724 |
return EditSettingItemTextL( aItem );
|
|
725 |
}
|
|
726 |
|
|
727 |
case CNSmlDMProfileData::ENSmlTypeSecret:
|
|
728 |
{
|
|
729 |
return EditSettingItemSecretL( aItem );
|
|
730 |
}
|
|
731 |
|
|
732 |
case CNSmlDMProfileData::ENSmlTypeNumber:
|
|
733 |
{
|
|
734 |
return EditSettingItemNumberL( aItem );
|
|
735 |
}
|
|
736 |
|
|
737 |
case CNSmlDMProfileData::ENSmlTypeList:
|
|
738 |
{
|
|
739 |
return EditConnectionSettingItemL( aItem );
|
|
740 |
}
|
|
741 |
|
|
742 |
case CNSmlDMProfileData::ENSmlTypeListYesNo:
|
|
743 |
{
|
|
744 |
return EditSettingItemListYesNoL( aItem );
|
|
745 |
}
|
|
746 |
|
|
747 |
case CNSmlDMProfileData::ENSmlTypehttpListYesNo:
|
|
748 |
{
|
|
749 |
return EditHttpSettingItemListYesNoL( aItem );
|
|
750 |
}
|
|
751 |
|
|
752 |
case CNSmlDMProfileData::ENSmlTypeTime:
|
|
753 |
{
|
|
754 |
return EFalse;
|
|
755 |
}
|
|
756 |
}
|
|
757 |
return EFalse;
|
|
758 |
}
|
|
759 |
|
|
760 |
// -----------------------------------------------------------------------------
|
|
761 |
// CNSmlDMDlgProfileView::EditSettingItemTextL
|
|
762 |
// -----------------------------------------------------------------------------
|
|
763 |
//
|
|
764 |
TBool CNSmlDMDlgProfileView::EditSettingItemTextL( CNSmlDMProfileData& aItem )
|
|
765 |
{
|
|
766 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditSettingItemTextL:");
|
|
767 |
|
|
768 |
TBool retVal = EFalse;
|
|
769 |
TInt flags( CAknTextSettingPage::EZeroLengthAllowed );
|
|
770 |
if ( aItem.iMandatory )
|
|
771 |
{
|
|
772 |
flags = CAknTextSettingPage::EZeroLengthNotOffered;
|
|
773 |
}
|
|
774 |
|
|
775 |
HBufC* tmpBuf = HBufC::NewLC( aItem.iLength );
|
|
776 |
TPtr ptr( tmpBuf->Des() );
|
|
777 |
ptr.Zero();
|
|
778 |
//Language varaint error fix EPZO-6Y88F9
|
|
779 |
HBufC* emptyText =
|
|
780 |
iEikonEnv->AllocReadResourceLC( R_QTN_SML_SET_VAL_FIELD_NONE );
|
|
781 |
if ( aItem.Value()->Des() != emptyText->Des() )
|
|
782 |
{
|
|
783 |
ptr.Append( aItem.Value()->Des() );
|
|
784 |
}
|
|
785 |
//Language varaint error fix EPZO-6Y88F9
|
|
786 |
CAknTextSettingPage* dlg =
|
|
787 |
new (ELeave) CAknTextSettingPage( R_NSML_SETTINGS_TEXT, ptr, flags );
|
|
788 |
CleanupStack::PushL( dlg );
|
|
789 |
dlg->SetSettingTextL( aItem.Header()->Des() );
|
|
790 |
dlg->ConstructL();
|
|
791 |
dlg->TextControl()->SetTextLimit( aItem.iLength );
|
|
792 |
|
|
793 |
if ( aItem.iLatinInput )
|
|
794 |
{
|
|
795 |
dlg->TextControl()->SetAvkonWrap( ETrue );
|
|
796 |
dlg->TextControl()->SetAknEditorCase( EAknEditorLowerCase );
|
|
797 |
dlg->TextControl()->SetAknEditorFlags(
|
|
798 |
EAknEditorFlagNoT9 |
|
|
799 |
EAknEditorFlagLatinInputModesOnly );
|
|
800 |
}
|
|
801 |
CleanupStack::Pop( dlg );
|
|
802 |
|
|
803 |
if ( ( dlg->ExecuteLD ( CAknSettingPage::EUpdateWhenChanged ) ) &&
|
|
804 |
( aItem.Value()->Des() != ptr ) )
|
|
805 |
{//Fix for RKCC-7BC8Z2
|
|
806 |
if(aItem.iItemId== ENSmlProfileURL)
|
|
807 |
{ TBuf<255> tempBuf;
|
|
808 |
tempBuf.Zero();
|
|
809 |
_LIT(Kfslash ,"/");
|
|
810 |
for(TInt i= 0;i<ptr.Length();i++)
|
|
811 |
{ TChar ch = ptr[i];
|
|
812 |
TText* t = (TText*)ptr[i];
|
|
813 |
if( ptr[i] == '\\')
|
|
814 |
{
|
|
815 |
tempBuf.Append(Kfslash);
|
|
816 |
}
|
|
817 |
else
|
|
818 |
{
|
|
819 |
tempBuf.Append(ch);
|
|
820 |
}
|
|
821 |
}
|
|
822 |
if(tempBuf.Length())
|
|
823 |
{
|
|
824 |
ptr.Copy(tempBuf);
|
|
825 |
}
|
|
826 |
}
|
|
827 |
aItem.SetValue(ptr);
|
|
828 |
retVal = ETrue;
|
|
829 |
}
|
|
830 |
CleanupStack::PopAndDestroy( emptyText );
|
|
831 |
CleanupStack::PopAndDestroy( tmpBuf );
|
|
832 |
return retVal;
|
|
833 |
}
|
|
834 |
|
|
835 |
// -----------------------------------------------------------------------------
|
|
836 |
// CNSmlDMDlgProfileView::EditSettingItemSecretL
|
|
837 |
// -----------------------------------------------------------------------------
|
|
838 |
//
|
|
839 |
TBool CNSmlDMDlgProfileView::EditSettingItemSecretL( CNSmlDMProfileData& aItem )
|
|
840 |
{
|
|
841 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditSettingItemSecretL:" );
|
|
842 |
|
|
843 |
TBuf<KNSmlMaxTextLength128> buf;
|
|
844 |
CAknAlphaPasswordSettingPage* pwd =
|
|
845 |
new (ELeave) CAknAlphaPasswordSettingPage( R_SETTING_PASSWORD,
|
|
846 |
aItem.iValue,
|
|
847 |
aItem.iValue );
|
|
848 |
CleanupStack::PushL( pwd );
|
|
849 |
|
|
850 |
pwd->SetSettingTextL( aItem.Header()->Des() );
|
|
851 |
pwd->ConstructL();
|
|
852 |
pwd->AlphaPasswordEditor()->SetMaxLength( aItem.iLength );
|
|
853 |
//pwd->AlphaPasswordEditor()->RevealSecretText( ETrue );
|
|
854 |
|
|
855 |
CleanupStack::Pop( pwd );
|
|
856 |
if ( pwd->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) )
|
|
857 |
{
|
|
858 |
buf.Fill('*', 4 );
|
|
859 |
aItem.SetValue( buf ); //the real value backed up
|
|
860 |
return ETrue;
|
|
861 |
}
|
|
862 |
return EFalse;
|
|
863 |
}
|
|
864 |
|
|
865 |
// -----------------------------------------------------------------------------
|
|
866 |
// CNSmlDMDlgProfileView::EditSettingItemNumberL
|
|
867 |
// -----------------------------------------------------------------------------
|
|
868 |
//
|
|
869 |
TBool CNSmlDMDlgProfileView::EditSettingItemNumberL( CNSmlDMProfileData& aItem )
|
|
870 |
{
|
|
871 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditSettingItemNumberL:" );
|
|
872 |
|
|
873 |
CAknIntegerSettingPage * dlg =
|
|
874 |
new (ELeave) CAknIntegerSettingPage(
|
|
875 |
R_SETTINGS_NUMBER,
|
|
876 |
aItem.iNumberData,
|
|
877 |
CAknIntegerSettingPage::EInvalidValueNotOffered) ;
|
|
878 |
CleanupStack::PushL( dlg );
|
|
879 |
dlg->SetSettingTextL( aItem.Header()->Des() );
|
|
880 |
dlg->ConstructL();
|
|
881 |
dlg->IntegerEditorControl()->SetAknEditorNumericKeymap(
|
|
882 |
EAknEditorPlainNumberModeKeymap );
|
|
883 |
if ( aItem.iLatinInput )
|
|
884 |
{
|
|
885 |
|
|
886 |
dlg->IntegerEditorControl()->SetAknEditorFlags( EAknEditorFlagLatinInputModesOnly );
|
|
887 |
|
|
888 |
dlg->IntegerEditorControl()->SetValueL( aItem.iNumberData );
|
|
889 |
|
|
890 |
}
|
|
891 |
CleanupStack::Pop( dlg );
|
|
892 |
|
|
893 |
if ( dlg->ExecuteLD( CAknIntegerSettingPage::EUpdateWhenChanged ) )
|
|
894 |
{
|
|
895 |
aItem.SetValue( aItem.iNumberData );
|
|
896 |
return ETrue;
|
|
897 |
}
|
|
898 |
return EFalse;
|
|
899 |
}
|
|
900 |
|
|
901 |
// -----------------------------------------------------------------------------
|
|
902 |
// CNSmlDMDlgProfileView::EditSettingItemListL
|
|
903 |
// -----------------------------------------------------------------------------
|
|
904 |
//
|
|
905 |
TBool CNSmlDMDlgProfileView::EditSettingItemListL( CNSmlDMProfileData& aItem )
|
|
906 |
{
|
|
907 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditSettingItemListL:" );
|
|
908 |
|
|
909 |
TInt curSelection(aItem.iNumberData );
|
|
910 |
CDesCArray* stringData = iEikonEnv->ReadDesCArrayResourceL(aItem.iResource);
|
|
911 |
CleanupStack::PushL( stringData );
|
|
912 |
|
|
913 |
CAknRadioButtonSettingPage* dlg =
|
|
914 |
new (ELeave) CAknRadioButtonSettingPage( R_SETTINGS_RADIO,
|
|
915 |
curSelection,
|
|
916 |
stringData );
|
|
917 |
CleanupStack::PushL( dlg );
|
|
918 |
dlg->SetSettingTextL( aItem.Header()->Des() );
|
|
919 |
CleanupStack::Pop( dlg );
|
|
920 |
if ( dlg->ExecuteLD() )
|
|
921 |
{
|
|
922 |
aItem.iNumberData = curSelection;
|
|
923 |
if ( aItem.iItemType == CNSmlDMProfileData::ENSmlTypehttpListYesNo )
|
|
924 |
{
|
|
925 |
if ( aItem.iNumberData == 1 )
|
|
926 |
{
|
|
927 |
Item( ENSmlHttpsUsername )->iHidden = EFalse;
|
|
928 |
Item( ENSmlHttpsPassword )->iHidden = EFalse;
|
|
929 |
}
|
|
930 |
else
|
|
931 |
{
|
|
932 |
Item( ENSmlHttpsUsername )->iHidden = ETrue;
|
|
933 |
Item( ENSmlHttpsPassword )->iHidden = ETrue;
|
|
934 |
}
|
|
935 |
}
|
|
936 |
aItem.SetValue( (*stringData)[curSelection] );
|
|
937 |
CleanupStack::PopAndDestroy(stringData);
|
|
938 |
return ETrue;
|
|
939 |
}
|
|
940 |
CleanupStack::PopAndDestroy(stringData);
|
|
941 |
return EFalse;
|
|
942 |
}
|
|
943 |
|
|
944 |
// -----------------------------------------------------------------------------
|
|
945 |
// CNSmlDMDlgProfileView::EditSettingItemAccessPointL
|
|
946 |
// -----------------------------------------------------------------------------
|
|
947 |
//
|
|
948 |
TBool CNSmlDMDlgProfileView::EditSettingItemAccessPointL(
|
|
949 |
CNSmlDMProfileData& aItem )
|
|
950 |
{
|
|
951 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditSettingItemAccessPointL:" );
|
|
952 |
|
|
953 |
TInt curSelection(ENsmlDefaultConnection);
|
|
954 |
if(aItem.iNumberData == KErrGeneral || aItem.iNumberData == KErrNotFound ) //default conenction
|
|
955 |
{
|
|
956 |
curSelection = ENsmlDefaultConnection;
|
|
957 |
}
|
|
958 |
else
|
|
959 |
{
|
|
960 |
curSelection = ENsmlIap;
|
|
961 |
}
|
|
962 |
|
|
963 |
HBufC* destName = StringLoader::LoadLC(
|
|
964 |
R_CMMANAGERUI_SETT_DEFAULT_CONNECTION);
|
|
965 |
HBufC* userdef = StringLoader::LoadLC(
|
|
966 |
R_CMMANAGERUI_SETT_USER_DEFINED);
|
|
967 |
HBufC* title = StringLoader::LoadLC(
|
|
968 |
R_CMMANAGERUI_SETT_DESTINATION);
|
|
969 |
|
|
970 |
CDesCArrayFlat* stringData = new (ELeave) CDesCArrayFlat( 2 );
|
|
971 |
CleanupStack::PushL( stringData );
|
|
972 |
stringData->AppendL(destName->Des());
|
|
973 |
stringData->AppendL(userdef->Des());
|
|
974 |
|
|
975 |
CAknRadioButtonSettingPage* dlg =
|
|
976 |
new (ELeave) CAknRadioButtonSettingPage( R_SETTINGS_RADIO,
|
|
977 |
curSelection,
|
|
978 |
stringData );
|
|
979 |
CleanupStack::PushL( dlg );
|
|
980 |
dlg->SetSettingTextL( title->Des() );
|
|
981 |
CleanupStack::Pop( dlg );
|
|
982 |
|
|
983 |
TInt ret = dlg->ExecuteLD();
|
|
984 |
|
|
985 |
TUint32 currentAccesspoint(0);
|
|
986 |
if ( !ret )
|
|
987 |
{
|
|
988 |
CleanupStack::PopAndDestroy(4);
|
|
989 |
return EFalse; // user canceled "Always ask" dialog
|
|
990 |
}
|
|
991 |
if(curSelection == ENsmlDefaultConnection || curSelection == ENsmlAlwaysAsk )
|
|
992 |
{
|
|
993 |
aItem.SetValue( destName->Des() );
|
|
994 |
aItem.iNumberData = KErrGeneral;
|
|
995 |
CleanupStack::PopAndDestroy(4);
|
|
996 |
return ETrue; // user selected "default connection" option
|
|
997 |
}
|
|
998 |
else
|
|
999 |
{
|
|
1000 |
currentAccesspoint = aItem.iNumberData ;
|
|
1001 |
FTRACE( RDebug::Print(
|
|
1002 |
_L("[OMADM] CNSmlDMDlgProfileView::EditSettingItemAccessPointL: current ap (%d)"),
|
|
1003 |
currentAccesspoint ) );
|
|
1004 |
}
|
|
1005 |
TCmSettingSelection userSelection;
|
|
1006 |
userSelection.iId = currentAccesspoint;
|
|
1007 |
userSelection.iResult = CMManager::EConnectionMethod;
|
|
1008 |
CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL();
|
|
1009 |
CleanupStack::PushL(settings);
|
|
1010 |
TUint listedItems = CMManager::EShowConnectionMethods;
|
|
1011 |
TBearerFilterArray filter;
|
|
1012 |
TBool selected = settings->RunApplicationSettingsL(userSelection,
|
|
1013 |
listedItems,
|
|
1014 |
filter);
|
|
1015 |
CleanupStack::PopAndDestroy(settings);
|
|
1016 |
if (selected) {
|
|
1017 |
switch (userSelection.iResult)
|
|
1018 |
{
|
|
1019 |
case CMManager::EConnectionMethod:
|
|
1020 |
{
|
|
1021 |
|
|
1022 |
SetAccessPointInfoL( userSelection.iId );
|
|
1023 |
break;
|
|
1024 |
}
|
|
1025 |
default:
|
|
1026 |
break;
|
|
1027 |
}
|
|
1028 |
}
|
|
1029 |
else
|
|
1030 |
{
|
|
1031 |
// Check end key handling etc?
|
|
1032 |
//Keep previous selection
|
|
1033 |
}
|
|
1034 |
CleanupStack::PopAndDestroy(4);
|
|
1035 |
return ETrue;
|
|
1036 |
}
|
|
1037 |
|
|
1038 |
// -----------------------------------------------------------------------------
|
|
1039 |
// CNSmlDMDlgProfileView::SetAccessPointInfoL
|
|
1040 |
// -----------------------------------------------------------------------------
|
|
1041 |
//
|
|
1042 |
void CNSmlDMDlgProfileView::SetAccessPointInfoL( TUint aId )
|
|
1043 |
{
|
|
1044 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::SetAccessPointInfoL:");
|
|
1045 |
TBool retValue( EFalse );
|
|
1046 |
RCmManager cmManager;
|
|
1047 |
cmManager.OpenLC();
|
|
1048 |
RCmConnectionMethod conn;
|
|
1049 |
TRAPD(err, conn = cmManager.ConnectionMethodL( aId ));
|
|
1050 |
if(err == KErrNone)//connection method exists
|
|
1051 |
retValue = ETrue;
|
|
1052 |
|
|
1053 |
if (retValue )
|
|
1054 |
{
|
|
1055 |
CleanupClosePushL( conn );
|
|
1056 |
HBufC* name = conn.GetStringAttributeL( CMManager::ECmName );
|
|
1057 |
Item( ENSmlAccessPoint )->SetValue( *name );
|
|
1058 |
delete name;
|
|
1059 |
CleanupStack::PopAndDestroy( 1 ); // conn
|
|
1060 |
Item( ENSmlAccessPoint )->iNumberData = aId;
|
|
1061 |
Item( ENSmlAccessPoint )->iWapAPInUse = EFalse;
|
|
1062 |
}
|
|
1063 |
else//connection method doesn't exist
|
|
1064 |
{
|
|
1065 |
HBufC* emptyText =
|
|
1066 |
iEikonEnv->AllocReadResourceLC(R_CMMANAGERUI_SETT_DEFAULT_CONNECTION);
|
|
1067 |
Item( ENSmlAccessPoint )->SetValue( emptyText->Des() );
|
|
1068 |
Item( ENSmlAccessPoint )->iNumberData = KErrNotFound;
|
|
1069 |
Item( ENSmlAccessPoint )->iWapAPInUse = EFalse;
|
|
1070 |
CleanupStack::PopAndDestroy(emptyText);
|
|
1071 |
}
|
|
1072 |
CleanupStack::PopAndDestroy( 1 ); //cmManager
|
|
1073 |
}
|
|
1074 |
|
|
1075 |
// -----------------------------------------------------------------------------
|
|
1076 |
// CNSmlDMDlgProfileView::GetAccessPointInfoL
|
|
1077 |
// -----------------------------------------------------------------------------
|
|
1078 |
//
|
|
1079 |
void CNSmlDMDlgProfileView::GetAccessPointInfoL( TInt aId )
|
|
1080 |
{
|
|
1081 |
FTRACE( RDebug::Print(
|
|
1082 |
_L("[OMADM] CNSmlDMDlgProfileView::GetAccessPointInfoL: aId (%d)"), aId));
|
|
1083 |
|
|
1084 |
TInt err = KErrNotFound;
|
|
1085 |
TBool apExists = EFalse;
|
|
1086 |
RCmManager cmManager;
|
|
1087 |
cmManager.OpenLC();
|
|
1088 |
RCmConnectionMethod conn;
|
|
1089 |
TRAP(err, conn = cmManager.ConnectionMethodL( aId ));
|
|
1090 |
if(err == KErrNone)//connection method exists
|
|
1091 |
{
|
|
1092 |
CleanupClosePushL( conn );
|
|
1093 |
apExists = ETrue;
|
|
1094 |
}
|
|
1095 |
if(!apExists || aId == KErrGeneral || aId == KErrNotFound )
|
|
1096 |
{
|
|
1097 |
HBufC* emptyText =
|
|
1098 |
iEikonEnv->AllocReadResourceLC(R_CMMANAGERUI_SETT_DEFAULT_CONNECTION);
|
|
1099 |
Item( ENSmlAccessPoint )->SetValue( emptyText->Des() );
|
|
1100 |
Item( ENSmlAccessPoint )->iNumberData = KErrGeneral;
|
|
1101 |
Item( ENSmlAccessPoint )->iWapAPInUse = EFalse;
|
|
1102 |
CleanupStack::PopAndDestroy( emptyText );
|
|
1103 |
if(err == KErrNone)//connection method exists
|
|
1104 |
{
|
|
1105 |
CleanupStack::PopAndDestroy( 2 );//conn, cmManager
|
|
1106 |
}
|
|
1107 |
else
|
|
1108 |
CleanupStack::PopAndDestroy( 1 );//cmManager
|
|
1109 |
return;
|
|
1110 |
}
|
|
1111 |
else
|
|
1112 |
{
|
|
1113 |
HBufC* name = conn.GetStringAttributeL( CMManager::ECmName );
|
|
1114 |
Item( ENSmlAccessPoint )->SetValue( *name );
|
|
1115 |
delete name;
|
|
1116 |
Item( ENSmlAccessPoint )->iNumberData = aId;
|
|
1117 |
Item( ENSmlAccessPoint )->iWapAPInUse = ETrue;
|
|
1118 |
}
|
|
1119 |
if(err == KErrNone)//connection method exists
|
|
1120 |
{
|
|
1121 |
CleanupStack::PopAndDestroy( 2 );//conn, cmManager
|
|
1122 |
}
|
|
1123 |
else
|
|
1124 |
CleanupStack::PopAndDestroy( 1 );
|
|
1125 |
|
|
1126 |
}
|
|
1127 |
|
|
1128 |
// -----------------------------------------------------------------------------
|
|
1129 |
// CNSmlDMDlgProfileView::EditSettingItemListYesNoL
|
|
1130 |
// -----------------------------------------------------------------------------
|
|
1131 |
//
|
|
1132 |
TBool CNSmlDMDlgProfileView::EditSettingItemListYesNoL(
|
|
1133 |
CNSmlDMProfileData& aItem )
|
|
1134 |
{
|
|
1135 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditSettingItemListYesNoL:");
|
|
1136 |
|
|
1137 |
CDesCArray* stringData =
|
|
1138 |
iEikonEnv->ReadDesCArrayResourceL( aItem.iResource );
|
|
1139 |
CleanupStack::PushL( stringData );
|
|
1140 |
|
|
1141 |
if ( aItem.iNumberData == 0 )
|
|
1142 |
{
|
|
1143 |
aItem.iNumberData = 1;
|
|
1144 |
}
|
|
1145 |
else
|
|
1146 |
{
|
|
1147 |
aItem.iNumberData = 0;
|
|
1148 |
}
|
|
1149 |
|
|
1150 |
aItem.SetValue( (*stringData)[aItem.iNumberData] );
|
|
1151 |
CleanupStack::PopAndDestroy( stringData );
|
|
1152 |
return ETrue;
|
|
1153 |
}
|
|
1154 |
|
|
1155 |
|
|
1156 |
// -----------------------------------------------------------------------------
|
|
1157 |
// CNSmlDMDlgProfileView::EditHttpSettingItemListYesNoL
|
|
1158 |
// -----------------------------------------------------------------------------
|
|
1159 |
//
|
|
1160 |
TBool CNSmlDMDlgProfileView::EditHttpSettingItemListYesNoL(
|
|
1161 |
CNSmlDMProfileData& aItem )
|
|
1162 |
{
|
|
1163 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditHttpSettingItemListYesNoL:" );
|
|
1164 |
|
|
1165 |
CDesCArray* stringData =
|
|
1166 |
iEikonEnv->ReadDesCArrayResourceL( aItem.iResource );
|
|
1167 |
CleanupStack::PushL( stringData );
|
|
1168 |
|
|
1169 |
if ( aItem.iNumberData == 0 )
|
|
1170 |
{
|
|
1171 |
aItem.iNumberData = 1;
|
|
1172 |
Item( ENSmlHttpsUsername )->iHidden = EFalse;
|
|
1173 |
Item( ENSmlHttpsPassword )->iHidden = EFalse;
|
|
1174 |
}
|
|
1175 |
else
|
|
1176 |
{
|
|
1177 |
aItem.iNumberData = 0;
|
|
1178 |
Item( ENSmlHttpsUsername )->iHidden = ETrue;
|
|
1179 |
Item( ENSmlHttpsPassword )->iHidden = ETrue;
|
|
1180 |
}
|
|
1181 |
|
|
1182 |
aItem.SetValue( (*stringData)[aItem.iNumberData] );
|
|
1183 |
CleanupStack::PopAndDestroy( stringData );
|
|
1184 |
return ETrue;
|
|
1185 |
}
|
|
1186 |
|
|
1187 |
// ---------------------------------------------------------------------------------------------------
|
|
1188 |
// CNSmlDMDlgProfileView::EditConnectionSettingItemL
|
|
1189 |
// This method gets called when stylus single clck or MSK pressed on session mode item
|
|
1190 |
// ---------------------------------------------------------------------------------------------------
|
|
1191 |
//
|
|
1192 |
TBool CNSmlDMDlgProfileView::EditConnectionSettingItemL(
|
|
1193 |
CNSmlDMProfileData& aItem )
|
|
1194 |
{
|
|
1195 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::EditConnectionSettingItemL:" );
|
|
1196 |
|
|
1197 |
CDesCArray* stringData =
|
|
1198 |
iEikonEnv->ReadDesCArrayResourceL( aItem.iResource );
|
|
1199 |
CleanupStack::PushL( stringData );
|
|
1200 |
TBool hidden = EFalse;
|
|
1201 |
//Value of the setting item gets changed between Internet & Bluetooth for single click or msk press
|
|
1202 |
//If any new session mode like USB(third item) is going to add, radio button setting page should pop up
|
|
1203 |
if ( aItem.iNumberData == EProfileInternet )
|
|
1204 |
{
|
|
1205 |
hidden = ETrue;
|
|
1206 |
aItem.iNumberData = EProfileObexBlueTooth;
|
|
1207 |
Item( ENSmlAccessPoint )->iHidden = ETrue;
|
|
1208 |
Item( ENSmlProfilePort )->iHidden = ETrue;
|
|
1209 |
Item( ENSmlHttpsUsed )->iHidden = ETrue;
|
|
1210 |
}
|
|
1211 |
else
|
|
1212 |
{
|
|
1213 |
hidden = EFalse;
|
|
1214 |
aItem.iNumberData = EProfileInternet;
|
|
1215 |
Item( ENSmlAccessPoint )->iHidden = EFalse;
|
|
1216 |
Item( ENSmlProfilePort )->iHidden = EFalse;
|
|
1217 |
Item( ENSmlHttpsUsed )->iHidden = EFalse;
|
|
1218 |
}
|
|
1219 |
|
|
1220 |
if(Item( ENSmlHttpsUsed )->iNumberData == 0 || hidden )
|
|
1221 |
{
|
|
1222 |
Item( ENSmlHttpsUsername )->iHidden = ETrue;
|
|
1223 |
Item( ENSmlHttpsPassword )->iHidden = ETrue;
|
|
1224 |
}
|
|
1225 |
else
|
|
1226 |
{
|
|
1227 |
Item( ENSmlHttpsUsername )->iHidden = EFalse;
|
|
1228 |
Item( ENSmlHttpsPassword )->iHidden = EFalse;
|
|
1229 |
}
|
|
1230 |
|
|
1231 |
aItem.SetValue( (*stringData)[aItem.iNumberData] );
|
|
1232 |
CleanupStack::PopAndDestroy( stringData );
|
|
1233 |
return ETrue;
|
|
1234 |
}
|
|
1235 |
|
|
1236 |
// -----------------------------------------------------------------------------
|
|
1237 |
// CNSmlDMDlgProfileView::SetSettingTitleL
|
|
1238 |
// -----------------------------------------------------------------------------
|
|
1239 |
//
|
|
1240 |
void CNSmlDMDlgProfileView::SetSettingTitleL()
|
|
1241 |
{
|
|
1242 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::SetSettingTitleL:" );
|
|
1243 |
|
|
1244 |
TBuf<KNSmlMaxTextLength128> title;
|
|
1245 |
StringLoader::Load( title, R_SML_SETTINGS_TITLE );
|
|
1246 |
CAknTitlePane* titlePane =
|
|
1247 |
(CAknTitlePane*) iAvkonAppUi->StatusPane()->ControlL(
|
|
1248 |
TUid::Uid( EEikStatusPaneUidTitle ) );
|
|
1249 |
titlePane->SetTextL( title );
|
|
1250 |
iNaviPane = ( CAknNavigationControlContainer* )
|
|
1251 |
iAvkonAppUi->StatusPane()->ControlL( TUid::Uid(EEikStatusPaneUidNavi) );
|
|
1252 |
iNaviPane->PushDefaultL();
|
|
1253 |
}
|
|
1254 |
|
|
1255 |
// -----------------------------------------------------------------------------
|
|
1256 |
// CNSmlDMDlgProfileView::ShowConfirmationNoteL
|
|
1257 |
// -----------------------------------------------------------------------------
|
|
1258 |
//
|
|
1259 |
TBool CNSmlDMDlgProfileView::ShowConfirmationNoteL(TInt aResource)
|
|
1260 |
{
|
|
1261 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::ShowConfirmationNoteL:" );
|
|
1262 |
|
|
1263 |
HBufC* label = iEikonEnv->AllocReadResourceLC( aResource );
|
|
1264 |
CAknQueryDialog* queryDialog = new (ELeave) CAknQueryDialog;
|
|
1265 |
TBool retVal = queryDialog->ExecuteLD( R_STARTQUERY_NOTE, label->Des() );
|
|
1266 |
CleanupStack::PopAndDestroy( label );
|
|
1267 |
return retVal;
|
|
1268 |
}
|
|
1269 |
|
|
1270 |
// -----------------------------------------------------------------------------
|
|
1271 |
// CNSmlDMDlgProfileView::WarnUserOfChangeL
|
|
1272 |
// -----------------------------------------------------------------------------
|
|
1273 |
//
|
|
1274 |
TInt CNSmlDMDlgProfileView::WarnUserOfChangeL()
|
|
1275 |
{
|
|
1276 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::WarnUserOfChangeL:" );
|
|
1277 |
|
|
1278 |
TInt prompt = KErrNone;
|
|
1279 |
if ( iProfileListBox->CurrentItemIndex() == ENSmlServerId )
|
|
1280 |
{
|
|
1281 |
HBufC* emptyText =
|
|
1282 |
iEikonEnv->AllocReadResourceLC( R_QTN_SML_SET_VAL_FIELD_NONE );
|
|
1283 |
if ( Item(ENSmlServerId)->Value()->Des() != emptyText->Des() )
|
|
1284 |
{
|
|
1285 |
prompt = R_QTN_DM_CONF_SET_SERVER_ID;
|
|
1286 |
}
|
|
1287 |
CleanupStack::PopAndDestroy( emptyText );
|
|
1288 |
}
|
|
1289 |
return prompt;
|
|
1290 |
}
|
|
1291 |
|
|
1292 |
// -----------------------------------------------------------------------------
|
|
1293 |
// CNSmlDMDlgProfileView::DoExitFromMenuL
|
|
1294 |
// -----------------------------------------------------------------------------
|
|
1295 |
//
|
|
1296 |
void CNSmlDMDlgProfileView::DoExitFromMenuL()
|
|
1297 |
{
|
|
1298 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::DoExitFromMenuL:" );
|
|
1299 |
|
|
1300 |
TInt retValue = CheckMandatoryFieldsL();
|
|
1301 |
if ( retValue >= KErrNone )
|
|
1302 |
{
|
|
1303 |
if ( !ShowConfirmationNoteL( R_NSML_SETTINGS_SAVE_ANYWAY ) )
|
|
1304 |
{
|
|
1305 |
return;
|
|
1306 |
}
|
|
1307 |
}
|
|
1308 |
((CNSmlDMSyncAppUi*)iDoc->AppUi())->ChangeViewL();
|
|
1309 |
((CNSmlDMSyncAppUi*)iDoc->AppUi())->DoExit();
|
|
1310 |
}
|
|
1311 |
|
|
1312 |
|
|
1313 |
|
|
1314 |
// -----------------------------------------------------------------------------
|
|
1315 |
// CNSmlDMDlgProfileView::GetHelpContext
|
|
1316 |
// -----------------------------------------------------------------------------
|
|
1317 |
//
|
|
1318 |
void CNSmlDMDlgProfileView::GetHelpContext(TCoeHelpContext& aContext) const
|
|
1319 |
{
|
|
1320 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::GetHelpContext:");
|
|
1321 |
|
|
1322 |
aContext.iMajor = KUidSmlSyncApp;
|
|
1323 |
aContext.iContext = KDM_HLP_SETTINGS;
|
|
1324 |
}
|
|
1325 |
|
|
1326 |
|
|
1327 |
|
|
1328 |
// -----------------------------------------------------------------------------
|
|
1329 |
// CNSmlDMDlgProfileView::BuildHeaders
|
|
1330 |
// -----------------------------------------------------------------------------
|
|
1331 |
//
|
|
1332 |
void CNSmlDMDlgProfileView::BuildHeaders( CDesCArray* aHeaders )
|
|
1333 |
{
|
|
1334 |
for ( TInt index = 0; index < iProfileList->Count(); index++ )
|
|
1335 |
{
|
|
1336 |
iProfileList->At(index)->SetHeader( (*aHeaders)[index] );
|
|
1337 |
}
|
|
1338 |
}
|
|
1339 |
// -----------------------------------------------------------------------------
|
|
1340 |
// CNSmlDMDlgProfileView::BuildItemIds
|
|
1341 |
// -----------------------------------------------------------------------------
|
|
1342 |
//
|
|
1343 |
void CNSmlDMDlgProfileView::BuildItemIds( )
|
|
1344 |
{
|
|
1345 |
for ( TInt index = 0; index < iProfileList->Count(); index++ )
|
|
1346 |
{
|
|
1347 |
iProfileList->At( index )->iItemId = index;
|
|
1348 |
}
|
|
1349 |
}
|
|
1350 |
|
|
1351 |
// -----------------------------------------------------------------------------
|
|
1352 |
// CNSmlDMDlgProfileView::BuildProfileNameItemL
|
|
1353 |
// -----------------------------------------------------------------------------
|
|
1354 |
//
|
|
1355 |
void CNSmlDMDlgProfileView::BuildProfileNameItemL()
|
|
1356 |
{
|
|
1357 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileNameItemL" );
|
|
1358 |
|
|
1359 |
CNSmlDMProfileData* item = Item(ENSmlProfileName);
|
|
1360 |
if ( EditMode() || CopyMode() )
|
|
1361 |
{
|
|
1362 |
TBuf<KNSmlMaxItemLength> buf;
|
|
1363 |
iProfile->GetName( buf );
|
|
1364 |
item->SetValue( buf );
|
|
1365 |
}
|
|
1366 |
//set default profile name if new or namelength is zero
|
|
1367 |
if ( ( iEditMode == ESmlNewProfile ) ||
|
|
1368 |
( item->Value()->Des().Length() == 0) )
|
|
1369 |
{
|
|
1370 |
item->SetValue( iDoc->GetNextProfileNameLC()->Des() );
|
|
1371 |
CleanupStack::PopAndDestroy();
|
|
1372 |
}
|
|
1373 |
item->iMandatory = ETrue;
|
|
1374 |
item->iLength = KNSmlMaxProfileNameLength;
|
|
1375 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeText;
|
|
1376 |
}
|
|
1377 |
|
|
1378 |
// -----------------------------------------------------------------------------
|
|
1379 |
// CNSmlDMDlgProfileView::BuildProfileServerIdItemL
|
|
1380 |
// -----------------------------------------------------------------------------
|
|
1381 |
//
|
|
1382 |
void CNSmlDMDlgProfileView::BuildProfileServerIdItemL()
|
|
1383 |
{
|
|
1384 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileServerIdItemL" );
|
|
1385 |
CNSmlDMProfileData* item = Item(ENSmlServerId);
|
|
1386 |
if ( EditMode() )
|
|
1387 |
{
|
|
1388 |
TBuf<KNSmlMaxItemLength> buf;
|
|
1389 |
iProfile->GetServerId( buf );
|
|
1390 |
if( buf.Length() > 0 )
|
|
1391 |
{
|
|
1392 |
item->SetValue( buf );
|
|
1393 |
}
|
|
1394 |
}
|
|
1395 |
else
|
|
1396 |
{
|
|
1397 |
HBufC* emptyText = iEikonEnv->AllocReadResourceLC(
|
|
1398 |
R_QTN_SML_SET_VAL_FIELD_NONE );
|
|
1399 |
item->SetValue( emptyText->Des() );
|
|
1400 |
CleanupStack::PopAndDestroy( emptyText );
|
|
1401 |
|
|
1402 |
}
|
|
1403 |
item->iMandatory = ETrue;
|
|
1404 |
item->iLength = KNSmlDmServerIdMaxLength;
|
|
1405 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeText;
|
|
1406 |
item->iLatinInput = ETrue;
|
|
1407 |
}
|
|
1408 |
|
|
1409 |
// -----------------------------------------------------------------------------
|
|
1410 |
// CNSmlDMDlgProfileView::BuildProfileServerPasswordItemL
|
|
1411 |
// -----------------------------------------------------------------------------
|
|
1412 |
//
|
|
1413 |
void CNSmlDMDlgProfileView::BuildProfileServerPasswordItemL()
|
|
1414 |
{
|
|
1415 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileServerPasswordItemL" );
|
|
1416 |
|
|
1417 |
TBuf<KNSmlMaxTextLength256> buf;
|
|
1418 |
CNSmlDMProfileData* item = Item(ENSmlProfileDMServerPassword);
|
|
1419 |
if ( EditMode() || CopyMode() )
|
|
1420 |
{
|
|
1421 |
TBuf<KNSmlMaxItemLength> buf;
|
|
1422 |
iProfile->GetServerPassword( buf );
|
|
1423 |
item->iValue.Copy( buf );
|
|
1424 |
}
|
|
1425 |
else
|
|
1426 |
{
|
|
1427 |
item->iValue = KNullDesC;
|
|
1428 |
}
|
|
1429 |
|
|
1430 |
buf.Fill('*', 4 );
|
|
1431 |
item->SetValue(buf);
|
|
1432 |
item->iLength = KNSmlMaxPasswordLength;
|
|
1433 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeSecret;
|
|
1434 |
}
|
|
1435 |
|
|
1436 |
// -----------------------------------------------------------------------------
|
|
1437 |
// CNSmlDMDlgProfileView::BuildProfileConnectionTypeItemL
|
|
1438 |
// -----------------------------------------------------------------------------
|
|
1439 |
//
|
|
1440 |
void CNSmlDMDlgProfileView::BuildProfileConnectionTypeItemL()
|
|
1441 |
{
|
|
1442 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileConnectionTypeItemL" );
|
|
1443 |
|
|
1444 |
CNSmlDMProfileData* item = Item(ENSmlConnType);
|
|
1445 |
if ( EditMode() || CopyMode() )
|
|
1446 |
{
|
|
1447 |
item->iNumberData = iProfile->BearerType();
|
|
1448 |
if ( ( item->iNumberData != EProfileObexBlueTooth ) &&
|
|
1449 |
( item->iNumberData != EProfileInternet ) )
|
|
1450 |
{
|
|
1451 |
//default to internet
|
|
1452 |
item->iNumberData = EProfileInternet;
|
|
1453 |
}
|
|
1454 |
}
|
|
1455 |
else
|
|
1456 |
{
|
|
1457 |
item->iNumberData = EProfileInternet;
|
|
1458 |
}
|
|
1459 |
CDesCArray* stringData =
|
|
1460 |
iEikonEnv->ReadDesCArrayResourceL(R_SML_BEARER_TYPE);
|
|
1461 |
CleanupStack::PushL( stringData );
|
|
1462 |
|
|
1463 |
if ( !FeatureManager::FeatureSupported( KFeatureIdSyncMlDmObex ) )
|
|
1464 |
{
|
|
1465 |
item->iHidden = ETrue;
|
|
1466 |
item->iNumberData = EProfileInternet;
|
|
1467 |
}
|
|
1468 |
|
|
1469 |
item->SetValue ( (*stringData)[item->iNumberData] );
|
|
1470 |
CleanupStack::PopAndDestroy( stringData );
|
|
1471 |
item->iResource = R_SML_BEARER_TYPE;
|
|
1472 |
item->iLength = 80;
|
|
1473 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeList;
|
|
1474 |
}
|
|
1475 |
|
|
1476 |
// -----------------------------------------------------------------------------
|
|
1477 |
// CNSmlDMDlgProfileView::BuildProfileAccessPointItemL
|
|
1478 |
// -----------------------------------------------------------------------------
|
|
1479 |
//
|
|
1480 |
void CNSmlDMDlgProfileView::BuildProfileAccessPointItemL()
|
|
1481 |
{
|
|
1482 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileAccessPointItemL" );
|
|
1483 |
|
|
1484 |
CNSmlDMProfileData* item = Item(ENSmlAccessPoint);
|
|
1485 |
item->iWapAPInUse = EFalse;
|
|
1486 |
if ( EditMode() || CopyMode() )
|
|
1487 |
{
|
|
1488 |
item->iNumberData = iProfile->AccessPointL();
|
|
1489 |
}
|
|
1490 |
else
|
|
1491 |
{
|
|
1492 |
item->iNumberData = KErrGeneral;
|
|
1493 |
}
|
|
1494 |
GetAccessPointInfoL( item->iNumberData );
|
|
1495 |
item->iLength = 0;
|
|
1496 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeIAP;
|
|
1497 |
item->iHidden = ( Item( ENSmlConnType )->iNumberData != EProfileInternet );
|
|
1498 |
}
|
|
1499 |
|
|
1500 |
// -----------------------------------------------------------------------------
|
|
1501 |
// CNSmlDMDlgProfileView::BuildProfileUrlItemL
|
|
1502 |
// -----------------------------------------------------------------------------
|
|
1503 |
//
|
|
1504 |
void CNSmlDMDlgProfileView::BuildProfileUrlItemL()
|
|
1505 |
{
|
|
1506 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileUrlItemL" );
|
|
1507 |
CNSmlDMProfileData* item = Item(ENSmlProfileURL);
|
|
1508 |
if ( EditMode() || CopyMode() )
|
|
1509 |
{
|
|
1510 |
iProfile->GetHostAddress( iBuf, item->iNumberData );
|
|
1511 |
if (iBuf.Length() > KNSmlMaxURLLength )
|
|
1512 |
{
|
|
1513 |
iBuf.SetLength(KNSmlMaxURLLength);
|
|
1514 |
}
|
|
1515 |
if( iBuf.Length() > 0 )
|
|
1516 |
{
|
|
1517 |
item->SetValue( iBuf );
|
|
1518 |
}
|
|
1519 |
}
|
|
1520 |
else
|
|
1521 |
{
|
|
1522 |
HBufC* emptyAddr = iEikonEnv->AllocReadResourceLC(
|
|
1523 |
R_QTN_SML_SET_VAL_HOSTADDR_FIELD_NONE );
|
|
1524 |
item->SetValue( emptyAddr->Des() );
|
|
1525 |
CleanupStack::PopAndDestroy(); //emptyAddr
|
|
1526 |
}
|
|
1527 |
item->iLength = KNSmlMaxURLLength;
|
|
1528 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeText;
|
|
1529 |
item->iLatinInput = ETrue;
|
|
1530 |
item->iMandatory = ETrue;
|
|
1531 |
}
|
|
1532 |
|
|
1533 |
// -----------------------------------------------------------------------------
|
|
1534 |
// CNSmlDMDlgProfileView::BuildProfilePortItemL
|
|
1535 |
// -----------------------------------------------------------------------------
|
|
1536 |
//
|
|
1537 |
void CNSmlDMDlgProfileView::BuildProfilePortItemL()
|
|
1538 |
{
|
|
1539 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfilePortItemL" );
|
|
1540 |
CNSmlDMProfileData* item = Item(ENSmlProfilePort);
|
|
1541 |
iProfile->GetHostAddress( iBuf, item->iNumberData );
|
|
1542 |
|
|
1543 |
if ( item->iNumberData <= KPortMaxSize && item->iNumberData >= KPortMinSize )
|
|
1544 |
{
|
|
1545 |
item->SetValue( item->iNumberData );
|
|
1546 |
}
|
|
1547 |
else
|
|
1548 |
{
|
|
1549 |
item->iNumberData = KDefaultHttpPort;
|
|
1550 |
item->SetValue( item->iNumberData );
|
|
1551 |
}
|
|
1552 |
|
|
1553 |
item->iLength = KBufSize16;
|
|
1554 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeNumber;
|
|
1555 |
item->iHidden = ( Item( ENSmlConnType )->iNumberData != EProfileInternet );
|
|
1556 |
item->iLatinInput = ETrue;
|
|
1557 |
}
|
|
1558 |
|
|
1559 |
// -----------------------------------------------------------------------------
|
|
1560 |
// CNSmlDMDlgProfileView::BuildProfileUserNameandPassWordItemL
|
|
1561 |
// -----------------------------------------------------------------------------
|
|
1562 |
//
|
|
1563 |
void CNSmlDMDlgProfileView::BuildProfileUserNameandPassWordItemL()
|
|
1564 |
{
|
|
1565 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileUserNameandPassWordItemL" );
|
|
1566 |
|
|
1567 |
CNSmlDMProfileData* item = Item(ENSmlUsername);
|
|
1568 |
HBufC* emptyText = iEikonEnv->AllocReadResourceLC(
|
|
1569 |
R_QTN_SML_SET_VAL_FIELD_NONE );
|
|
1570 |
item->SetValue( emptyText->Des() );
|
|
1571 |
CleanupStack::PopAndDestroy( emptyText );
|
|
1572 |
TBuf<KNSmlMaxTextLength256> buf;
|
|
1573 |
if ( EditMode() || CopyMode() )
|
|
1574 |
{
|
|
1575 |
iProfile->GetUserName( buf );
|
|
1576 |
if( buf.Length() > 0 )
|
|
1577 |
{
|
|
1578 |
item->SetValue( buf );
|
|
1579 |
}
|
|
1580 |
}
|
|
1581 |
item->iMandatory = ETrue;
|
|
1582 |
item->iLength = KNSmlMaxUsernameLength;
|
|
1583 |
item->iLatinInput = ETrue;
|
|
1584 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeText;
|
|
1585 |
|
|
1586 |
item = Item(ENSmlPassword);
|
|
1587 |
if ( EditMode() || CopyMode() )
|
|
1588 |
{
|
|
1589 |
TBuf<KNSmlMaxItemLength> buf;
|
|
1590 |
iProfile->GetPassword( buf );
|
|
1591 |
item->iValue.Copy( buf );
|
|
1592 |
}
|
|
1593 |
else
|
|
1594 |
{
|
|
1595 |
item->iValue = KNullDesC;
|
|
1596 |
}
|
|
1597 |
|
|
1598 |
buf.Fill('*', 4 ); //mask
|
|
1599 |
item->SetValue( buf );
|
|
1600 |
item->iLength = KNSmlMaxPasswordLength;
|
|
1601 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeSecret;
|
|
1602 |
}
|
|
1603 |
|
|
1604 |
// -----------------------------------------------------------------------------
|
|
1605 |
// CNSmlDMDlgProfileView::BuildProfileActiceAcceptedItemL
|
|
1606 |
// -----------------------------------------------------------------------------
|
|
1607 |
//
|
|
1608 |
void CNSmlDMDlgProfileView::BuildProfileActiveAcceptedItemL()
|
|
1609 |
{
|
|
1610 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileActiceAcceptedItemL" );
|
|
1611 |
|
|
1612 |
CNSmlDMProfileData* item = Item(ENSmlServerAlertAllowed);
|
|
1613 |
CDesCArray* stringData =
|
|
1614 |
iEikonEnv->ReadDesCArrayResourceL( R_NSML_YESNO_TYPE );
|
|
1615 |
CleanupStack::PushL( stringData );
|
|
1616 |
|
|
1617 |
if ( EditMode() || CopyMode() )
|
|
1618 |
{
|
|
1619 |
if ( iProfile->SASyncState() == ESASyncStateDisable)
|
|
1620 |
{
|
|
1621 |
item->iNumberData = EFalse;
|
|
1622 |
}
|
|
1623 |
else
|
|
1624 |
{
|
|
1625 |
item->iNumberData = ETrue;
|
|
1626 |
}
|
|
1627 |
}
|
|
1628 |
else
|
|
1629 |
{
|
|
1630 |
item->iNumberData = ETrue;
|
|
1631 |
}
|
|
1632 |
item->iResource = R_NSML_YESNO_TYPE;
|
|
1633 |
item->SetValue( (*stringData)[item->iNumberData] );
|
|
1634 |
item->iLength = 0;
|
|
1635 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeListYesNo;
|
|
1636 |
CleanupStack::PopAndDestroy( stringData );
|
|
1637 |
|
|
1638 |
item = Item(ENSmlServerAccept);
|
|
1639 |
if ( iDoc->SANSupport() )
|
|
1640 |
{
|
|
1641 |
item->iHidden = ETrue;
|
|
1642 |
return;
|
|
1643 |
}
|
|
1644 |
stringData = iEikonEnv->ReadDesCArrayResourceL( R_NSML_ACCEPT_YESNO_TYPE );
|
|
1645 |
CleanupStack::PushL( stringData );
|
|
1646 |
if ( EditMode() || CopyMode() )
|
|
1647 |
{
|
|
1648 |
if ( iProfile->SASyncState() != ESASyncStateEnable )
|
|
1649 |
{
|
|
1650 |
item->iNumberData = EFalse;
|
|
1651 |
}
|
|
1652 |
else
|
|
1653 |
{
|
|
1654 |
item->iNumberData = ETrue;
|
|
1655 |
}
|
|
1656 |
}
|
|
1657 |
else
|
|
1658 |
{
|
|
1659 |
item->iNumberData = EFalse;
|
|
1660 |
}
|
|
1661 |
item->iResource = R_NSML_ACCEPT_YESNO_TYPE;
|
|
1662 |
item->SetValue( (*stringData)[item->iNumberData] );
|
|
1663 |
item->iLength = 0;
|
|
1664 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeListYesNo;
|
|
1665 |
CleanupStack::PopAndDestroy( stringData );
|
|
1666 |
}
|
|
1667 |
|
|
1668 |
// -----------------------------------------------------------------------------
|
|
1669 |
// CNSmlDMDlgProfileView::BuildProfileHttpsUserNameAndPasswordItemL
|
|
1670 |
// -----------------------------------------------------------------------------
|
|
1671 |
//
|
|
1672 |
void CNSmlDMDlgProfileView::BuildProfileHttpsUserNameAndPasswordItemL()
|
|
1673 |
{
|
|
1674 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileHttpsUserNameAndPasswordItemL" );
|
|
1675 |
|
|
1676 |
CNSmlDMProfileData* item = Item( ENSmlHttpsUsername );
|
|
1677 |
HBufC* emptyText = iEikonEnv->AllocReadResourceLC(
|
|
1678 |
R_QTN_SML_SET_VAL_FIELD_NONE );
|
|
1679 |
item->SetValue( emptyText->Des() );
|
|
1680 |
CleanupStack::PopAndDestroy( emptyText );
|
|
1681 |
|
|
1682 |
TBuf<KNSmlMaxTextLength256> buf;
|
|
1683 |
if ( EditMode() || CopyMode() )
|
|
1684 |
{
|
|
1685 |
iProfile->GetHttpUserNameL( buf );
|
|
1686 |
if( buf.Length() > 0 )
|
|
1687 |
{
|
|
1688 |
item->SetValue( buf );
|
|
1689 |
}
|
|
1690 |
}
|
|
1691 |
item->iMandatory = ETrue;
|
|
1692 |
item->iLength = KNSmlMaxUsernameLength;
|
|
1693 |
item->iLatinInput = ETrue;
|
|
1694 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeText;
|
|
1695 |
if( !iProfile->HttpUsedL() || Item( ENSmlConnType )->iNumberData != EProfileInternet )
|
|
1696 |
{
|
|
1697 |
item->iHidden = ETrue;
|
|
1698 |
}
|
|
1699 |
|
|
1700 |
item = Item(ENSmlHttpsPassword);
|
|
1701 |
if ( EditMode() || CopyMode() )
|
|
1702 |
{
|
|
1703 |
TBuf<KNSmlMaxItemLength> buf;
|
|
1704 |
iProfile->GetHttpPasswordL( buf );
|
|
1705 |
item->iValue.Copy( buf );
|
|
1706 |
}
|
|
1707 |
else
|
|
1708 |
{
|
|
1709 |
item->iValue = KNullDesC;
|
|
1710 |
}
|
|
1711 |
|
|
1712 |
buf.Fill( '*', KNumberofCharacters ); //mask with 4 stars
|
|
1713 |
item->SetValue( buf );
|
|
1714 |
item->iLength = KNSmlMaxPasswordLength;
|
|
1715 |
item->iItemType = CNSmlDMProfileData::ENSmlTypeSecret;
|
|
1716 |
if( !iProfile->HttpUsedL() || Item( ENSmlConnType )->iNumberData != EProfileInternet )
|
|
1717 |
{
|
|
1718 |
item->iHidden = ETrue;
|
|
1719 |
}
|
|
1720 |
}
|
|
1721 |
|
|
1722 |
// -----------------------------------------------------------------------------
|
|
1723 |
// CNSmlDMDlgProfileView::BuildProfileHttpsUsedItemL
|
|
1724 |
// -----------------------------------------------------------------------------
|
|
1725 |
//
|
|
1726 |
void CNSmlDMDlgProfileView::BuildProfileHttpsUsedItemL()
|
|
1727 |
{
|
|
1728 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::BuildProfileHttpsUsedItemL" );
|
|
1729 |
|
|
1730 |
CNSmlDMProfileData* item = Item( ENSmlHttpsUsed );
|
|
1731 |
CDesCArray* stringData =
|
|
1732 |
iEikonEnv->ReadDesCArrayResourceL( R_NSML_HTTPS_ACTIVE_YESNO_TYPE );
|
|
1733 |
CleanupStack::PushL( stringData );
|
|
1734 |
if ( EditMode() || CopyMode() )
|
|
1735 |
{
|
|
1736 |
if ( iProfile->HttpUsedL() )
|
|
1737 |
{
|
|
1738 |
item->iNumberData = ETrue;
|
|
1739 |
}
|
|
1740 |
else
|
|
1741 |
{
|
|
1742 |
item->iNumberData = EFalse;
|
|
1743 |
}
|
|
1744 |
}
|
|
1745 |
else
|
|
1746 |
{
|
|
1747 |
item->iNumberData = EFalse;
|
|
1748 |
}
|
|
1749 |
item->iResource = R_NSML_HTTPS_ACTIVE_YESNO_TYPE;
|
|
1750 |
item->SetValue( (*stringData)[item->iNumberData] );
|
|
1751 |
item->iLength = 0;
|
|
1752 |
item->iItemType = CNSmlDMProfileData::ENSmlTypehttpListYesNo;
|
|
1753 |
item->iHidden = ( Item( ENSmlConnType )->iNumberData != EProfileInternet );
|
|
1754 |
CleanupStack::PopAndDestroy( stringData );
|
|
1755 |
}
|
|
1756 |
|
|
1757 |
// -----------------------------------------------------------------------------
|
|
1758 |
// CNSmlDMDlgProfileView::GetItemForIndex
|
|
1759 |
// -----------------------------------------------------------------------------
|
|
1760 |
//
|
|
1761 |
CNSmlDMProfileData* CNSmlDMDlgProfileView::GetItemForIndex( TInt aIndex )
|
|
1762 |
{
|
|
1763 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::GetItemForIndex:" );
|
|
1764 |
|
|
1765 |
TInt index = 0;
|
|
1766 |
while ( ( aIndex != IndexItem(index)->iIndex ) &&
|
|
1767 |
( index < iProfileList->Count() ) )
|
|
1768 |
{
|
|
1769 |
index++;
|
|
1770 |
}
|
|
1771 |
return (*iProfileList)[index];
|
|
1772 |
}
|
|
1773 |
|
|
1774 |
//-----------------------------------------------------------------------------
|
|
1775 |
// CNSmlDMDlgProfileView::IndexItem
|
|
1776 |
//-----------------------------------------------------------------------------
|
|
1777 |
//
|
|
1778 |
CNSmlDMProfileData* CNSmlDMDlgProfileView::IndexItem( TInt aItemId )
|
|
1779 |
{
|
|
1780 |
FLOG( "[OMADM] CNSmlDMDlgProfileView::Item:" );
|
|
1781 |
|
|
1782 |
CNSmlDMProfileData* item = NULL;
|
|
1783 |
TInt count = iProfileList->Count();
|
|
1784 |
for ( TInt index = 0; index < count; index++ )
|
|
1785 |
{
|
|
1786 |
CNSmlDMProfileData* temp = iProfileList->At(index);
|
|
1787 |
if ( temp->iItemId == aItemId )
|
|
1788 |
{
|
|
1789 |
item = temp;
|
|
1790 |
break;
|
|
1791 |
}
|
|
1792 |
}
|
|
1793 |
__ASSERT_DEBUG( item, TUtil::Panic( KErrGeneral ) );
|
|
1794 |
return item;
|
|
1795 |
}
|
|
1796 |
|
|
1797 |
//-----------------------------------------------------------------------------
|
|
1798 |
// CNSmlDMTextEditor::CNSmlDMTextEditor()
|
|
1799 |
//-----------------------------------------------------------------------------
|
|
1800 |
//
|
|
1801 |
CNSmlDMTextEditor::CNSmlDMTextEditor(TInt aResourceID,
|
|
1802 |
TDes& aText,
|
|
1803 |
TInt aTextSettingPageFlags)
|
|
1804 |
: CAknTextSettingPage(aResourceID, aText, aTextSettingPageFlags)
|
|
1805 |
{
|
|
1806 |
|
|
1807 |
}
|
|
1808 |
//-----------------------------------------------------------------------------
|
|
1809 |
// CNSmlDMTextEditor::OfferKeyEventL()
|
|
1810 |
//-----------------------------------------------------------------------------
|
|
1811 |
//
|
|
1812 |
TKeyResponse CNSmlDMTextEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent,
|
|
1813 |
TEventCode aType)
|
|
1814 |
{
|
|
1815 |
if(EKeyEnter == aKeyEvent.iCode)
|
|
1816 |
{
|
|
1817 |
ProcessCommandL(EAknSoftkeySelect);
|
|
1818 |
return EKeyWasConsumed;
|
|
1819 |
}
|
|
1820 |
return CAknTextSettingPage::OfferKeyEventL(aKeyEvent, aType);
|
|
1821 |
}
|
|
1822 |
//-----------------------------------------------------------------------------
|
|
1823 |
// CNSmlDMTextEditor::~CNSmlDMTextEditor()
|
|
1824 |
//-----------------------------------------------------------------------------
|
|
1825 |
//
|
|
1826 |
CNSmlDMTextEditor::~CNSmlDMTextEditor()
|
|
1827 |
{
|
|
1828 |
|
|
1829 |
}
|
|
1830 |
// End of File
|