gssettingsuis/Gs/GSCallBarringPlugin/Src/GSCallBarringPluginContainer.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:  Container for the Barring folder
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "GSCallBarringPluginContainer.h"
       
    21 
       
    22 #include <aknlists.h>
       
    23 #include <StringLoader.h>
       
    24 #include <gscallbarringpluginrsc.rsg>
       
    25 #include <csxhelp/cp.hlp.hrh>
       
    26 #include <featmgr.h>
       
    27 #include <gsfwviewuids.h>
       
    28 #include <gslistbox.h>
       
    29 
       
    30 #include <centralrepository.h>
       
    31 #include <settingsinternalcrkeys.h>
       
    32 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
    33 #include <spsettings.h>
       
    34 #endif // __VOIP && RD_VOIP_REL_2_2
       
    35 // ========================= MEMBER FUNCTIONS ================================
       
    36 // ---------------------------------------------------------------------------
       
    37 // 
       
    38 // Symbian OS two phased constructor
       
    39 // 
       
    40 // ---------------------------------------------------------------------------
       
    41 void CGSCallBarringPluginContainer::ConstructL( const TRect& aRect )
       
    42     {
       
    43     iListBox = new ( ELeave ) CAknSingleLargeStyleListBox;
       
    44     BaseConstructL( aRect, R_GS_BARR_VIEW_TITLE, R_INTERNET_BARRING_LBX );
       
    45 
       
    46 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
    47     iVoIPSupported = EFalse;
       
    48     CSPSettings* spSettings = CSPSettings::NewL();
       
    49     if ( spSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
       
    50         spSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
       
    51         {
       
    52         iVoIPSupported = ETrue;
       
    53         }
       
    54     delete spSettings;
       
    55 #else // __VOIP && RD_VOIP_REL_2_2
       
    56     if ( FeatureManager::FeatureSupported ( KFeatureIdCommonVoip ) )
       
    57         {
       
    58         TInt supported( KGSSettingOff );
       
    59         CRepository* telephonyrep = 
       
    60             CRepository::NewL( KCRUidTelephonySettings );
       
    61         telephonyrep->Get( KDynamicVoIP, supported );
       
    62         iVoIPSupported = KGSSettingOff != supported;
       
    63         delete telephonyrep;
       
    64         }
       
    65 #endif // __VOIP && RD_VOIP_REL_2_2
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // 
       
    70 // Destructor
       
    71 //  
       
    72 // ---------------------------------------------------------------------------
       
    73 CGSCallBarringPluginContainer::~CGSCallBarringPluginContainer()
       
    74     {
       
    75     if ( iListboxItemArray )
       
    76         {
       
    77         delete iListboxItemArray;
       
    78         }
       
    79     }
       
    80 // ---------------------------------------------------------------------------
       
    81 // 
       
    82 // Creates list box
       
    83 //  
       
    84 // ---------------------------------------------------------------------------
       
    85 void CGSCallBarringPluginContainer::ConstructListBoxL( TInt aResLbxId )
       
    86     {
       
    87     iListBox->ConstructL( this );
       
    88     iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
       
    89         *iListBox, *iCoeEnv );
       
    90     iListBox->Model()->SetItemTextArray( iListboxItemArray );
       
    91     iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // CGSCallBarringPluginContainer::GetHelpContext
       
    96 // Gets Help Context
       
    97 //  
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 void CGSCallBarringPluginContainer::GetHelpContext(
       
   101     TCoeHelpContext& aContext ) const
       
   102     {
       
   103     if ( iVoIPSupported )
       
   104         {
       
   105         aContext.iMajor = KUidGS;
       
   106         aContext.iContext = KDIV_HLP_BARRING_MAIN;
       
   107         }
       
   108     else
       
   109         {
       
   110         aContext.iMajor = KUidGS;
       
   111         aContext.iContext = KSET_HLP_BARRING_SETTINGS;
       
   112         }
       
   113     }
       
   114 //End of File