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

00001 /*
00002 ========================================================================
00003  Name        : ExeLauncher_S60AppUi.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 <eikmenub.h>
00011 #include <akncontext.h>
00012 #include <akntitle.h>
00013 #include <ExeLauncher_S60.rsg>
00014 // ]]] end generated region [Generated System Includes]
00015 
00016 // [[[ begin generated region: do not modify [Generated User Includes]
00017 #include "ExeLauncher_S60AppUi.h"
00018 #include "ExeLauncher_S60.hrh"
00019 #include "ExeLauncher_S60ContainerView.h"
00020 // ]]] end generated region [Generated User Includes]
00021 
00022 // [[[ begin generated region: do not modify [Generated Constants]
00023 // ]]] end generated region [Generated Constants]
00024 
00028 CExeLauncher_S60AppUi::CExeLauncher_S60AppUi()
00029         {
00030         // [[[ begin generated region: do not modify [Generated Contents]
00031         // ]]] end generated region [Generated Contents]
00032         
00033         }
00034 
00039 CExeLauncher_S60AppUi::~CExeLauncher_S60AppUi()
00040         {
00041         // [[[ begin generated region: do not modify [Generated Contents]
00042         // ]]] end generated region [Generated Contents]
00043         
00044         }
00045 
00046 // [[[ begin generated function: do not modify
00047 void CExeLauncher_S60AppUi::InitializeContainersL()
00048         {
00049         iExeLauncher_S60ContainerView = CExeLauncher_S60ContainerView::NewL();
00050         AddViewL( iExeLauncher_S60ContainerView );
00051         SetDefaultViewL( *iExeLauncher_S60ContainerView );
00052         }
00053 // ]]] end generated function
00054 
00059 void CExeLauncher_S60AppUi::HandleCommandL( TInt aCommand )
00060         {
00061         // [[[ begin generated region: do not modify [Generated Code]
00062         TBool commandHandled = EFalse;
00063         switch ( aCommand )
00064                 { // code to dispatch to the AppUi's menu and CBA commands is generated here
00065                 default:
00066                         break;
00067                 }
00068         
00069                 
00070         if ( !commandHandled ) 
00071                 {
00072                 if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
00073                         {
00074                         Exit();
00075                         }
00076                 }
00077         // ]]] end generated region [Generated Code]
00078         
00079         }
00080 
00084 void CExeLauncher_S60AppUi::HandleResourceChangeL( TInt aType )
00085         {
00086         CAknViewAppUi::HandleResourceChangeL( aType );
00087         // [[[ begin generated region: do not modify [Generated Code]
00088         // ]]] end generated region [Generated Code]
00089         
00090         }
00091                                 
00098 TKeyResponse CExeLauncher_S60AppUi::HandleKeyEventL(
00099                 const TKeyEvent& aKeyEvent,
00100                 TEventCode aType )
00101         {
00102         // The inherited HandleKeyEventL is private and cannot be called
00103         // [[[ begin generated region: do not modify [Generated Contents]
00104         // ]]] end generated region [Generated Contents]
00105         
00106         return EKeyWasNotConsumed;
00107         }
00108 
00115 void CExeLauncher_S60AppUi::HandleViewDeactivation( 
00116                 const TVwsViewId& aViewIdToBeDeactivated, 
00117                 const TVwsViewId& aNewlyActivatedViewId )
00118         {
00119         CAknViewAppUi::HandleViewDeactivation( 
00120                         aViewIdToBeDeactivated, 
00121                         aNewlyActivatedViewId );
00122         // [[[ begin generated region: do not modify [Generated Contents]
00123         // ]]] end generated region [Generated Contents]
00124         
00125         }
00126 
00131 void CExeLauncher_S60AppUi::ConstructL()
00132         {
00133         _LIT(KTestCodeFileName,"NotifierTestConsole.exe");
00134         _LIT(KNullDesc,"");
00135         // [[[ begin generated region: do not modify [Generated Contents]
00136         BaseConstructL( EAknEnableSkin );
00137         //Launch process
00138         RProcess testexe;
00139         TInt err= testexe.Create(KTestCodeFileName, KNullDesc);
00140         if (err==KErrNone)
00141                 {
00142                 TRequestStatus stat;
00143                 testexe.Rendezvous(stat);
00144                 if (stat!=KRequestPending)
00145                         testexe.Kill(0);                // abort startup
00146                 else
00147                         testexe.Resume();       // logon OK - start the server
00148                 User::WaitForRequest(stat);             // wait for start or death
00149                 testexe.Close();
00150                 }
00151         
00152         Exit();
00153         InitializeContainersL();
00154         // ]]] end generated region [Generated Contents]
00155         
00156         }
00157 

Generated by  doxygen 1.6.2