gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringView.cpp
changeset 68 13e71d907dc3
equal deleted inserted replaced
40:6465d5bb863a 68:13e71d907dc3
       
     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     delete spSettings;
       
   155 #endif // __VOIP && RD_VOIP_REL_2_2
       
   156     
       
   157     switch ( aCommand )
       
   158         {
       
   159         case EGSCmdAppChange:
       
   160             iRockerPress = EFalse;
       
   161             HandleListBoxEventL( iContainer->iListBox, EEventEnterKeyPressed );
       
   162             break;
       
   163         case EAknSoftkeyBack:
       
   164 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
   165             if ( showVoipFeatures )
       
   166                 {
       
   167                 iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
       
   168                 }
       
   169             else
       
   170                 {
       
   171                 iAppUi->ActivateLocalViewL( KGSTelPluginUid );
       
   172                 }
       
   173 #else // __VOIP && RD_VOIP_REL_2_2
       
   174             if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
       
   175                 {
       
   176                 iAppUi->ActivateLocalViewL( KCallMainBarringViewId );
       
   177                 }
       
   178             else
       
   179                 {
       
   180                 iAppUi->ActivateLocalViewL( KGSTelPluginUid );
       
   181                 }
       
   182 #endif // __VOIP && RD_VOIP_REL_2_2
       
   183             break;
       
   184         case EGSCmdBarringActivate:
       
   185             barringSetting.iSetting = EActivateBarring;
       
   186             HandleBarringOperationL( barringSetting, EAllTeleAndBearer );
       
   187             break;
       
   188         case EGSCmdBarringCancel:
       
   189             barringSetting.iSetting = ECancelBarring;
       
   190             HandleBarringOperationL( barringSetting, EAllTeleAndBearer );
       
   191             break;
       
   192         case EGSCmdBarringInquiry:
       
   193             iBarring->GetBarringStatusL( EServiceGroupVoice, 
       
   194                 barringSetting.iType );             
       
   195             break;
       
   196         case EGSCmdBarringChangePwd:
       
   197             ChangeBarringPwdL();            
       
   198             break;
       
   199         case EGSCmdBarringCancelAll:
       
   200             CancelAllBarringsL();            
       
   201             break;
       
   202         case EAknCmdHelp:
       
   203             {
       
   204             if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   205                 {
       
   206                 HlpLauncher::LaunchHelpApplicationL(
       
   207                     iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
       
   208                 }
       
   209             break;
       
   210             }
       
   211         default:
       
   212             iAppUi->HandleCommandL( aCommand );
       
   213             break;
       
   214         }
       
   215     __GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleCommandL");
       
   216     }
       
   217   
       
   218 // ---------------------------------------------------------------------------
       
   219 // 
       
   220 // Activates view.
       
   221 // 
       
   222 // ---------------------------------------------------------------------------
       
   223 void CGSSettListBarringView::DoActivateL( const TVwsViewId& aPrevViewId,
       
   224                                           TUid aCustomMessageId,
       
   225                                           const TDesC8& aCustomMessage )
       
   226     {
       
   227     __GSLOGSTRING("[GS]--> CGSSettListBarringView::DoActivateL");
       
   228     CGSLocalBaseView::DoActivateL( aPrevViewId, aCustomMessageId, 
       
   229                                    aCustomMessage );
       
   230 
       
   231     iContainer->iListBox->SetTopItemIndex(iTopItemIndex);
       
   232 
       
   233     if (iCurrentItem >= 0 && 
       
   234         iCurrentItem < iContainer->iListBox->Model()->NumberOfItems())
       
   235         {
       
   236         iContainer->iListBox->SetCurrentItemIndexAndDraw(iCurrentItem);
       
   237         }
       
   238     __GSLOGSTRING("[GS] <--CGSSettListBarringView::DoActivateL");
       
   239     }
       
   240  
       
   241 // ---------------------------------------------------------------------------
       
   242 // 
       
   243 // Deactivates view.
       
   244 // 
       
   245 // ---------------------------------------------------------------------------
       
   246 void CGSSettListBarringView::DoDeactivate()
       
   247     {
       
   248     __GSLOGSTRING("[GS]--> CGSSettListBarringView::DoDeactivate");
       
   249     if ( iContainer )
       
   250         {
       
   251         iCurrentItem = iContainer->iListBox->CurrentItemIndex();
       
   252         iTopItemIndex = iContainer->iListBox->TopItemIndex();
       
   253  
       
   254         iAppUi->RemoveFromViewStack( *this, iContainer );
       
   255         delete iContainer;
       
   256         iContainer = NULL;
       
   257         }
       
   258     __GSLOGSTRING("[GS] <--CGSSettListBarringView::DoDeactivate");
       
   259     }
       
   260  
       
   261  
       
   262  // -----------------------------------------------------------------------------
       
   263 // CGSSettListBarringView::ProcessCommandL
       
   264 // -----------------------------------------------------------------------------
       
   265 void CGSSettListBarringView::ProcessCommandL( TInt aCommand )
       
   266     {
       
   267     // Context menu is needed to be initialized only if selection key
       
   268     // is pressed. Initialization need to be performed only once.
       
   269     if( aCommand == EAknSoftkeyContextOptions &&
       
   270             !iContextMenuInitialized )
       
   271             {
       
   272             MenuBar()->SetContextMenuTitleResourceId(
       
   273                     R_CALL_BARRING_MSK_CONTEXTMENUBAR );
       
   274             iContextMenuInitialized = ETrue;
       
   275             }
       
   276     
       
   277     // Call base class
       
   278     CAknView::ProcessCommandL( aCommand );
       
   279     }
       
   280 // ---------------------------------------------------------------------------
       
   281 // 
       
   282 // Before showing a options menu, delete options key specific settings if 
       
   283 // rocker key has been pressed.
       
   284 // ---------------------------------------------------------------------------
       
   285 //
       
   286 void CGSSettListBarringView::DynInitMenuPaneL( TInt aResourceId, 
       
   287                                               CEikMenuPane* aMenuPane )
       
   288     {
       
   289     __GSLOGSTRING("[GS]--> CGSSettListBarringView::DynInitMenuPaneL");
       
   290     CEikMenuBar* menuBar = MenuBar();
       
   291     // show or hide the 'help' menu item when supported
       
   292     if( aResourceId == R_GS_MENU_ITEM_HELP )
       
   293         {
       
   294         if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   295             {
       
   296             aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse );
       
   297             }
       
   298         else
       
   299             {
       
   300             aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
       
   301             }
       
   302         }
       
   303         
       
   304     if ( iRockerPress )
       
   305         {
       
   306         // always hide 'help' & 'exit' menu items when rocker key is pressed
       
   307         if( aResourceId == R_GS_MENU_ITEM_EXIT )
       
   308             {
       
   309             aMenuPane->SetItemDimmed( EAknCmdExit, ETrue );
       
   310             }
       
   311         else if ( aResourceId == R_GS_MENU_ITEM_HELP )
       
   312             {
       
   313             aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
       
   314             }
       
   315         else if ( aResourceId == R_GS_BARRING_VIEW_MENU )
       
   316             {
       
   317             // these options are not initialized in restricted call barring
       
   318             if ( !FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
       
   319                 {
       
   320                 aMenuPane->SetItemDimmed( EGSCmdBarringCancelAll, ETrue );
       
   321                 aMenuPane->SetItemDimmed( EGSCmdBarringChangePwd, ETrue );
       
   322                 }
       
   323             }
       
   324         }
       
   325 	else if (aResourceId == R_GS_BARRING_VIEW_MENU)
       
   326 		{
       
   327 		if (!menuBar->ItemSpecificCommandsEnabled() && menuBar->GetMenuType()
       
   328 				== CEikMenuBar::EMenuOptions)
       
   329 			{
       
   330 			aMenuPane->SetItemDimmed(EGSCmdBarringActivate, ETrue);
       
   331 			aMenuPane->SetItemDimmed(EGSCmdBarringCancel, ETrue);
       
   332 			aMenuPane->SetItemDimmed(EGSCmdBarringInquiry, ETrue);
       
   333 			}
       
   334 		}
       
   335     __GSLOGSTRING("[GS] <--CGSSettListBarringView::DynInitMenuPaneL");
       
   336     }
       
   337 
       
   338 // ---------------------------------------------------------------------------
       
   339 // 
       
   340 // Queries password from the user.
       
   341 // 
       
   342 // ---------------------------------------------------------------------------
       
   343 //
       
   344 TInt CGSSettListBarringView::BarringPasswordQueryL( 
       
   345     TBarringPassword& aBarringPassword,
       
   346     const TInt& aTitleID )
       
   347     {
       
   348     __GSLOGSTRING("[GS]--> CGSSettListBarringView::BarringPasswordQueryL");
       
   349     TBool continueLoop = ETrue;
       
   350 
       
   351     while ( continueLoop )
       
   352         {
       
   353         aBarringPassword = KNullDesC;
       
   354         CCodeQueryDialog* dlg = new (ELeave)
       
   355             CCodeQueryDialog( aBarringPassword, KGSBarringPasswordLength, 
       
   356             KGSBarringPasswordLength, ESecUiNone );
       
   357         dlg->PrepareLC( R_BARRING_PASSWORD_DLG );
       
   358 
       
   359         HBufC* string = NULL;
       
   360         string = StringLoader::LoadLC( aTitleID );        
       
   361         dlg->SetPromptL( *string );
       
   362         CleanupStack::PopAndDestroy( string );        
       
   363 
       
   364         TInt res = dlg->RunLD();
       
   365         dlg = NULL;
       
   366 
       
   367         if ( res )
       
   368             {
       
   369             if ( aBarringPassword.Length() == KGSBarringPasswordLength )
       
   370                 {
       
   371                 continueLoop = EFalse;
       
   372                 }
       
   373             }
       
   374         else
       
   375             {
       
   376             __GSLOGSTRING("[GS]    BarringPasswordQueryL: EAknSoftkeyCancel returned");
       
   377             __GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL");
       
   378             return EAknSoftkeyCancel;
       
   379             }        
       
   380     }
       
   381     __GSLOGSTRING("[GS]    BarringPasswordQueryL: EAknSoftkeyOk returned");
       
   382     __GSLOGSTRING("[GS] <--CGSSettListBarringView::BarringPasswordQueryL");
       
   383     return EAknSoftkeyOk;
       
   384  }
       
   385  
       
   386 // ---------------------------------------------------------------------------
       
   387 // 
       
   388 // Adds given item to a given list
       
   389 // 
       
   390 // ---------------------------------------------------------------------------
       
   391 void CGSSettListBarringView::AppendItemL( 
       
   392     CDesCArrayFlat& aList, const TInt aItem )
       
   393     {
       
   394     HBufC* string = NULL;
       
   395     string = StringLoader::LoadLC( aItem );
       
   396     aList.AppendL( *string );
       
   397     CleanupStack::PopAndDestroy( string );
       
   398     }
       
   399 
       
   400 // ---------------------------------------------------------------------------
       
   401 // 
       
   402 // Handles barring operation requests.
       
   403 // 
       
   404 // ---------------------------------------------------------------------------
       
   405 void CGSSettListBarringView::HandleBarringOperationL( 
       
   406     TCallBarringSetting aBarringSetting, TBasicServiceGroups aBsc )
       
   407     {
       
   408     __GSLOGSTRING("[GS]--> CGSSettListBarringView::HandleBarringOperationL");
       
   409     TInt ret = KErrNone;
       
   410     ret = BarringPasswordQueryL( 
       
   411         aBarringSetting.iPassword, R_BARRING_PASSWORD );
       
   412     if ( ret == EAknSoftkeyOk )
       
   413          {
       
   414          iBarring->SetBarringL( aBarringSetting, aBsc );
       
   415          }
       
   416     __GSLOGSTRING("[GS] <--CGSSettListBarringView::HandleBarringOperationL");
       
   417     }
       
   418 
       
   419 // ---------------------------------------------------------------------------
       
   420 // 
       
   421 // Sets barring type. Switches from GS internal values, to values
       
   422 // shared by phone/phonesettings.
       
   423 // ---------------------------------------------------------------------------
       
   424 void CGSSettListBarringView::SetBarringType( TInt& aCommand,
       
   425     TCallBarringSetting& aBarringSetting, 
       
   426     TGSBarringSetting aType )
       
   427     {
       
   428     __GSLOGSTRING("[GS]--> CGSSettListBarringView::SetBarringType");
       
   429     if ( aCommand != EGSCmdBarringActivate &&
       
   430          aCommand != EGSCmdBarringCancel &&
       
   431          aCommand != EGSCmdBarringInquiry &&
       
   432          aCommand != EGSCmdBarringChangePwd &&
       
   433          aCommand != EGSCmdBarringCancelAll )
       
   434         {
       
   435         __GSLOGSTRING("[GS]    SetBarringType: No barring variables set");
       
   436         return; //in case of exit do not set barring variables.
       
   437         }
       
   438 
       
   439     aBarringSetting.iServiceGroup = EServiceGroupVoice;
       
   440 
       
   441     switch ( aType )
       
   442         {
       
   443         case EGSCBOutgoing:
       
   444             aBarringSetting.iType = EBarringTypeAllOutgoing;
       
   445             break;    
       
   446         case EGSCBInternational:
       
   447             aBarringSetting.iType = EBarringTypeOutgoingInternational;
       
   448             break;
       
   449         case EGSCBInternationalExceptHome:
       
   450             aBarringSetting.iType = 
       
   451                 EBarringTypeOutgoingInternationalExceptToHomeCountry;
       
   452             break;
       
   453         case EGSCBIncoming:
       
   454             aBarringSetting.iType = EBarringTypeAllIncoming;
       
   455             break;
       
   456         case EGSCBAbroad:
       
   457             aBarringSetting.iType = EBarringTypeIncomingWhenRoaming;
       
   458             break;
       
   459         default:
       
   460             aBarringSetting.iType = EBarringTypeAllBarrings;
       
   461             break;
       
   462         }
       
   463         
       
   464     if ( FeatureManager::FeatureSupported( KFeatureIdRestrictedCallBarring ) )
       
   465         {
       
   466         // Restricted call barring only support EBarringTypeIncomingWhenRoaming
       
   467         aBarringSetting.iType = EBarringTypeIncomingWhenRoaming;
       
   468         }    
       
   469 
       
   470     __GSLOGSTRING("[GS] <--CGSSettListBarringView::SetBarringType");
       
   471     }
       
   472 
       
   473 // ---------------------------------------------------------------------------
       
   474 // 
       
   475 // Creates a request to cancel all barrings.
       
   476 // 
       
   477 // ---------------------------------------------------------------------------
       
   478 void CGSSettListBarringView::CancelAllBarringsL()
       
   479     {
       
   480     __GSLOGSTRING("[GS]--> CGSSettListBarringView::CancelAllBarringsL");
       
   481     TCallBarringSetting cancelAllCB;       
       
   482 
       
   483     TInt retValue = KErrNone; 
       
   484     retValue = BarringPasswordQueryL( cancelAllCB.iPassword, 
       
   485         R_BARRING_PASSWORD );
       
   486     if ( retValue == EAknSoftkeyOk )
       
   487         { 
       
   488         cancelAllCB.iSetting = ECancelBarring;
       
   489         cancelAllCB.iType = EBarringTypeAllBarrings;
       
   490         cancelAllCB.iServiceGroup = EServiceGroupVoice;
       
   491         iBarring->SetBarringL( cancelAllCB, EAllTeleAndBearer );
       
   492         }
       
   493     __GSLOGSTRING("[GS] <--CGSSettListBarringView::CancelAllBarringsL");
       
   494     }
       
   495 
       
   496 // ---------------------------------------------------------------------------
       
   497 // 
       
   498 // Handles changing of barring password.
       
   499 // 
       
   500 // ---------------------------------------------------------------------------
       
   501 void CGSSettListBarringView::ChangeBarringPwdL()
       
   502     {
       
   503     __GSLOGSTRING("[GS]--> CGSSettListBarringView::ChangeBarringPwdL");
       
   504     TInt returnValue = KErrNone;
       
   505     RMobilePhone::TMobilePhonePasswordChangeV2 pwd;
       
   506 
       
   507     returnValue = BarringPasswordQueryL( 
       
   508         pwd.iOldPassword, R_CURRENT_BARRING_PASSWORD );
       
   509 
       
   510     if ( returnValue != EAknSoftkeyOk ) //cancelled or error
       
   511         {
       
   512         __GSLOGSTRING("[GS]    ChangeBarringPwdL: Current PW cancelled/error");
       
   513         return;
       
   514         }
       
   515     returnValue = BarringPasswordQueryL( pwd.iNewPassword, 
       
   516         R_NEW_BARRING_PASSWORD );
       
   517     if ( returnValue != EAknSoftkeyOk ) //cancelled or error
       
   518         {
       
   519         __GSLOGSTRING("[GS]    ChangeBarringPwdL: New PW cancelled/error");
       
   520         return;
       
   521         }
       
   522     returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword , 
       
   523                                          R_VERIFY_NEW_BARRING_PASSWORD );
       
   524     if ( returnValue != EAknSoftkeyOk )
       
   525         {
       
   526         __GSLOGSTRING("[GS]    ChangeBarringPwdL: Verify PW1 cancelled/error");
       
   527         return;
       
   528         }            
       
   529     // check if newpw and verifypw do not 
       
   530     // match->password error->return to query            
       
   531     while ( pwd.iNewPassword.Compare( pwd.iVerifiedPassword ) != 0 )
       
   532         {
       
   533         iCbObserver->HandleBarringErrorL( KErrGsmSSNegativePasswordCheck );
       
   534 
       
   535         returnValue = BarringPasswordQueryL( pwd.iVerifiedPassword, 
       
   536                                              R_VERIFY_NEW_BARRING_PASSWORD );
       
   537         if ( returnValue != EAknSoftkeyOk ) //cancelled or error
       
   538             {
       
   539             __GSLOGSTRING("[GS]    ChangeBarringPwdL: Verify PW2 cancelled/error");
       
   540             return;
       
   541             }
       
   542         }
       
   543     iBarring->ChangePasswordL( pwd, ETrue );
       
   544     __GSLOGSTRING("[GS] <--CGSSettListBarringView::ChangeBarringPwdL");
       
   545     }
       
   546 
       
   547 // ---------------------------------------------------------------------------
       
   548 // 
       
   549 // Creates new iContainer.
       
   550 // 
       
   551 // ---------------------------------------------------------------------------
       
   552 void CGSSettListBarringView::NewContainerL()
       
   553     {
       
   554     iContainer = new (ELeave) CGSSettListBarringContainer;
       
   555     }
       
   556 
       
   557 // ---------------------------------------------------------------------------
       
   558 // 
       
   559 // Handles listbox selection
       
   560 // 
       
   561 // ---------------------------------------------------------------------------
       
   562 void CGSSettListBarringView::HandleListBoxSelectionL()
       
   563     {
       
   564     iRockerPress = ETrue;
       
   565     CEikMenuBar* menuBar = this->MenuBar();
       
   566     menuBar->SetMenuType( CEikMenuBar::EMenuContext );
       
   567     menuBar->SetContextMenuTitleResourceId(R_CALL_BARRING_MSK_CONTEXTMENUBAR);
       
   568     // Display menu bar.
       
   569     menuBar->TryDisplayContextMenuBarL();
       
   570     iRockerPress = EFalse;
       
   571     menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
       
   572     iContextMenuInitialized = ETrue;
       
   573     }
       
   574 
       
   575 
       
   576  // End of file