examples/SFExamples/NotifierExample/Launchers/ExeLauncher_S60/src/ExeLauncher_S60ContainerView.cpp

00001 /*
00002 ========================================================================
00003  Name        : ExeLauncher_S60ContainerView.cpp
00004  Author      : Hamish Willee
00005  Copyright   : (C) Symbian 2007
00006  Description : 
00007 ========================================================================
00008 */
00009 // [[[ begin generated region: do not modify [Generated System Includes]
00010 #include <aknviewappui.h>
00011 #include <eikmenub.h>
00012 #include <avkon.hrh>
00013 #include <akncontext.h>
00014 #include <akntitle.h>
00015 #include <stringloader.h>
00016 #include <barsread.h>
00017 #include <eikbtgpc.h>
00018 #include <ExeLauncher_S60.rsg>
00019 // ]]] end generated region [Generated System Includes]
00020 
00021 // [[[ begin generated region: do not modify [Generated User Includes]
00022 #include "ExeLauncher_S60.hrh"
00023 #include "ExeLauncher_S60ContainerView.h"
00024 #include "ExeLauncher_S60Container.hrh"
00025 #include "ExeLauncher_S60Container.h"
00026 // ]]] end generated region [Generated User Includes]
00027 
00028 // [[[ begin generated region: do not modify [Generated Constants]
00029 // ]]] end generated region [Generated Constants]
00030 
00031 
00036 CExeLauncher_S60ContainerView::CExeLauncher_S60ContainerView()
00037         {
00038         // [[[ begin generated region: do not modify [Generated Contents]
00039         iExeLauncher_S60Container = NULL;
00040         // ]]] end generated region [Generated Contents]
00041         
00042         }
00047 CExeLauncher_S60ContainerView::~CExeLauncher_S60ContainerView()
00048         {
00049         // [[[ begin generated region: do not modify [Generated Contents]
00050         delete iExeLauncher_S60Container;
00051         iExeLauncher_S60Container = NULL;
00052         // ]]] end generated region [Generated Contents]
00053         
00054         }
00055 
00062 CExeLauncher_S60ContainerView* CExeLauncher_S60ContainerView::NewL()
00063         {
00064         CExeLauncher_S60ContainerView* self = CExeLauncher_S60ContainerView::NewLC();
00065         CleanupStack::Pop( self );
00066         return self;
00067         }
00068 
00075 CExeLauncher_S60ContainerView* CExeLauncher_S60ContainerView::NewLC()
00076         {
00077         CExeLauncher_S60ContainerView* self = new ( ELeave ) CExeLauncher_S60ContainerView();
00078         CleanupStack::PushL( self );
00079         self->ConstructL();
00080         return self;
00081         }
00082 
00083 
00088 void CExeLauncher_S60ContainerView::ConstructL()
00089         {
00090         // [[[ begin generated region: do not modify [Generated Code]
00091         BaseConstructL( R_EXE_LAUNCHER_S60_CONTAINER_EXE_LAUNCHER_S60_CONTAINER_VIEW );
00092         // ]]] end generated region [Generated Code]
00093         
00094         // add your own initialization code here
00095         }
00096         
00100 TUid CExeLauncher_S60ContainerView::Id() const
00101         {
00102         return TUid::Uid( EExeLauncher_S60ContainerViewId );
00103         }
00104 
00109 void CExeLauncher_S60ContainerView::HandleCommandL( TInt aCommand )
00110         {   
00111         // [[[ begin generated region: do not modify [Generated Code]
00112         TBool commandHandled = EFalse;
00113         switch ( aCommand )
00114                 {       // code to dispatch to the AknView's menu and CBA commands is generated here
00115                 case EExeLauncher_S60ContainerViewLeakTest_exeMenuItemCommand:
00116                         {
00117                         }
00118                         break;
00119                 default:
00120                         break;
00121                 }
00122         
00123                 
00124         if ( !commandHandled ) 
00125                 {
00126         
00127                 if ( aCommand == EAknSoftkeyExit )
00128                         {
00129                         AppUi()->HandleCommandL( EEikCmdExit );
00130                         }
00131         
00132                 }
00133         // ]]] end generated region [Generated Code]
00134         
00135         }
00136 
00141 void CExeLauncher_S60ContainerView::DoActivateL(
00142                 const TVwsViewId& /*aPrevViewId*/,
00143                 TUid /*aCustomMessageId*/,
00144                 const TDesC8& /*aCustomMessage*/ )
00145         {
00146         // [[[ begin generated region: do not modify [Generated Contents]
00147         SetupStatusPaneL();
00148         
00149         CEikButtonGroupContainer* cba = AppUi()->Cba();
00150         if ( cba != NULL ) 
00151                 {
00152                 cba->MakeVisible( EFalse );
00153                 }
00154         
00155         if ( iExeLauncher_S60Container == NULL )
00156                 {
00157                 iExeLauncher_S60Container = CExeLauncher_S60Container::NewL( ClientRect(), NULL, this );
00158                 iExeLauncher_S60Container->SetMopParent( this );
00159                 AppUi()->AddToStackL( *this, iExeLauncher_S60Container );
00160                 } 
00161         // ]]] end generated region [Generated Contents]
00162         
00163         }
00164 
00167 void CExeLauncher_S60ContainerView::DoDeactivate()
00168         {
00169         // [[[ begin generated region: do not modify [Generated Contents]
00170         CleanupStatusPane();
00171         
00172         CEikButtonGroupContainer* cba = AppUi()->Cba();
00173         if ( cba != NULL ) 
00174                 {
00175                 cba->MakeVisible( ETrue );
00176                 cba->DrawDeferred();
00177                 }
00178         
00179         if ( iExeLauncher_S60Container != NULL )
00180                 {
00181                 AppUi()->RemoveFromViewStack( *this, iExeLauncher_S60Container );
00182                 delete iExeLauncher_S60Container;
00183                 iExeLauncher_S60Container = NULL;
00184                 }
00185         // ]]] end generated region [Generated Contents]
00186         
00187         }
00188 
00189 // [[[ begin generated function: do not modify
00190 void CExeLauncher_S60ContainerView::SetupStatusPaneL()
00191         {
00192         // reset the context pane
00193         TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
00194         CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
00195                 StatusPane()->PaneCapabilities( contextPaneUid );
00196         if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
00197                 {
00198                 CAknContextPane* context = static_cast< CAknContextPane* > ( 
00199                         StatusPane()->ControlL( contextPaneUid ) );
00200                 context->SetPictureToDefaultL();
00201                 }
00202         
00203         // setup the title pane
00204         TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
00205         CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
00206                 StatusPane()->PaneCapabilities( titlePaneUid );
00207         if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
00208                 {
00209                 CAknTitlePane* title = static_cast< CAknTitlePane* >( 
00210                         StatusPane()->ControlL( titlePaneUid ) );
00211                 TResourceReader reader;
00212                 iEikonEnv->CreateResourceReaderLC( reader, R_EXE_LAUNCHER_S60_CONTAINER_TITLE_RESOURCE );
00213                 title->SetFromResourceL( reader );
00214                 CleanupStack::PopAndDestroy(); // reader internal state
00215                 }
00216                                 
00217         }
00218 // ]]] end generated function
00219 
00220 // [[[ begin generated function: do not modify
00221 void CExeLauncher_S60ContainerView::CleanupStatusPane()
00222         {
00223         }
00224 // ]]] end generated function
00225 
00229 void CExeLauncher_S60ContainerView::HandleStatusPaneSizeChange()
00230         {
00231         CAknView::HandleStatusPaneSizeChange();
00232         
00233         // this may fail, but we're not able to propagate exceptions here
00234         TInt result;
00235         TRAP( result, SetupStatusPaneL() ); 
00236         }
00237         

Generated by  doxygen 1.6.2