S60 3rd Edition SDK for Symbian OS
Example Applications Guide

LmUiRefAppUi.cpp

00001 /*
00002 * ============================================================================
00003 *  Name        : LmUiRefAppUi.cpp 
00004 *  Part of     : Landmarks UI Reference Application 
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 "LmUiRefAppDocument.h"
00018 #include "LmUiRefAppUi.h"
00019 #include <lmuirefapp.rsg>
00020 #include "lmuirefapp.hrh"
00021 #include <avkon.hrh>
00022 #include <AknViewAppUi.h>
00023 #include "LmUiRefAppView.h"
00024 #include <AknsUtils.h>
00025 
00026 
00027 
00028 
00029 // ================= MEMBER FUNCTIONS =======================
00030 //
00031 // ----------------------------------------------------------
00032 // CLmUiRefAppUi::ConstructL() 
00033 // Symbian 2nd phase constructor can leave.
00034 // ----------------------------------------------------------
00035 //
00036 void CLmUiRefAppUi::ConstructL()
00037     {
00038     BaseConstructL(EAknEnableSkin);
00039     CLmUiRefAppView* lmView =   CLmUiRefAppView::NewLC();
00040     AddViewL(lmView); // Transfer Ownership
00041     CleanupStack::Pop();
00042     SetDefaultViewL(*lmView);
00043     }
00044 
00045 // ----------------------------------------------------
00046 // CLmUiRefAppUi::~CLmUiRefAppUi:()
00047 // Destructor Frees reserved resources
00048 // ----------------------------------------------------
00049 //
00050 CLmUiRefAppUi::~CLmUiRefAppUi()
00051    {
00052 
00053    }
00054 
00055 //------------------------------------------------------------------------------
00056 // CLmUiRefAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
00057 //  This function is called by the EIKON framework just before it displays
00058 //  a menu pane. Its default implementation is empty, and by overriding it,
00059 //  the application can set the state of menu items dynamically according
00060 //  to the state of application data.
00061 //------------------------------------------------------------------------------
00062 //
00063 void CLmUiRefAppUi::DynInitMenuPaneL(
00064     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00065     {
00066     }
00067 
00068 // ----------------------------------------------------
00069 // CLmUiRefAppUi::HandleKeyEventL(
00070 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00071 // Handles key events. It is called by HandleWsEventL()
00072 // when a key press event occurs
00073 // ----------------------------------------------------
00074 //
00075 TKeyResponse CLmUiRefAppUi::HandleKeyEventL(
00076     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
00077     {
00078     return EKeyWasNotConsumed;
00079     }
00080 
00081 // ----------------------------------------------------
00082 // CLmkAppUi::Document
00083 // ----------------------------------------------------
00084 //
00085 CLmUiRefAppDocument& CLmUiRefAppUi::Document() const
00086     {
00087     // Explicit cast: the document must always be of type CLmkDocument
00088     CLmUiRefAppDocument* document =
00089         static_cast<CLmUiRefAppDocument*>( CEikAppUi::Document() );
00090     
00091     return *document;
00092     }
00093 
00094 
00095 // ----------------------------------------------------
00096 // CLmUiRefAppUi::HandleCommandL(TInt aCommand)
00097 // Handles commands defined in resource files
00098 // ----------------------------------------------------
00099 //
00100 void CLmUiRefAppUi::HandleCommandL(TInt aCommand)
00101     {
00102     switch ( aCommand )
00103         {
00104         // these all are same: exit
00105         case EAknSoftkeyBack:
00106         case EAknSoftkeyExit:
00107         case EEikCmdExit:
00108             {
00109                 Exit();
00110                 break;
00111             }
00112         default:
00113             break;      
00114         }
00115     }
00116 
00117 // End of File  

© Nokia 2006

Back to top