|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : RegistrationAppui.cpp 00004 * Part of : Registration 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2005-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 // INCLUDE FILES 00017 #include "RegistrationAppui.h" 00018 #include "RegistrationView.h" 00019 00020 // ============================ MEMBER FUNCTIONS ============================== 00021 // 00022 // ---------------------------------------------------------------------------- 00023 // CRegistrationAppUi::ConstructL() 00024 // 00025 // ---------------------------------------------------------------------------- 00026 // 00027 void CRegistrationAppUi::ConstructL() 00028 { 00029 BaseConstructL( CAknAppUi::EAknEnableSkin ); 00030 00031 iAppView = CRegistrationView::NewL(); 00032 CleanupStack::PushL( iAppView ); 00033 AddViewL( iAppView ); 00034 CleanupStack::Pop( iAppView ); 00035 ActivateLocalViewL( iAppView->Id() ); 00036 } 00037 00038 // ---------------------------------------------------------------------------- 00039 // CRegistrationAppUi::~CRegistrationAppUi() 00040 // Destructor 00041 // Frees reserved resources 00042 // ---------------------------------------------------------------------------- 00043 // 00044 CRegistrationAppUi::~CRegistrationAppUi() 00045 { 00046 } 00047 00048 // ---------------------------------------------------------------------------- 00049 // CRegistrationAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* 00050 // aMenuPane) 00051 // This function is called by the EIKON framework just before it displays 00052 // a menu pane. Its default implementation is empty, and by overriding it, 00053 // the application can set the state of menu items dynamically according 00054 // to the state of application data. 00055 // ---------------------------------------------------------------------------- 00056 // 00057 void CRegistrationAppUi::DynInitMenuPaneL( 00058 TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) 00059 { 00060 // No implementation required 00061 } 00062 00063 // ---------------------------------------------------------------------------- 00064 // CRegistrationAppUi::HandleKeyEventL( 00065 // const TKeyEvent& aKeyEvent,TEventCode /*aType*/) 00066 // takes care of key event handling 00067 // ---------------------------------------------------------------------------- 00068 // 00069 TKeyResponse CRegistrationAppUi::HandleKeyEventL( 00070 const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) 00071 { 00072 return EKeyWasNotConsumed; 00073 } 00074 00075 // ---------------------------------------------------------------------------- 00076 // CRegistrationAppUi::HandleCommandL( TInt aCommand ) 00077 // takes care of command handling 00078 // ---------------------------------------------------------------------------- 00079 // 00080 void CRegistrationAppUi::HandleCommandL( TInt aCommand ) 00081 { 00082 switch ( aCommand ) 00083 { 00084 case EAknSoftkeyExit: 00085 case EEikCmdExit: 00086 { 00087 Exit(); 00088 break; 00089 } 00090 case ERegistrationCmdAppRegister: 00091 { 00092 if ( iAppView->ValidateInput() ) 00093 { 00094 // Add here your own code to handle registration data. 00095 // 00096 iCoeEnv->ReadResourceL( iNote, R_REGISTRATION_INFO_TEXT ); 00097 CAknInformationNote* dlg = new ( ELeave ) CAknInformationNote; 00098 dlg->ExecuteLD( iNote ); 00099 } 00100 else 00101 { 00102 iCoeEnv->ReadResourceL( iNote, R_REGISTRATION_ERR_TEXT ); 00103 CAknErrorNote* dlg = new ( ELeave ) CAknErrorNote; 00104 dlg->ExecuteLD( iNote ); 00105 } 00106 break; 00107 } 00108 00109 default: 00110 break; 00111 } 00112 } 00113 00114 // ---------------------------------------------------------------------------- 00115 // CRegistrationAppUi::HandleResourceChangeL( TInt aType ) 00116 // Called by framework when layout is changed. 00117 // ---------------------------------------------------------------------------- 00118 // 00119 void CRegistrationAppUi::HandleResourceChangeL( TInt aType ) 00120 { 00121 CAknAppUi::HandleResourceChangeL( aType ); 00122 if ( aType == KEikDynamicLayoutVariantSwitch ) 00123 { 00124 iAppView->SizeChanged(); 00125 } 00126 } 00127 00128 // End of File
|
© Nokia 2006 |