00001 // Copyright: (c) 2006 Nokia Ltd. All rights reserved. 00002 00003 // INCLUDE FILES 00004 #include "S60MemoryLabAppUi.h" 00005 #include "S60MemoryLabContainer.h" 00006 #include <S60MemoryLab.rsg> 00007 #include "s60memorylab.hrh" 00008 00009 #include <avkon.hrh> 00010 00011 // ================= MEMBER FUNCTIONS ======================= 00012 // 00013 // ---------------------------------------------------------- 00014 // CS60MemoryLabAppUi::ConstructL() 00015 // ?implementation_description 00016 // ---------------------------------------------------------- 00017 // 00018 void CS60MemoryLabAppUi::ConstructL() 00019 { 00020 BaseConstructL(); 00021 iAppContainer = new (ELeave) CS60MemoryLabContainer; 00022 iAppContainer->SetMopParent(this); 00023 iAppContainer->ConstructL( ClientRect() ); 00024 AddToStackL( iAppContainer ); 00025 } 00026 00027 // ---------------------------------------------------- 00028 // CS60MemoryLabAppUi::~CS60MemoryLabAppUi() 00029 // Destructor 00030 // Frees reserved resources 00031 // ---------------------------------------------------- 00032 // 00033 CS60MemoryLabAppUi::~CS60MemoryLabAppUi() 00034 { 00035 if (iAppContainer) 00036 { 00037 RemoveFromStack( iAppContainer ); 00038 delete iAppContainer; 00039 } 00040 } 00041 00042 // ------------------------------------------------------------------------------ 00043 // CS60MemoryLabAppUi::::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 CS60MemoryLabAppUi::DynInitMenuPaneL( 00051 TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) 00052 { 00053 } 00054 00055 // ---------------------------------------------------- 00056 // CS60MemoryLabAppUi::HandleKeyEventL( 00057 // const TKeyEvent& aKeyEvent,TEventCode /*aType*/) 00058 // ?implementation_description 00059 // ---------------------------------------------------- 00060 // 00061 TKeyResponse CS60MemoryLabAppUi::HandleKeyEventL( 00062 const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) 00063 { 00064 return EKeyWasNotConsumed; 00065 } 00066 00067 // ---------------------------------------------------- 00068 // CS60MemoryLabAppUi::HandleCommandL(TInt aCommand) 00069 // ?implementation_description 00070 // ---------------------------------------------------- 00071 // 00072 void CS60MemoryLabAppUi::HandleCommandL(TInt aCommand) 00073 { 00074 switch ( aCommand ) 00075 { 00076 case EAknSoftkeyBack: 00077 case EEikCmdExit: 00078 Exit(); 00079 break; 00080 00081 case ES60MemoryLabCmdToggleLabels: 00082 iAppContainer->ToggleLabelsL(); 00083 break; 00084 00085 case ES60MemoryLabCmdCleanupStackTest: 00086 iAppContainer->CleanupStackTestL(); 00087 break; 00088 00089 default: 00090 break; 00091 } 00092 } 00093 00094 // ----------------------------------------------------------------------------- 00095 // CS60MemoryLabAppUi::HandleScreenDeviceChangedL 00096 // Handle change in screen resolution. 00097 // ----------------------------------------------------------------------------- 00098 // 00099 void CS60MemoryLabAppUi::HandleScreenDeviceChangedL() 00100 { 00101 CAknAppUi::HandleScreenDeviceChangedL(); 00102 00103 // Reposition the container 00104 if ( iAppContainer ) 00105 { 00106 iAppContainer->SetRect(ClientRect()); 00107 } 00108 } 00109 00110 // End of File