Nokia N97 SDK
Example Applications Guide

Slideshowappui.cpp

00001 /*
00002  * ==============================================================================
00003  *  Name        : Slideshowappui.cpp
00004  *  Part of     : OpenGLEx / Slideshow
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 "SlideshowAppUi.h"
00015 #include "SlideshowContainer.h"
00016 #include <Slideshow.rsg>
00017 #include "slideshow.hrh"
00018 
00019 #include <avkon.hrh>
00020 
00021 // ================= MEMBER FUNCTIONS =======================
00022 //
00023 // ----------------------------------------------------------
00024 // CSlideshowAppUi::ConstructL()
00025 // ----------------------------------------------------------
00026 //
00027 void CSlideshowAppUi::ConstructL()
00028     {
00029     BaseConstructL();
00030     iAppContainer = new (ELeave) CSlideshowContainer;
00031     iAppContainer->SetMopParent(this);
00032     iAppContainer->ConstructL( ClientRect(), this );
00033     AddToStackL( iAppContainer );
00034     }
00035 
00036 // ----------------------------------------------------
00037 // CSlideshowAppUi::~CSlideshowAppUi()
00038 // Destructor. Frees any reserved resources.
00039 // ----------------------------------------------------
00040 //
00041 CSlideshowAppUi::~CSlideshowAppUi()
00042         {
00043     if ( iAppContainer )
00044                 {
00045         RemoveFromStack( iAppContainer );
00046         delete iAppContainer;
00047                 }
00048         }
00049 
00050 // ------------------------------------------------------------------------------
00051 // CSlideshowAppUi::::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 CSlideshowAppUi::DynInitMenuPaneL(
00059     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00060     {
00061     }
00062 
00063 // ----------------------------------------------------
00064 // CSlideshowAppUi::HandleKeyEventL(
00065 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00066 // ----------------------------------------------------
00067 //
00068 TKeyResponse CSlideshowAppUi::HandleKeyEventL(
00069     const TKeyEvent& aKeyEvent,TEventCode aType)
00070     {
00071     if (aType == EEventKey)
00072         {
00073         switch (aKeyEvent.iScanCode)
00074             {
00075             case EStdKeyLeftArrow:
00076                 iAppContainer->iSlideshow->ShowPreviousPicture();
00077                 break;
00078             case EStdKeyRightArrow:
00079                 iAppContainer->iSlideshow->ShowNextPicture();
00080                 break;
00081             }
00082         }
00083     return EKeyWasNotConsumed;
00084     }
00085 
00086 // ----------------------------------------------------
00087 // CSlideshowAppUi::HandleCommandL(TInt aCommand)
00088 // ----------------------------------------------------
00089 //
00090 void CSlideshowAppUi::HandleCommandL(TInt aCommand)
00091     {
00092     switch ( aCommand )
00093         {
00094         case EAknSoftkeyBack:
00095         case EEikCmdExit:
00096             {
00097             Exit();
00098             break;
00099             }
00100         default:
00101             break;
00102         }
00103     }
00104 
00105 // End of File

© Nokia 2009

Back to top