wlanutilities/wlansettingsui/src/wlansettingsuistatuspane.cpp
branchRCL_3
changeset 24 63be7eb3fc78
parent 23 b852595f5cbe
child 25 f28ada11abbf
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
     1 /*
       
     2 * Copyright (c) 2004 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: 
       
    15 *      Implementation of class CWlanSettingsUiStatusPane.   
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <eikenv.h>
       
    24 #include <eikspane.h>
       
    25 #include <akntitle.h>
       
    26 #include <aknnavi.h>
       
    27 #include <aknnavide.h>
       
    28 #include <avkon.hrh>
       
    29 #include <StringLoader.h>
       
    30 
       
    31 #include "wlansettingsuistatuspane.h"
       
    32 #include <wlansettingsui.rsg>
       
    33 
       
    34 // ================= MEMBER FUNCTIONS =======================
       
    35 
       
    36 // ---------------------------------------------------------
       
    37 // CWlanSettingsUi::NewLC
       
    38 // ---------------------------------------------------------
       
    39 //
       
    40 CWlanSettingsUiStatusPane* CWlanSettingsUiStatusPane::NewLC
       
    41 ( const CEikonEnv* aEikEnv, TInt aResourceId )
       
    42     {
       
    43     CWlanSettingsUiStatusPane* sp = new (ELeave) CWlanSettingsUiStatusPane();
       
    44     CleanupStack::PushL( sp );
       
    45     sp->ConstructL( aEikEnv, aResourceId );
       
    46     return sp;    
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // CWlanSettingsUiStatusPane::~CWlanSettingsUiStatusPane
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 CWlanSettingsUiStatusPane::~CWlanSettingsUiStatusPane()
       
    54     {
       
    55     delete iNaviDecorator;
       
    56     if ( iOldTitleText )
       
    57         {
       
    58         if ( iTitlePane )
       
    59             {
       
    60             TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) )
       
    61             }
       
    62         delete iOldTitleText;
       
    63         }
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // CWlanSettingsUiStatusPane::ConstructL
       
    68 // ---------------------------------------------------------
       
    69 //
       
    70 void CWlanSettingsUiStatusPane::ConstructL
       
    71 ( const CEikonEnv* aEikEnv, TInt aResourceId )
       
    72     {
       
    73     iStatusPane = aEikEnv->AppUiFactory()->StatusPane();
       
    74     iTitlePane = (CAknTitlePane*)iStatusPane->ControlL
       
    75         ( TUid::Uid( EEikStatusPaneUidTitle ) );
       
    76     iOldTitleText = iTitlePane->Text()->AllocL();
       
    77     
       
    78     HBufC* newTitle = StringLoader::LoadLC( aResourceId );
       
    79     
       
    80     iTitlePane->SetTextL( *newTitle );
       
    81     CleanupStack::PopAndDestroy( newTitle );
       
    82     iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL
       
    83         ( TUid::Uid( EEikStatusPaneUidNavi ) );
       
    84     iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC );
       
    85     iNaviPane->PushL( *iNaviDecorator );
       
    86     }