00001
00002
00003
00004
00005
00006
00007
00008
00009
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
00020
00021
00022 #include "ExeLauncher_S60.hrh"
00023 #include "ExeLauncher_S60ContainerView.h"
00024 #include "ExeLauncher_S60Container.hrh"
00025 #include "ExeLauncher_S60Container.h"
00026
00027
00028
00029
00030
00031
00036 CExeLauncher_S60ContainerView::CExeLauncher_S60ContainerView()
00037 {
00038
00039 iExeLauncher_S60Container = NULL;
00040
00041
00042 }
00047 CExeLauncher_S60ContainerView::~CExeLauncher_S60ContainerView()
00048 {
00049
00050 delete iExeLauncher_S60Container;
00051 iExeLauncher_S60Container = NULL;
00052
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
00091 BaseConstructL( R_EXE_LAUNCHER_S60_CONTAINER_EXE_LAUNCHER_S60_CONTAINER_VIEW );
00092
00093
00094
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
00112 TBool commandHandled = EFalse;
00113 switch ( aCommand )
00114 {
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
00134
00135 }
00136
00141 void CExeLauncher_S60ContainerView::DoActivateL(
00142 const TVwsViewId& ,
00143 TUid ,
00144 const TDesC8& )
00145 {
00146
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
00162
00163 }
00164
00167 void CExeLauncher_S60ContainerView::DoDeactivate()
00168 {
00169
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
00186
00187 }
00188
00189
00190 void CExeLauncher_S60ContainerView::SetupStatusPaneL()
00191 {
00192
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
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();
00215 }
00216
00217 }
00218
00219
00220
00221 void CExeLauncher_S60ContainerView::CleanupStatusPane()
00222 {
00223 }
00224
00225
00229 void CExeLauncher_S60ContainerView::HandleStatusPaneSizeChange()
00230 {
00231 CAknView::HandleStatusPaneSizeChange();
00232
00233
00234 TInt result;
00235 TRAP( result, SetupStatusPaneL() );
00236 }
00237