25
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2005 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: View for the Barring folder
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "GSCellularCallBarringView.h" //for CGSSettListBarringView
|
|
21 |
#include "GSCellularCallBarringContainer.h"//for CGSBaseContainer
|
|
22 |
#include "GSPhoneSettingConstants.h" //for constant values
|
|
23 |
#include "GSCallBarringPlugin.h" //for plugin UID
|
|
24 |
#include "GsLogger.h"
|
|
25 |
#include "LocalViewIds.h" //for KTellBarringViewId
|
|
26 |
|
|
27 |
#include <gscommon.hrh>
|
|
28 |
#include <coeaui.h>
|
|
29 |
#include <hlplch.h> // For HlpLauncher
|
|
30 |
#include <e32base.h>
|
|
31 |
#include <featmgr.h>
|
|
32 |
#include <gscallbarringpluginrsc.rsg> //for resource IDs
|
|
33 |
#include <exterror.h> //for extended error codes
|
|
34 |
#include <StringLoader.h> //for StringLoader
|
|
35 |
#include <PsetContainer.h> //for CPsetContainer
|
|
36 |
#include <PsuiContainer.h> //for CPsuiContainer
|
|
37 |
#include <eikmenup.h> //for menu bar
|
|
38 |
#include <secuicodequerydialog.h>
|
|
39 |
#include <nwdefs.h>
|
|
40 |
#include <aknViewAppUi.h>
|
|
41 |
#include <gsfwviewuids.h>
|
|
42 |
#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
|
|
43 |
#include <spsettings.h>
|
|
44 |
#endif // __VOIP && RD_VOIP_REL_2_2
|
|
45 |
|
|
46 |
// ========================= MEMBER FUNCTIONS ================================
|
|
47 |
// ---------------------------------------------------------------------------
|
|
48 |
//
|
|
49 |
// C++ constructor.
|
|
50 |
//
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
CGSSettListBarringView::CGSSettListBarringView()
|
|
53 |
{
|
|
54 |
}
|
|
55 |
|
|
56 |
// ---------------------------------------------------------------------------
|
|
57 |
//
|
|
58 |
// Symbian OS two-phased constructor (second phase)
|
|
59 |
//
|
|
60 |
// ---------------------------------------------------------------------------
|
|
61 |
void CGSSettListBarringView::ConstructL()
|
|
62 |
{
|
|
63 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::ConstructL");
|
|
64 |
BaseConstructL( R_GS_BARRING_VIEW );
|
|
65 |
|
|
66 |
iSettings = CPsetContainer::NewL();
|
|
67 |
iObsContainer = CPsuiContainer::NewL();
|
|
68 |
iCbObserver = iObsContainer->CreateCBObsL();
|
|
69 |
iBarring = iSettings->CreateCBObjectL( *iCbObserver );
|
|
70 |
iRockerPress = EFalse;
|
|
71 |
iContextMenuInitialized = EFalse;
|
|
72 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::ConstructL");
|
|
73 |
}
|
|
74 |
|
|
75 |
|
|
76 |
// ---------------------------------------------------------------------------
|
|
77 |
// CGSSettListBarringView::NewL()
|
|
78 |
// Symbian OS two-phased constructor
|
|
79 |
//
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
CGSSettListBarringView* CGSSettListBarringView::NewL()
|
|
82 |
{
|
|
83 |
CGSSettListBarringView* self = NewLC();
|
|
84 |
CleanupStack::Pop( self );
|
|
85 |
return self;
|
|
86 |
}
|
|
87 |
|
|
88 |
|
|
89 |
// ---------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
// Symbian OS two-phased constructor (first phase)
|
|
92 |
//
|
|
93 |
// ---------------------------------------------------------------------------
|
|
94 |
CGSSettListBarringView* CGSSettListBarringView::NewLC()
|
|
95 |
{
|
|
96 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::NewLC");
|
|
97 |
CGSSettListBarringView* self = new ( ELeave ) CGSSettListBarringView;
|
|
98 |
CleanupStack::PushL( self );
|
|
99 |
self->ConstructL();
|
|
100 |
|
|
101 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::NewLC");
|
|
102 |
return self;
|
|
103 |
}
|
|
104 |
|
|
105 |
// ---------------------------------------------------------------------------
|
|
106 |
//
|
|
107 |
// C++ destructor
|
|
108 |
//
|
|
109 |
// ---------------------------------------------------------------------------
|
|
110 |
CGSSettListBarringView::~CGSSettListBarringView()
|
|
111 |
{
|
|
112 |
delete iBarring;
|
|
113 |
delete iSettings;
|
|
114 |
delete iObsContainer;
|
|
115 |
delete iCbObserver;
|
|
116 |
iRockerPress = EFalse;
|
|
117 |
|
|
118 |
}
|
|
119 |
|
|
120 |
// ---------------------------------------------------------------------------
|
|
121 |
//
|
|
122 |
// Returns Id of the Barring view.
|
|
123 |
//
|
|
124 |
// ---------------------------------------------------------------------------
|
|
125 |
TUid CGSSettListBarringView::Id() const
|
|
126 |
{
|
|
127 |
return KCallBarringViewId;
|
|
128 |
}
|
|
129 |
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
//
|
|
132 |
// Handles other than list box events.
|
|
133 |
//
|
|
134 |
// ---------------------------------------------------------------------------
|
|
135 |
void CGSSettListBarringView::HandleCommandL( TInt aCommand )
|
|
136 |
{
|
|
137 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleCommandL");
|
|
138 |
iRockerPress = EFalse;
|
|
139 |
|
|
140 |
TCallBarringSetting barringSetting;
|
|
141 |
iCurrentItem = iContainer->iListBox->CurrentItemIndex();
|
|
142 |
SetBarringType(
|
|
143 |
aCommand,
|
|
144 |
barringSetting,
|
|
145 |
static_cast <TGSBarringSetting> (iCurrentItem) );
|
|
146 |
#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
|
|
147 |
CSPSettings* spSettings = CSPSettings::NewL();
|
|
148 |
TBool showVoipFeatures( EFalse );
|
|
149 |
if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
|
|
150 |
spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
|
|
151 |
{
|
|
152 |
showVoipFeatures = ETrue;
|
|
153 |
}
|
|
154 |
#endif // __VOIP && RD_VOIP_REL_2_2
|
|
155 |
|
|
156 |
switch ( aCommand )
|
|
157 |
{
|
|
158 |
case EGSCmdAppChange:
|
|
159 |
iRockerPress = EFalse;
|
|
160 |
HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed );
|
|
161 |
break;
|
|
162 |
case EAknSoftkeyBack:
|
|
163 |
#if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
|
|
164 |
if ( showVoipFeatures )
|
|
165 |
{
|
|
166 |
iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
|
|
167 |
}
|
|
168 |
else
|
|
169 |
{
|
|
170 |
iAppUi->ActivateLocalViewL( KGSTelPluginUid );
|
|
171 |
}
|
|
172 |
#else // __VOIP && RD_VOIP_REL_2_2
|
|
173 |
if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
|
|
174 |
{
|
|
175 |
iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
|
|
176 |
}
|
|
177 |
else
|
|
178 |
{
|
|
179 |
iAppUi->ActivateLocalViewL( KGSTelPluginUid );
|
|
180 |
}
|
|
181 |
#endif // __VOIP && RD_VOIP_REL_2_2
|
|
182 |
break;
|
|
183 |
case EGSCmdBarringActivate:
|
|
184 |
barringSetting.iSetting = EActivateBarring;
|
|
185 |
HandleBarringOperationL( barringSetting, EAllTeleAndBearer );
|
|
186 |
break;
|
|
187 |
case EGSCmdBarringCancel:
|
|
188 |
barringSetting.iSetting = ECancelBarring;
|
|
189 |
HandleBarringOperationL( barringSetting, EAllTeleAndBearer );
|
|
190 |
break;
|
|
191 |
case EGSCmdBarringInquiry:
|
|
192 |
iBarring->GetBarringStatusL( EServiceGroupVoice,
|
|
193 |
barringSetting.iType );
|
|
194 |
break;
|
|
195 |
case EGSCmdBarringChangePwd:
|
|
196 |
ChangeBarringPwdL();
|
|
197 |
break;
|
|
198 |
case EGSCmdBarringCancelAll:
|
|
199 |
CancelAllBarringsL();
|
|
200 |
break;
|
|
201 |
case EAknCmdHelp:
|
|
202 |
{
|
|
203 |
if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
204 |
{
|
|
205 |
HlpLauncher::LaunchHelpApplicationL(
|
|
206 |
iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
|
|
207 |
}
|
|
208 |
break;
|
|
209 |
}
|
|
210 |
default:
|
|
211 |
iAppUi->HandleCommandL( aCommand );
|
|
212 |
break;
|
|
213 |
}
|
|
214 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleCommandL");
|
|
215 |
}
|
|
216 |
|
|
217 |
// ---------------------------------------------------------------------------
|
|
218 |
//
|
|
219 |
// Activates view.
|
|
220 |
//
|
|
221 |
// ---------------------------------------------------------------------------
|
|
222 |
void CGSSettListBarringView::DoActivateL( const TVwsViewId& aPrevViewId,
|
|
223 |
TUid aCustomMessageId,
|
|
224 |
const TDesC8& aCustomMessage )
|
|
225 |
{
|
|
226 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::DoActivateL");
|
|
227 |
CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId,
|
|
228 |
aCustomMessage );
|
|
229 |
|
|
230 |
iContainer->iListBox->SetTopItemIndex(iTopItemIndex);
|
|
231 |
|
|
232 |
if (iCurrentItem >= 0 &&
|
|
233 |
iCurrentItem < iContainer->iListBox->Model()->NumberOfItems())
|
|
234 |
{
|
|
235 |
iContainer->iListBox->SetCurrentItemIndexAndDraw(iCurrentItem);
|
|
236 |
}
|
|
237 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::DoActivateL");
|
|
238 |
}
|
|
239 |
|
|
240 |
// ---------------------------------------------------------------------------
|
|
241 |
//
|
|
242 |
// Deactivates view.
|
|
243 |
//
|
|
244 |
// ---------------------------------------------------------------------------
|
|
245 |
void CGSSettListBarringView::DoDeactivate()
|
|
246 |
{
|
|
247 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::DoDeactivate");
|
|
248 |
if ( iContainer )
|
|
249 |
{
|
|
250 |
iCurrentItem = iContainer->iListBox->CurrentItemIndex();
|
|
251 |
iTopItemIndex = iContainer->iListBox->TopItemIndex();
|
|
252 |
|
|
253 |
iAppUi->RemoveFromViewStack( *this, iContainer );
|
|
254 |
delete iContainer;
|
|
255 |
iContainer = NULL;
|
|
256 |
}
|
|
257 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::DoDeactivate");
|
|
258 |
}
|
|
259 |
|
|
260 |
|
|
261 |
// -----------------------------------------------------------------------------
|
|
262 |
// CGSSettListBarringView::ProcessCommandL
|
|
263 |
// -----------------------------------------------------------------------------
|
|
264 |
void CGSSettListBarringView::ProcessCommandL( TInt aCommand )
|
|
265 |
{
|
|
266 |
// Context menu is needed to be initialized only if selection key
|
|
267 |
// is pressed. Initialization need to be performed only once.
|
|
268 |
if( aCommand == EAknSoftkeyContextOptions &&
|
|
269 |
!iContextMenuInitialized )
|
|
270 |
{
|
|
271 |
MenuBar()->SetContextMenuTitleResourceId(
|
|
272 |
R_CALL_BARRING_MSK_CONTEXTMENUBAR );
|
|
273 |
iContextMenuInitialized = ETrue;
|
|
274 |
}
|
|
275 |
|
|
276 |
// Call base class
|
|
277 |
CAknView::ProcessCommandL( aCommand );
|
|
278 |
}
|
|
279 |
// ---------------------------------------------------------------------------
|
|
280 |
//
|
|
281 |
// Before showing a options menu, delete options key specific settings if
|
|
282 |
// rocker key has been pressed.
|
|
283 |
// ---------------------------------------------------------------------------
|
|
284 |
//
|
|
285 |
void CGSSettListBarringView::DynInitMenuPaneL( TInt aResourceId,
|
|
286 |
CEikMenuPane* aMenuPane )
|
|
287 |
{
|
|
288 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::DynInitMenuPaneL");
|
|
289 |
CEikMenuBar* menuBar = MenuBar();
|
|
290 |
// show or hide the 'help' menu item when supported
|
|
291 |
if( aResourceId == R_GS_MENU_ITEM_HELP )
|
|
292 |
{
|
|
293 |
if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
294 |
{
|
|
295 |
aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
|
|
296 |
}
|
|
297 |
else
|
|
298 |
{
|
|
299 |
aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
|
|
300 |
}
|
|
301 |
}
|
|
302 |
|
|
303 |
if ( iRockerPress )
|
|
304 |
{
|
|
305 |
// always hide 'help' & 'exit' menu items when rocker key is pressed
|
|
306 |
if( aResourceId == R_GS_MENU_ITEM_EXIT )
|
|
307 |
{
|
|
308 |
aMenuPane->SetItemDimmed( EAknCmdExit, ETrue );
|
|
309 |
}
|
|
310 |
else if ( aResourceId == R_GS_MENU_ITEM_HELP )
|
|
311 |
{
|
|
312 |
aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
|
|
313 |
}
|
|
314 |
else if ( aResourceId == R_GS_BARRING_VIEW_MENU )
|
|
315 |
{
|
|
316 |
// these options are not initialized in restricted call barring
|
|
317 |
if ( !FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
|
|
318 |
{
|
|
319 |
aMenuPane->SetItemDimmed( EGSCmdBarringCancelAll, ETrue );
|
|
320 |
aMenuPane->SetItemDimmed( EGSCmdBarringChangePwd, ETrue );
|
|
321 |
}
|
|
322 |
}
|
|
323 |
}
|
|
324 |
else if (aResourceId == R_GS_BARRING_VIEW_MENU)
|
|
325 |
{
|
|
326 |
if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType()
|
|
327 |
== CEikMenuBar::EMenuOptions)
|
|
328 |
{
|
|
329 |
aMenuPane->SetItemDimmed(EGSCmdBarringActivate, ETrue);
|
|
330 |
aMenuPane->SetItemDimmed(EGSCmdBarringCancel, ETrue);
|
|
331 |
aMenuPane->SetItemDimmed(EGSCmdBarringInquiry, ETrue);
|
|
332 |
}
|
|
333 |
}
|
|
334 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::DynInitMenuPaneL");
|
|
335 |
}
|
|
336 |
|
|
337 |
// ---------------------------------------------------------------------------
|
|
338 |
//
|
|
339 |
// Queries password from the user.
|
|
340 |
//
|
|
341 |
// ---------------------------------------------------------------------------
|
|
342 |
//
|
|
343 |
TInt CGSSettListBarringView::BarringPasswordQueryL(
|
|
344 |
TBarringPassword& aBarringPassword,
|
|
345 |
const TInt& aTitleID )
|
|
346 |
{
|
|
347 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::BarringPasswordQueryL");
|
|
348 |
TBool continueLoop = ETrue;
|
|
349 |
|
|
350 |
while ( continueLoop )
|
|
351 |
{
|
|
352 |
aBarringPassword = KNullDesC;
|
|
353 |
CCodeQueryDialog* dlg = new (ELeave)
|
|
354 |
CCodeQueryDialog( aBarringPassword, KGSBarringPasswordLength,
|
|
355 |
KGSBarringPasswordLength, ESecUiNone );
|
|
356 |
dlg->PrepareLC( R_BARRING_PASSWORD_DLG );
|
|
357 |
|
|
358 |
HBufC* string = NULL;
|
|
359 |
string = StringLoader::LoadLC( aTitleID );
|
|
360 |
dlg->SetPromptL( *string );
|
|
361 |
CleanupStack::PopAndDestroy( string );
|
|
362 |
|
|
363 |
TInt res = dlg->RunLD();
|
|
364 |
dlg = NULL;
|
|
365 |
|
|
366 |
if ( res )
|
|
367 |
{
|
|
368 |
if ( aBarringPassword.Length() == KGSBarringPasswordLength )
|
|
369 |
{
|
|
370 |
continueLoop = EFalse;
|
|
371 |
}
|
|
372 |
}
|
|
373 |
else
|
|
374 |
{
|
|
375 |
__GSLOGSTRING("[GS] BarringPasswordQueryL: EAknSoftkeyCancel returned");
|
|
376 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL");
|
|
377 |
return EAknSoftkeyCancel;
|
|
378 |
}
|
|
379 |
}
|
|
380 |
__GSLOGSTRING("[GS] BarringPasswordQueryL: EAknSoftkeyOk returned");
|
|
381 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL");
|
|
382 |
return EAknSoftkeyOk;
|
|
383 |
}
|
|
384 |
|
|
385 |
// ---------------------------------------------------------------------------
|
|
386 |
//
|
|
387 |
// Adds given item to a given list
|
|
388 |
//
|
|
389 |
// ---------------------------------------------------------------------------
|
|
390 |
void CGSSettListBarringView::AppendItemL(
|
|
391 |
CDesCArrayFlat& aList, const TInt aItem )
|
|
392 |
{
|
|
393 |
HBufC* string = NULL;
|
|
394 |
string = StringLoader::LoadLC( aItem );
|
|
395 |
aList.AppendL( *string );
|
|
396 |
CleanupStack::PopAndDestroy( string );
|
|
397 |
}
|
|
398 |
|
|
399 |
// ---------------------------------------------------------------------------
|
|
400 |
//
|
|
401 |
// Handles barring operation requests.
|
|
402 |
//
|
|
403 |
// ---------------------------------------------------------------------------
|
|
404 |
void CGSSettListBarringView::HandleBarringOperationL(
|
|
405 |
TCallBarringSetting aBarringSetting, TBasicServiceGroups aBsc )
|
|
406 |
{
|
|
407 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleBarringOperationL");
|
|
408 |
TInt ret = KErrNone;
|
|
409 |
ret = BarringPasswordQueryL(
|
|
410 |
aBarringSetting.iPassword, R_BARRING_PASSWORD );
|
|
411 |
if ( ret == EAknSoftkeyOk )
|
|
412 |
{
|
|
413 |
iBarring->SetBarringL( aBarringSetting, aBsc );
|
|
414 |
}
|
|
415 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleBarringOperationL");
|
|
416 |
}
|
|
417 |
|
|
418 |
// ---------------------------------------------------------------------------
|
|
419 |
//
|
|
420 |
// Sets barring type. Switches from GS internal values, to values
|
|
421 |
// shared by phone/phonesettings.
|
|
422 |
// ---------------------------------------------------------------------------
|
|
423 |
void CGSSettListBarringView::SetBarringType( TInt& aCommand,
|
|
424 |
TCallBarringSetting& aBarringSetting,
|
|
425 |
TGSBarringSetting aType )
|
|
426 |
{
|
|
427 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::SetBarringType");
|
|
428 |
if ( aCommand != EGSCmdBarringActivate &&
|
|
429 |
aCommand != EGSCmdBarringCancel &&
|
|
430 |
aCommand != EGSCmdBarringInquiry &&
|
|
431 |
aCommand != EGSCmdBarringChangePwd &&
|
|
432 |
aCommand != EGSCmdBarringCancelAll )
|
|
433 |
{
|
|
434 |
__GSLOGSTRING("[GS] SetBarringType: No barring variables set");
|
|
435 |
return; //in case of exit do not set barring variables.
|
|
436 |
}
|
|
437 |
|
|
438 |
aBarringSetting.iServiceGroup = EServiceGroupVoice;
|
|
439 |
|
|
440 |
switch ( aType )
|
|
441 |
{
|
|
442 |
case EGSCBOutgoing:
|
|
443 |
aBarringSetting.iType = EBarringTypeAllOutgoing;
|
|
444 |
break;
|
|
445 |
case EGSCBInternational:
|
|
446 |
aBarringSetting.iType = EBarringTypeOutgoingInternational;
|
|
447 |
break;
|
|
448 |
case EGSCBInternationalExceptHome:
|
|
449 |
aBarringSetting.iType =
|
|
450 |
EBarringTypeOutgoingInternationalExceptToHomeCountry;
|
|
451 |
break;
|
|
452 |
case EGSCBIncoming:
|
|
453 |
aBarringSetting.iType = EBarringTypeAllIncoming;
|
|
454 |
break;
|
|
455 |
case EGSCBAbroad:
|
|
456 |
aBarringSetting.iType = EBarringTypeIncomingWhenRoaming;
|
|
457 |
break;
|
|
458 |
default:
|
|
459 |
aBarringSetting.iType = EBarringTypeAllBarrings;
|
|
460 |
break;
|
|
461 |
}
|
|
462 |
|
|
463 |
if ( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
|
|
464 |
{
|
|
465 |
// Restricted call barring only support EBarringTypeIncomingWhenRoaming
|
|
466 |
aBarringSetting.iType = EBarringTypeIncomingWhenRoaming;
|
|
467 |
}
|
|
468 |
|
|
469 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::SetBarringType");
|
|
470 |
}
|
|
471 |
|
|
472 |
// ---------------------------------------------------------------------------
|
|
473 |
//
|
|
474 |
// Creates a request to cancel all barrings.
|
|
475 |
//
|
|
476 |
// ---------------------------------------------------------------------------
|
|
477 |
void CGSSettListBarringView::CancelAllBarringsL()
|
|
478 |
{
|
|
479 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::CancelAllBarringsL");
|
|
480 |
TCallBarringSetting cancelAllCB;
|
|
481 |
|
|
482 |
TInt retValue = KErrNone;
|
|
483 |
retValue = BarringPasswordQueryL( cancelAllCB.iPassword,
|
|
484 |
R_BARRING_PASSWORD );
|
|
485 |
if ( retValue == EAknSoftkeyOk )
|
|
486 |
{
|
|
487 |
cancelAllCB.iSetting = ECancelBarring;
|
|
488 |
cancelAllCB.iType = EBarringTypeAllBarrings;
|
|
489 |
cancelAllCB.iServiceGroup = EServiceGroupVoice;
|
|
490 |
iBarring->SetBarringL( cancelAllCB, EAllTeleAndBearer );
|
|
491 |
}
|
|
492 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::CancelAllBarringsL");
|
|
493 |
}
|
|
494 |
|
|
495 |
// ---------------------------------------------------------------------------
|
|
496 |
//
|
|
497 |
// Handles changing of barring password.
|
|
498 |
//
|
|
499 |
// ---------------------------------------------------------------------------
|
|
500 |
void CGSSettListBarringView::ChangeBarringPwdL()
|
|
501 |
{
|
|
502 |
__GSLOGSTRING("[GS]--> CGSSettListBarringView::ChangeBarringPwdL");
|
|
503 |
TInt returnValue = KErrNone;
|
|
504 |
RMobilePhone::TMobilePhonePasswordChangeV2 pwd;
|
|
505 |
|
|
506 |
returnValue = BarringPasswordQueryL(
|
|
507 |
pwd.iOldPassword, R_CURRENT_BARRING_PASSWORD );
|
|
508 |
|
|
509 |
if ( returnValue != EAknSoftkeyOk ) //cancelled or error
|
|
510 |
{
|
|
511 |
__GSLOGSTRING("[GS] ChangeBarringPwdL: Current PW cancelled/error");
|
|
512 |
return;
|
|
513 |
}
|
|
514 |
returnValue = BarringPasswordQueryL( pwd.iNewPassword,
|
|
515 |
R_NEW_BARRING_PASSWORD );
|
|
516 |
if ( returnValue != EAknSoftkeyOk ) //cancelled or error
|
|
517 |
{
|
|
518 |
__GSLOGSTRING("[GS] ChangeBarringPwdL: New PW cancelled/error");
|
|
519 |
return;
|
|
520 |
}
|
|
521 |
returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword ,
|
|
522 |
R_VERIFY_NEW_BARRING_PASSWORD );
|
|
523 |
if ( returnValue != EAknSoftkeyOk )
|
|
524 |
{
|
|
525 |
__GSLOGSTRING("[GS] ChangeBarringPwdL: Verify PW1 cancelled/error");
|
|
526 |
return;
|
|
527 |
}
|
|
528 |
// check if newpw and verifypw do not
|
|
529 |
// match->password error->return to query
|
|
530 |
while ( pwd.iNewPassword.Compare( pwd.iVerifiedPassword ) != 0 )
|
|
531 |
{
|
|
532 |
iCbObserver->HandleBarringErrorL( KErrGsmSSNegativePasswordCheck );
|
|
533 |
|
|
534 |
returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword,
|
|
535 |
R_VERIFY_NEW_BARRING_PASSWORD );
|
|
536 |
if ( returnValue != EAknSoftkeyOk ) //cancelled or error
|
|
537 |
{
|
|
538 |
__GSLOGSTRING("[GS] ChangeBarringPwdL: Verify PW2 cancelled/error");
|
|
539 |
return;
|
|
540 |
}
|
|
541 |
}
|
|
542 |
iBarring->ChangePasswordL( pwd, ETrue );
|
|
543 |
__GSLOGSTRING("[GS] <--CGSSettListBarringView::ChangeBarringPwdL");
|
|
544 |
}
|
|
545 |
|
|
546 |
// ---------------------------------------------------------------------------
|
|
547 |
//
|
|
548 |
// Creates new iContainer.
|
|
549 |
//
|
|
550 |
// ---------------------------------------------------------------------------
|
|
551 |
void CGSSettListBarringView::NewContainerL()
|
|
552 |
{
|
|
553 |
iContainer = new (ELeave) CGSSettListBarringContainer;
|
|
554 |
}
|
|
555 |
|
|
556 |
// ---------------------------------------------------------------------------
|
|
557 |
//
|
|
558 |
// Handles listbox selection
|
|
559 |
//
|
|
560 |
// ---------------------------------------------------------------------------
|
|
561 |
void CGSSettListBarringView::HandleListBoxSelectionL()
|
|
562 |
{
|
|
563 |
iRockerPress = ETrue;
|
|
564 |
CEikMenuBar* menuBar = this->MenuBar();
|
|
565 |
menuBar->SetMenuType( CEikMenuBar::EMenuContext );
|
|
566 |
menuBar->SetContextMenuTitleResourceId(R_CALL_BARRING_MSK_CONTEXTMENUBAR);
|
|
567 |
// Display menu bar.
|
|
568 |
menuBar->TryDisplayContextMenuBarL();
|
|
569 |
iRockerPress = EFalse;
|
|
570 |
menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
|
|
571 |
iContextMenuInitialized = ETrue;
|
|
572 |
}
|
|
573 |
|
|
574 |
|
|
575 |
// End of file
|