S60 3rd Edition SDK for Symbian OS
Example Applications Guide

FilelistAppui.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : FilelistAppui.cpp
00004 *  Part of     : Filelist
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 "FilelistAppui.h"
00018 #include "FilelistContainer.h" 
00019 #include <Filelist.rsg>
00020 #include "Filelist.hrh"
00021 
00022 #include <avkon.hrh>
00023 
00024 // ================= MEMBER FUNCTIONS ==========================================
00025 
00026 // -----------------------------------------------------------------------------
00027 // CFilelistAppUi::ConstructL()
00028 // Symbian two phased constructor
00029 // -----------------------------------------------------------------------------
00030 //
00031 void CFilelistAppUi::ConstructL()
00032     {
00033     BaseConstructL( CAknAppUi::EAknEnableSkin );
00034     iAppContainer = CFilelistContainer::NewL( ClientRect() );
00035     AddToStackL( iAppContainer );
00036     }
00037 
00038 // -----------------------------------------------------------------------------
00039 // CFilelistAppUi::~CFilelistAppUi()
00040 // Destructor
00041 // Frees reserved resources
00042 // -----------------------------------------------------------------------------
00043 //
00044 CFilelistAppUi::~CFilelistAppUi()
00045     {
00046     if ( iAppContainer )
00047         {
00048         RemoveFromStack( iAppContainer );
00049         delete iAppContainer;
00050         iAppContainer = NULL;
00051         }
00052    }
00053 
00054 // -----------------------------------------------------------------------------
00055 // CFilelistAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
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 CFilelistAppUi::DynInitMenuPaneL(
00063     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00064     {
00065     // no implementation required 
00066     }
00067 
00068 // -----------------------------------------------------------------------------
00069 // CFilelistAppUi::HandleKeyEventL(
00070 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00071 // takes care of key event handling
00072 // -----------------------------------------------------------------------------
00073 //
00074 TKeyResponse CFilelistAppUi::HandleKeyEventL(
00075     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/ )
00076     {
00077     return EKeyWasNotConsumed;
00078     }
00079 
00080 // -----------------------------------------------------------------------------
00081 // CFilelistAppUi::HandleCommandL(TInt aCommand)
00082 // takes care of command handling
00083 // -----------------------------------------------------------------------------
00084 //
00085 void CFilelistAppUi::HandleCommandL( TInt aCommand )
00086     {
00087     switch ( aCommand )
00088         {
00089         case EAknSoftkeyExit:
00090         case EEikCmdExit:
00091             {
00092             Exit();
00093             break;
00094             }
00095         case EFilelistCmdAppPrivFolder1:
00096             {
00097             iAppContainer->ChangePrivateFolderL( EPrivateFolder1 );
00098             break;
00099             }
00100        case EFilelistCmdAppPrivFolder2:
00101             {
00102             iAppContainer->ChangePrivateFolderL( EPrivateFolder2 );
00103             break;
00104             }
00105         case EFilelistCmdAppProtFolder:
00106             {
00107             iAppContainer->ChangeProtectedFolderL();
00108             break;
00109             }
00110         default:
00111             break;      
00112         }
00113     }
00114 
00115 // -----------------------------------------------------------------------------
00116 // CFilelistAppUi::HandleResourceChangeL( TInt aType )
00117 // Called by framework when layout is changed.
00118 // -----------------------------------------------------------------------------
00119 //
00120 void CFilelistAppUi::HandleResourceChangeL( TInt aType )
00121     {
00122     CAknAppUi::HandleResourceChangeL( aType );
00123 
00124     // ADDED FOR SCALABLE UI SUPPORT
00125     // *****************************
00126     if ( aType==KEikDynamicLayoutVariantSwitch )
00127         {
00128         iAppContainer->SetRect( ClientRect() );
00129         }
00130     //Controls derived from CCoeControl, handled in container class
00131     iAppContainer->HandleResourceChange( aType );
00132     }
00133 // End of File  

© Nokia 2006

Back to top