⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filebrowserview.cpp

📁 《基于Symbian OS的手机开发与应用实践》这本书的配套源码。
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CFileBrowserView from FileBrowserView.h
*  Part of  : FileBrowser
*  Created  : 03.05.2005 by ToBeReplacedByAuthorXinyu
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyrightNone
* ============================================================================
*/

// INCLUDE FILES
#include  <aknviewappui.h>
#include  <avkon.hrh>
#include  <FileBrowser.rsg>
#include  "FileBrowserView.h"
#include  "FileBrowserContainer.h" 

// ================= MEMBER FUNCTIONS =======================

// ---------------------------------------------------------
// CFileBrowserView::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CFileBrowserView::ConstructL()
    {
    BaseConstructL( R_FILEBROWSER_VIEW1 );
    }

// ---------------------------------------------------------
// CFileBrowserView::~CFileBrowserView()
// destructor
// ---------------------------------------------------------
//
CFileBrowserView::~CFileBrowserView()
    {
    if ( iContainer )
        {
        AppUi()->RemoveFromViewStack( *this, iContainer );
        }

    delete iContainer;
    }

// ---------------------------------------------------------
// TUid CFileBrowserView::Id()
//
// ---------------------------------------------------------
//
TUid CFileBrowserView::Id() const
    {
    return KViewId;
    }

// ---------------------------------------------------------
// CFileBrowserView::HandleCommandL(TInt aCommand)
// takes care of view command handling
// ---------------------------------------------------------
//
void CFileBrowserView::HandleCommandL(TInt aCommand)
    {   
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
            {
            iContainer->HandleCommandL(EAknSoftkeyBack);
            break;
            }
        default:
            {
            AppUi()->HandleCommandL( aCommand );
            break;
            }
        }
    }

// ---------------------------------------------------------
// CFileBrowserView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CFileBrowserView::HandleClientRectChange()
    {
    if ( iContainer )
        {
        iContainer->SetRect( ClientRect() );
        }
    }

// ---------------------------------------------------------
// CFileBrowserView::DoActivateL(...)
// 
// ---------------------------------------------------------
//
void CFileBrowserView::DoActivateL(
   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/)
    {
    if (!iContainer)
        {
        iContainer = new (ELeave) CFileBrowserContainer;
        iContainer->SetMopParent(this);
        iContainer->ConstructL( ClientRect() );
        AppUi()->AddToStackL( *this, iContainer );
        } 
   }

// ---------------------------------------------------------
// CFileBrowserView::DoDeactivate()
// 
// ---------------------------------------------------------
//
void CFileBrowserView::DoDeactivate()
    {
    if ( iContainer )
        {
        AppUi()->RemoveFromViewStack( *this, iContainer );
        }
    
    delete iContainer;
    iContainer = NULL;
    }

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -