gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCellularCallBarringContainer.cpp
changeset 0 8c5d936e5675
child 17 3b47783fdf16
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     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:  Container for the Barring folder
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "GSCellularCallBarringContainer.h"
       
    21 
       
    22 #include <aknlists.h>
       
    23 #include <StringLoader.h>
       
    24 #include <GSCallBarringPluginRsc.rsg>
       
    25 #include <csxhelp/cp.hlp.hrh>
       
    26 #include <gsfwviewuids.h>
       
    27 #include "LocalViewIds.h"
       
    28 #include "GSCallBarringPlugin.h"
       
    29 
       
    30 // ========================= MEMBER FUNCTIONS ================================
       
    31 // ---------------------------------------------------------------------------
       
    32 // 
       
    33 // Symbian OS two phased constructor
       
    34 // 
       
    35 // ---------------------------------------------------------------------------
       
    36 void CGSSettListBarringContainer::ConstructL( const TRect& aRect )
       
    37     {
       
    38     iListBox = new ( ELeave ) CAknSettingStyleListBox;
       
    39 
       
    40     TInt resTitleId = R_GS_BARRING_VIEW_TITLE;
       
    41     
       
    42     CGSCallBarringPlugin* plugin = static_cast<CGSCallBarringPlugin*>
       
    43       ( ( static_cast<CAknViewAppUi*>( iCoeEnv->AppUi() ) )
       
    44               ->View( KCallBarringPluginId ) ); 
       
    45     
       
    46     if ( plugin && plugin->VoipSupported() )
       
    47         {
       
    48         resTitleId = R_GS_BARRING_VIEW_TITLE_VOIP;
       
    49         }
       
    50     
       
    51     BaseConstructL( aRect, 
       
    52                     resTitleId, 
       
    53                     R_BARRING_LBX_RESOURCE );
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // 
       
    58 // Destructor
       
    59 //  
       
    60 // ---------------------------------------------------------------------------
       
    61 CGSSettListBarringContainer::~CGSSettListBarringContainer()
       
    62     {
       
    63     if ( iItems )
       
    64         {
       
    65         delete iItems;
       
    66         }
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // 
       
    71 // Creates list box
       
    72 //  
       
    73 // ---------------------------------------------------------------------------
       
    74 void CGSSettListBarringContainer::ConstructListBoxL( TInt /*aResLbxId*/ )
       
    75     {        
       
    76     iListBox->ConstructL( this, EAknListBoxSelectionList); 
       
    77     iItemArray = static_cast <CDesCArray*> 
       
    78         ( iListBox->Model()->ItemTextArray() );
       
    79     iItems = iCoeEnv->ReadDesC16ArrayResourceL( R_BARRING_LBX );
       
    80 
       
    81     CreateListBoxItemsL();
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // 
       
    86 // Creates List box items
       
    87 //  
       
    88 // ---------------------------------------------------------------------------
       
    89 void CGSSettListBarringContainer::CreateListBoxItemsL()
       
    90     {
       
    91     TInt placeInArray = 0;
       
    92     TSettingItem readItem;
       
    93     for ( TInt i = 0; i < iItems->Count(); i++ )
       
    94         {
       
    95         readItem = ( *iItems ) [ i ]; 
       
    96         iItemArray->InsertL( placeInArray++, readItem ); 
       
    97         }
       
    98     iListBox->HandleItemAdditionL();
       
    99     }
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // CGSSettListBarringContainer::GetHelpContext
       
   103 // Gets Help Context
       
   104 //  
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void CGSSettListBarringContainer::GetHelpContext(
       
   108     TCoeHelpContext& aContext ) const
       
   109     {
       
   110     aContext.iMajor = KUidGS;
       
   111     aContext.iContext = KSET_HLP_BARRING_SETTINGS;
       
   112     }
       
   113 
       
   114 //End of File