Nokia N97 SDK
Example Applications Guide

RainAppUi.cpp

00001 /*
00002  * ==============================================================================
00003  *  Name        : RainAppUi.cpp
00004  *  Part of     : OpenGLEx / Rain
00005  *
00006  *  Copyright (c) 2005-2006 Nokia Corporation.
00007  *  This material, including documentation and any related
00008  *  computer programs, is protected by copyright controlled by
00009  *  Nokia Corporation.
00010  * ==============================================================================
00011  */
00012 
00013 // INCLUDE FILES
00014 #include "RainAppUi.h"
00015 #include "RainContainer.h"
00016 #include <Rain.rsg>
00017 #include "rain.hrh"
00018 
00019 #include <avkon.hrh>
00020 
00021 // ================= MEMBER FUNCTIONS =======================
00022 //
00023 // ----------------------------------------------------------
00024 // CRainAppUi::ConstructL()
00025 // ----------------------------------------------------------
00026 //
00027 void CRainAppUi::ConstructL()
00028     {
00029     BaseConstructL();
00030     iAppContainer = new (ELeave) CRainContainer;
00031     iAppContainer->SetMopParent(this);
00032     iAppContainer->ConstructL( ClientRect(), this );
00033     AddToStackL( iAppContainer );
00034     }
00035 
00036 // ----------------------------------------------------
00037 // CRainAppUi::~CRainAppUi()
00038 // Destructor. Frees any reserved resources.
00039 // ----------------------------------------------------
00040 //
00041 CRainAppUi::~CRainAppUi()
00042         {
00043     if ( iAppContainer )
00044                 {
00045         RemoveFromStack( iAppContainer );
00046         delete iAppContainer;
00047                 }
00048         }
00049 
00050 // ------------------------------------------------------------------------------
00051 // CRainAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
00052 //  This function is called by the EIKON framework just before it displays
00053 //  a menu pane. Its default implementation is empty, and by overriding it,
00054 //  the application can set the state of menu items dynamically according
00055 //  to the state of application data.
00056 // ------------------------------------------------------------------------------
00057 //
00058 void CRainAppUi::DynInitMenuPaneL(
00059     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00060     {
00061     }
00062 
00063 // ----------------------------------------------------
00064 // CRainAppUi::HandleKeyEventL(
00065 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00066 // ----------------------------------------------------
00067 //
00068 TKeyResponse CRainAppUi::HandleKeyEventL(
00069     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
00070     {
00071     return EKeyWasNotConsumed;
00072     }
00073 
00074 // ----------------------------------------------------
00075 // CRainAppUi::HandleCommandL(TInt aCommand)
00076 // ----------------------------------------------------
00077 //
00078 void CRainAppUi::HandleCommandL(TInt aCommand)
00079     {
00080     switch ( aCommand )
00081         {
00082         case EAknSoftkeyBack:
00083         case EEikCmdExit:
00084             {
00085             Exit();
00086             break;
00087             }
00088         default:
00089             break;
00090         }
00091     }
00092 
00093 // End of File

© Nokia 2009

Back to top