Nokia N97 SDK
Example Applications Guide

SimpleCubePixmapAppUi.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : SimpleCubePixmapAppUi.cpp
00004 *  Part of     : SimpleCubePixmap
00005 *
00006 *  Copyright (c) 2004-2007 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 
00014 // INCLUDE FILES
00015 #include "SimpleCubePixmapAppUi.h"
00016 #include "SimpleCubePixmapContainer.h" 
00017 #include <SimpleCubePixmap.rsg>
00018 #include "simplecubepixmap.hrh"
00019 
00020 #include <avkon.hrh>
00021 
00022 // ================= MEMBER FUNCTIONS =======================
00023 //
00024 // ----------------------------------------------------------
00025 // CSimpleCubePixmapAppUi::ConstructL
00026 // 
00027 // ----------------------------------------------------------
00028 //
00029 void CSimpleCubePixmapAppUi::ConstructL()
00030     {
00031     BaseConstructL();
00032 
00033     iAppContainer = new (ELeave) CSimpleCubePixmapContainer;
00034     iAppContainer->SetMopParent( this );
00035    iAppContainer->ConstructL( ClientRect(), this );
00036     AddToStackL( iAppContainer );
00037     }
00038 
00039 // ----------------------------------------------------
00040 // CSimpleCubePixmapAppUi::~CSimpleCubePixmapAppUi
00041 // Destructor
00042 // Frees reserved resources
00043 // ----------------------------------------------------
00044 //
00045 CSimpleCubePixmapAppUi::~CSimpleCubePixmapAppUi()
00046     {
00047     if ( iAppContainer )
00048         {
00049         RemoveFromStack( iAppContainer );
00050         delete iAppContainer;
00051         }
00052    }
00053 
00054 // ------------------------------------------------------------------------------
00055 // CSimpleCubePixmapAppUi::DynInitMenuPaneL
00056 //  This function is called by the EIKON framework just before it displays
00057 //  a menu pane. Its default implementation is empty, and by overriding it,
00058 //  the application can set the state of menu items dynamically according
00059 //  to the state of application data.
00060 // ------------------------------------------------------------------------------
00061 //
00062 void CSimpleCubePixmapAppUi::DynInitMenuPaneL(
00063     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00064     {
00065     }
00066 
00067 // ----------------------------------------------------
00068 // CSimpleCubePixmapAppUi::HandleKeyEventL
00069 // takes care of key event handling
00070 // ----------------------------------------------------
00071 //
00072 TKeyResponse CSimpleCubePixmapAppUi::HandleKeyEventL(
00073     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
00074     {
00075     return EKeyWasNotConsumed;
00076     }
00077 
00078 // ----------------------------------------------------
00079 // CSimpleCubePixmapAppUi::HandleCommandL
00080 // takes care of command handling
00081 // ----------------------------------------------------
00082 //
00083 void CSimpleCubePixmapAppUi::HandleCommandL(TInt aCommand)
00084     {
00085     switch ( aCommand )
00086         {
00087         case EAknSoftkeyBack:
00088         case EEikCmdExit:
00089             {
00090             Exit();
00091             break;
00092             }
00093         case ESimpleCubeFlat:
00094                 iAppContainer->iSimpleCubePixmap->FlatShading();
00095                 break; 
00096         case ESimpleCubeSmooth:
00097                 iAppContainer->iSimpleCubePixmap->SmoothShading();
00098                 break;
00099         default:
00100             break;      
00101         }
00102     }
00103 
00104 // End of File  

© Nokia 2009

Back to top