|
Nokia N97 SDK Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : helpexampleappui.cpp 00004 * Part of : Help example 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2004 - 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 <e32std.h> 00018 #include <hlplch.h> 00019 #include <Helpexample.rsg> 00020 00021 #include "HelpExample.pan" 00022 #include "HelpExampleAppUi.h" 00023 #include "HelpExampleAppView.h" 00024 #include "HelpExampleApplication.h" 00025 #include "HelpExample.hrh" 00026 #include "HelpfulForm.h" 00027 #include "HelpExample.hlp.hrh" 00028 00029 // ============================ MEMBER FUNCTIONS =============================== 00030 00031 // ----------------------------------------------------------------------------- 00032 // CHelpExampleAppUi::ConstructL() 00033 // Symbian 2nd phase constructor can leave. 00034 // ----------------------------------------------------------------------------- 00035 // 00036 void CHelpExampleAppUi::ConstructL() 00037 { 00038 BaseConstructL( EAknEnableSkin ); 00039 00040 iAppView = CHelpExampleAppView::NewL( ClientRect() ); 00041 AddToStackL( iAppView ); 00042 } 00043 // ----------------------------------------------------------------------------- 00044 // CHelpExampleAppUi::CHelpExampleAppUi() 00045 // C++ default constructor can NOT contain any code, that might leave. 00046 // ----------------------------------------------------------------------------- 00047 // 00048 CHelpExampleAppUi::CHelpExampleAppUi() 00049 { 00050 // No implementation required 00051 } 00052 00053 // ----------------------------------------------------------------------------- 00054 // CHelpExampleAppUi::~CHelpExampleAppUi() 00055 // Destructor. 00056 // ----------------------------------------------------------------------------- 00057 // 00058 CHelpExampleAppUi::~CHelpExampleAppUi() 00059 { 00060 if ( iAppView ) 00061 { 00062 iEikonEnv->RemoveFromStack( iAppView ); 00063 delete iAppView; 00064 iAppView = NULL; 00065 } 00066 } 00067 00068 // ----------------------------------------------------------------------------- 00069 // CHelpExampleAppUi::HandleCommandL() 00070 // Takes care of command handling. 00071 // ----------------------------------------------------------------------------- 00072 // 00073 void CHelpExampleAppUi::HandleCommandL( TInt aCommand ) 00074 { 00075 switch ( aCommand ) 00076 { 00077 case EEikCmdExit: 00078 case EAknSoftkeyExit: 00079 Exit(); 00080 break; 00081 00082 case EShowHelpfulDialog: 00083 { 00084 CHelpfulForm* dlg = CHelpfulForm::NewL( R_FORM_MENUBAR ); 00085 dlg->ExecuteLD( R_HELPFUL_DIALOG ); 00086 } 00087 break; 00088 00089 case ELaunchHelpForContext: 00090 { 00091 CArrayFix <TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL(); 00092 HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), buf ); 00093 } 00094 break; 00095 00096 default: 00097 break; 00098 } 00099 } 00100 00101 // ----------------------------------------------------------------------------- 00102 // CArrayFix <TCoeHelpContext> 00103 // Return the help context for this application. 00104 // ----------------------------------------------------------------------------- 00105 // 00106 CArrayFix <TCoeHelpContext>* CHelpExampleAppUi::HelpContextL() const 00107 { 00108 CArrayFixFlat <TCoeHelpContext>* array = 00109 new ( ELeave )CArrayFixFlat <TCoeHelpContext> ( 1 ); 00110 CleanupStack::PushL( array ); 00111 array->AppendL( TCoeHelpContext( KUidHelpFile, KContextApplication ) ); 00112 CleanupStack::Pop( array ); 00113 return array; 00114 } 00115 00116 // End of File
|
© Nokia 2009 |