00001 // Copyright (c) 2006 Nokia Corporation. 00002 00003 // INCLUDE FILES 00004 #include "S60ClientServLabAppUi.h" 00005 #include "S60ClientServLabContainer.h" 00006 #include <S60ClientServerLab.rsg> 00007 #include "s60ClientServerLab.hrh" 00008 00009 #include <avkon.hrh> 00010 00011 // ================= MEMBER FUNCTIONS ======================= 00012 // 00013 // ---------------------------------------------------------- 00014 // CS60ClientServLabAppUi::ConstructL() 00015 // ?implementation_description 00016 // ---------------------------------------------------------- 00017 // 00018 void CS60ClientServLabAppUi::ConstructL() 00019 { 00020 BaseConstructL(); 00021 iAppContainer = new (ELeave) CS60ClientServLabContainer; 00022 iAppContainer->SetMopParent(this); 00023 iAppContainer->ConstructL( ClientRect() ); 00024 AddToStackL( iAppContainer ); 00025 } 00026 00027 // ---------------------------------------------------- 00028 // CS60ClientServLabAppUi::~CS60ClientServLabAppUi() 00029 // Destructor 00030 // Frees reserved resources 00031 // ---------------------------------------------------- 00032 // 00033 CS60ClientServLabAppUi::~CS60ClientServLabAppUi() 00034 { 00035 if (iAppContainer) 00036 { 00037 RemoveFromStack( iAppContainer ); 00038 delete iAppContainer; 00039 } 00040 } 00041 00042 // ------------------------------------------------------------------------------ 00043 // CS60ClientServLabAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) 00044 // This function is called by the EIKON framework just before it displays 00045 // a menu pane. Its default implementation is empty, and by overriding it, 00046 // the application can set the state of menu items dynamically according 00047 // to the state of application data. 00048 // ------------------------------------------------------------------------------ 00049 // 00050 void CS60ClientServLabAppUi::DynInitMenuPaneL( 00051 TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) 00052 { 00053 } 00054 00055 // ---------------------------------------------------- 00056 // CS60ClientServLabAppUi::HandleKeyEventL( 00057 // const TKeyEvent& aKeyEvent,TEventCode /*aType*/) 00058 // ?implementation_description 00059 // ---------------------------------------------------- 00060 // 00061 TKeyResponse CS60ClientServLabAppUi::HandleKeyEventL( 00062 const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) 00063 { 00064 return EKeyWasNotConsumed; 00065 } 00066 00067 // ---------------------------------------------------- 00068 // CS60ClientServLabAppUi::HandleCommandL(TInt aCommand) 00069 // ?implementation_description 00070 // ---------------------------------------------------- 00071 // 00072 void CS60ClientServLabAppUi::HandleCommandL(TInt aCommand) 00073 { 00074 switch ( aCommand ) 00075 { 00076 case EAknSoftkeyBack: 00077 case EEikCmdExit: 00078 Exit(); 00079 break; 00080 00081 case ES60ClientServLabCmdWriteFile: 00082 iAppContainer->WriteFileL(); 00083 break; 00084 00085 default: 00086 break; 00087 } 00088 } 00089 00090 // ----------------------------------------------------------------------------- 00091 // CS60ClientServLabAppUi::HandleScreenDeviceChangedL 00092 // Handle change in screen resolution. 00093 // ----------------------------------------------------------------------------- 00094 // 00095 void CS60ClientServLabAppUi::HandleScreenDeviceChangedL() 00096 { 00097 CAknAppUi::HandleScreenDeviceChangedL(); 00098 00099 // Reposition the view 00100 if ( iAppContainer ) 00101 { 00102 iAppContainer->SetRect(ClientRect()); 00103 } 00104 } 00105 00106 // End of File