filelistengine.h

来自「FileList_Example 是s60的一个文件列表控件」· C头文件 代码 · 共 146 行

H
146
字号
/*
* ============================================================================
*  Name     : CFileListEngine from FileListEngine.h
*  Part of  : FileList
*  Created  : 04.11.2006 by Forum Nokia
*  Description:
*     Engine for constructing filelist.
*  Version  : 2.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

#ifndef FILELISTENGINE_H
#define FILELISTENGINE_H

#include <coecntrl.h>
#include <f32file.h>        // for CDir
#include <badesca.h>        // for CDesCArray
#include <apmstd.h>         // for TDataType
#ifdef __SERIES60_30__
#include <aknserverapp.h> 
#else
#include <apparc.h>
#endif

class CDocumentHandler;
class CEikProcess;

class CFileListEngine : public CCoeControl,
#ifdef __SERIES60_30__
	public MAknServerAppExitObserver
#else
	public MApaEmbeddedDocObserver
#endif
    {
    public: // // Constructors and destructor

        /**
        * Symbian default constructor.
        */      
        void ConstructL(CEikProcess* aProcess = NULL);

        /**
        * Destructor.
        */      
        ~CFileListEngine();

    public: // New functions

// ---------------------------------------------------------
// CFileListEngine::StartFileList()
// This Method gets the specific directory.
// In the 1st edition use harcoded paths and the S60 2nd and 3rd edition 
// get the specific path using PathInfo.
// ---------------------------------------------------------
//
        TInt StartFileList();

// ---------------------------------------------------------
// CFileListEngine::GetFileListItems(CDesCArray* aItems)
// This Method constructs the listbox items with directory 
// information
// ---------------------------------------------------------
//
        void GetFileListItemsL(CDesCArray* iItems);

// ---------------------------------------------------------
// CFileListEngine::SetDirectory(TInt aDirectory)
// This Method sets which directory to list.
// ---------------------------------------------------------
//
        void SetDirectory(TInt aDirectory);

// ---------------------------------------------------------
// CFileListEngine::SetSizeDate(TInt aSizeDate)
// This Method sets whether modification date or file size 
// is shown. There is also option for toggling the status.
// ---------------------------------------------------------
//
        void SetSizeDate(TInt aSizeDate);

// ---------------------------------------------------------
// CFileListEngine::EndFileList()
// This Method ends the FileList session
// ---------------------------------------------------------
//
        void EndFileList();

// ---------------------------------------------------------
// CFileListEngine::RemoveItems(CDesCArray* aItems)
// This Method removes all listbox items when a new list 
// needs to be shown.
// ---------------------------------------------------------
//
        TBool RemoveItems(CDesCArray* aItems);

// ---------------------------------------------------------
// CFileListEngine::LaunchCurrent(TInt aPosition)
// This Method launches selected item with DocumentHandler.
// DocumentHandler will launch correct application depending 
// on the file type.
// Note that all the extensions do not work on emulator.
// ---------------------------------------------------------
//
        void LaunchCurrentL(TInt aPosition);
        
// ---------------------------------------------------------
// CFileListEngine::IsDirListEmpty()
// ---------------------------------------------------------      
        TBool IsDirListEmpty();
        
// ---------------------------------------------------------
// CFileListEngine::GetResourceFilesL ( TFileName &aBasePath )
// The method get all files including files into subfolders.
// ---------------------------------------------------------
//
        void GetResourceFilesL ( TFileName &aBasePath );
        
// ---------------------------------------------------------
       
#ifdef __SERIES60_30__
	void HandleServerAppExit(TInt aReason);
#else
	void NotifyExit(TExitMode aMode);
#endif

    private: //Data
        // Define local CDir variable
        RArray<TEntry> iFileList;
        RArray<TFileName> iDirList;

        // Fileserver session
        RFs iFsSession;
  
    private: // variables
        // Which directory to show
        TInt iDirectory;    
        // Show date or size?
        TInt iSizeDate;     
		TBool iDocEmbedded;
		CDocumentHandler *iDocHandler;
    };
#endif

// End of File

⌨️ 快捷键说明

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