www.pudn.com > FileList_v1_0.zip > FileListAppUi.cpp


/* 
* ============================================================================ 
*  Name     : CFileListAppUi from FileListAppUi.cpp 
*  Part of  : FileList 
*  Created  : 18.12.2002 by Forum Nokia 
*  Implementation notes: 
*     Initial content was generated by Nokia Series 60 AppWizard. 
*  Version  : 1.0 
*  Copyright: Nokia Corporation 
* ============================================================================ 
*/ 
 
// INCLUDE FILES 
#include "FileListAppUi.h" 
#include "FileListContainer.h"  
#include  
#include "filelist.hrh" 
 
#include  
 
// ================= MEMBER FUNCTIONS ======================= 
// 
// ---------------------------------------------------------- 
// CFileListAppUi::ConstructL() 
// Constructor: Creates container 
// ---------------------------------------------------------- 
// 
void CFileListAppUi::ConstructL() 
    { 
    BaseConstructL(); 
    iAppContainer = new (ELeave) CFileListContainer; 
    iAppContainer->SetMopParent(this); 
    iAppContainer->ConstructL( ClientRect() ); 
    AddToStackL( iAppContainer ); 
    } 
 
// ---------------------------------------------------- 
// CFileListAppUi::~CFileListAppUi() 
// Destructor 
// Frees reserved resources 
// ---------------------------------------------------- 
// 
CFileListAppUi::~CFileListAppUi() 
    { 
    if (iAppContainer) 
        { 
        RemoveFromStack( iAppContainer ); 
        delete iAppContainer; 
        } 
   } 
 
// ------------------------------------------------------------------------------ 
// CFileListAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) 
//  This function is called by the EIKON framework just before it displays 
//  a menu pane. Its default implementation is empty, and by overriding it, 
//  the application can set the state of menu items dynamically according 
//  to the state of application data. 
// ------------------------------------------------------------------------------ 
// 
void CFileListAppUi::DynInitMenuPaneL( 
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) 
    { 
    } 
 
// ---------------------------------------------------- 
// CFileListAppUi::HandleKeyEventL( 
//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/) 
// Handles keyevents. In this application keyevents are  
// caught in CFileListContainer::OfferKeyEventL() 
// ---------------------------------------------------- 
// 
TKeyResponse CFileListAppUi::HandleKeyEventL( 
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) 
    { 
    return EKeyWasNotConsumed; 
    } 
 
// ---------------------------------------------------- 
// CFileListAppUi::HandleCommandL(TInt aCommand) 
// Handles menu commands 
// ---------------------------------------------------- 
// 
void CFileListAppUi::HandleCommandL(TInt aCommand) 
    { 
    switch ( aCommand ) 
        { 
        case EAknSoftkeyBack: 
        case EEikCmdExit: 
            { 
            Exit(); 
            break; 
            } 
        case EFileListCmdAppTest1: 
            { 
            iAppContainer->SetFileList(EFileListDirNoChange, EFileListToggle); 
            break; 
            } 
        case EFileListCmdAppTest2: 
            { 
            iAppContainer->SetFileList(EFileListSounds, EFileListSizeDateNoChange); 
            break; 
            } 
        case EFileListCmdAppTest3: 
            { 
            iAppContainer->SetFileList(EFileListPictures, EFileListSizeDateNoChange); 
            break; 
            } 
        case EFileListCmdAppTest4: 
            { 
            iAppContainer->SetFileList(EFileListVideos, EFileListSizeDateNoChange); 
            break; 
            } 
 
        default: 
            break;       
        } 
    } 
 
// End of File