S60 3rd Edition SDK for Symbian OS
Example Applications Guide

BrCtlSampleAppUi.cpp

00001 /*
00002 * ============================================================================
00003 *  Name        : BrCtlSampleAppUi.cpp
00004 *  Part of     : BrCtlSampleApp
00005 *  Interface   : Browser Control API
00006 *  Description : The Ui class for the Browser Control Sample Application
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 "BrCtlSampleAppUi.h"
00018 #include "BrCtlSampleAppContainer.h" 
00019 #include <BrCtlSampleApp.rsg>
00020 #include "brctlsampleapp.hrh"
00021 
00022 #include <avkon.hrh>
00023 
00024 
00025 // ================= MEMBER FUNCTIONS =======================
00026 //
00027 // ----------------------------------------------------------
00028 // CBrCtlSampleAppUi::ConstructL()
00029 // ?implementation_description
00030 // ----------------------------------------------------------
00031 //
00032 void CBrCtlSampleAppUi::ConstructL()
00033     {
00034     BaseConstructL(CAknAppUi::EAknEnableSkin);
00035     iAppContainer = new (ELeave) CBrCtlSampleAppContainer;
00036     iAppContainer->SetMopParent(this);
00037     iAppContainer->ConstructL( ClientRect() );
00038     AddToStackL( iAppContainer );
00039     }
00040 
00041 // ----------------------------------------------------
00042 // CBrCtlSampleAppUi::~CBrCtlSampleAppUi()
00043 // Destructor
00044 // Frees reserved resources
00045 // ----------------------------------------------------
00046 //
00047 CBrCtlSampleAppUi::~CBrCtlSampleAppUi()
00048     {
00049     if (iAppContainer)
00050         {
00051         RemoveFromStack( iAppContainer );
00052         delete iAppContainer;
00053         }
00054 
00055    }
00056 
00057 // ------------------------------------------------------------------------------
00058 // CBrCtlSampleAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
00059 //  This function is called by the EIKON framework just before it displays
00060 //  a menu pane. Its default implementation is empty, and by overriding it,
00061 //  the application can set the state of menu items dynamically according
00062 //  to the state of application data.
00063 // ------------------------------------------------------------------------------
00064 //
00065 void CBrCtlSampleAppUi::DynInitMenuPaneL(
00066     TInt aResourceId,CEikMenuPane* aMenuPane)
00067     {
00068     iAppContainer->DynInitMenuPaneL(aResourceId, aMenuPane);
00069     }
00070 
00071 // ----------------------------------------------------
00072 // CBrCtlSampleAppUi::HandleKeyEventL(
00073 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00074 // ?implementation_description
00075 // ----------------------------------------------------
00076 //
00077 TKeyResponse CBrCtlSampleAppUi::HandleKeyEventL(
00078     const TKeyEvent& aKeyEvent,TEventCode aType)
00079     {
00080     return iAppContainer->HandleKeyEventL(aKeyEvent, aType);;
00081     }
00082 
00083 // ----------------------------------------------------
00084 // CBrCtlSampleAppUi::HandleCommandL(TInt aCommand)
00085 // ?implementation_description
00086 // ----------------------------------------------------
00087 //
00088 void CBrCtlSampleAppUi::HandleCommandL(TInt aCommand)
00089     {
00090     switch ( aCommand )
00091         {
00092         case EAknSoftkeyBack:
00093         case EEikCmdExit:
00094             {
00095             Exit();
00096             break;
00097             }
00098 
00099         default:
00100             iAppContainer->HandleCommandL(aCommand);
00101             break;      
00102         }
00103     }
00104 
00105 // End of File  
00106 

© Nokia 2006

Back to top