CFLDFileListModel Class Reference

class CFLDFileListModel : public CBase

This class implements a model of a file list. The class is inherited from MDesCArray, so it can be used directly as a model for a listbox.

filelist.lib
Since
2.1

Inherits from

Public Member Functions
~CFLDFileListModel()
voidAddExclusiveMediaTypeL(const TInt32)
voidAddExclusiveMimeTypeL(const TDesC &)
TInt FindFileL(const TDesC &)
voidGetFileName(TDes &, const TInt)
CFLDPopupList *GetPopupList()
voidInsertEndNullItemL(const TDesC &)
voidInsertEndNullItemL(const TDesC &, const TDesC &)
voidInsertNullItemL(const TDesC &)
voidInsertNullItemL(const TDesC &, const TDesC &)
TInt32 MediaFileType(const TDesC &)
CFLDFileListModel *NewL(const TInt, const TInt)
CFLDFileListModel *NewLC(const TInt, const TInt)
voidRefreshEntryListL()
voidResetExclusiveMediaTypes()
voidResetExclusiveMimeTypes()
voidSetEntryFormatter(MFLDEntryFormatter *)
voidSetMaxFileSize(const TInt)
voidSetPopupList(CFLDPopupList *)
voidSetWantedMediaTypesL(const TArray< TCLFMediaType > &)
voidSetWantedMimeTypesL(const MDesCArray &)
Private Member Functions
CFLDFileListModel()
TInt AddDirectoryL(const TDesC &)
TInt AddRomDirectoryL(const TDesC &)
TBool CheckRules(TPtrC &, TInt32, TPtrC &)
TInt CheckToneFileSizeL(const TDesC &, TInt)
voidConstructL(const TInt, const TInt)
voidFilterItemsL(const TArray< MCLFItem * > &, RPointerArray< MCLFItem > &)
voidGetFileNameAtIndex(TInt, TDes &)
voidLoadDirectoriesL(const TInt)
TInt MdcaCount()
TPtrC16 MdcaPoint(TInt)
voidPopulateListBoxL()
voidPopulateReferenceListL()
voidScanRomDirectoriesAndInsertL()
voidScanRomDirectoriesL()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CFLDChangedItemObserver *iChangedItemObserver
CDesCArraySeg iDirectoryPaths
RPointerArray< HBufC >iEndNullTextArray
RPointerArray< HBufC >iEndNullTextRingingToneArray
MCLFContentListingEngine *iEngine
MFLDEntryFormatter *iEntryFormatter
RPointerArray< CFLDEntryReference >iEntryReferences
RArray< TInt32 >iExclusiveMediaTypes
CDesCArraySeg iExclusiveMimeTypes
TInt iMaxFileSize
MCLFItemListModel *iModel
RPointerArray< HBufC >iNullTextArray
RPointerArray< HBufC >iNullTextRingingToneArray
CFLDOperationObserver *iObserver
CFLDPopupList *iPopupList
CDesCArraySeg iRomDirectoryPaths
RPointerArray< MCLFModifiableItem >iRomRingingToneArray
TBool iRomTonesOnly
CActiveSchedulerWait iWait
CFLDWaitNote *iWaitNote

Constructor & Destructor Documentation

CFLDFileListModel()

CFLDFileListModel()[private]

Constructor

~CFLDFileListModel()

~CFLDFileListModel()[virtual]

Destructor.

Member Functions Documentation

AddDirectoryL(const TDesC &)

TInt AddDirectoryL(const TDesC &aDirectory)[private]

Adds directory into iDirectoryPaths

Parameters

const TDesC & aDirectoryDirectory to be scanned

AddExclusiveMediaTypeL(const TInt32)

voidAddExclusiveMediaTypeL(const TInt32aMediaType)

Adds a new media type into blocking list.

Parameters

const TInt32 aMediaTypeThe blocked media type (see TCLFMediaType enumeration inside CFLContentListing.hrh)

AddExclusiveMimeTypeL(const TDesC &)

voidAddExclusiveMimeTypeL(const TDesC &aMimeType)

Adds a new MIME type into blocking list.

Parameters

const TDesC & aMimeTypeThe blocked MIME type

AddRomDirectoryL(const TDesC &)

TInt AddRomDirectoryL(const TDesC &aDirectory)[private]

Adds directory into iRomDirectoryPaths

Parameters

const TDesC & aDirectoryDirectory to be scanned

CheckRules(TPtrC &, TInt32, TPtrC &)

TBool CheckRules(TPtrC &aMimeType,
TInt32aMediaType,
TPtrC &aPathAndFileName
)[private]

Parameters

TPtrC & aMimeType
TInt32 aMediaType
TPtrC & aPathAndFileName

CheckToneFileSizeL(const TDesC &, TInt)

TInt CheckToneFileSizeL(const TDesC &aFile,
TIntaSizeLimit
)[private]

Checks ringing tone file size.

Parameters

const TDesC & aFilefile to check.
TInt aSizeLimitmaximum allowed file size in bytes.

ConstructL(const TInt, const TInt)

voidConstructL(const TIntaModelResourceId,
const TIntaDirectoriesResourceId
)[private]

Second phase constructor

Parameters

const TInt aModelResourceIdA CLF model resource, see CLFContentListing.rh
const TInt aDirectoriesResourceIdA resource using FILELISTDIRECTORIES structure, see FileListModel.rh for details

FilterItemsL(const TArray< MCLFItem * > &, RPointerArray< MCLFItem > &)

voidFilterItemsL(const TArray< MCLFItem * > &aItemList,
RPointerArray< MCLFItem > &aFilteredItemList
)[private]

Parameters

const TArray< MCLFItem * > & aItemList
RPointerArray< MCLFItem > & aFilteredItemList

FindFileL(const TDesC &)

TInt FindFileL(const TDesC &aFileName)

Find a file from the model's list

Parameters

const TDesC & aFileNameThe file name to be searched

GetFileName(TDes &, const TInt)

voidGetFileName(TDes &aFileName,
const TIntaIndex
)

Retrieves a full path of an entry (e.g. "c:\folder\file.ext")

Parameters

TDes & aFileNameA modifiable descriptor where the path and filename is placed, or KNullDesc if aIndex points to the null text item. Note: aFileName.Length() >= KMaxFileName
const TInt aIndexIndex of the entry to retrieve

GetFileNameAtIndex(TInt, TDes &)

voidGetFileNameAtIndex(TIntaIndex,
TDes &aFileName
)const [private]

Gets a filename at specific index.

Parameters

TInt aIndexIndex of the file (whole list is indexed)
TDes & aFileNameDescriptor where the filename is stored.

GetPopupList()

CFLDPopupList *GetPopupList()

Returns PopupList.

InsertEndNullItemL(const TDesC &)

voidInsertEndNullItemL(const TDesC &aItemText)

Adds a text (e.g. "None") as the last item of the list, which will not be sorted among the file name items.

Parameters

const TDesC & aItemTextA descriptor containing the null item text

InsertEndNullItemL(const TDesC &, const TDesC &)

voidInsertEndNullItemL(const TDesC &aItemText,
const TDesC &aFileName
)

Adds a text (e.g. "None") as the last item of the list, which will not be sorted among the file name items.

Parameters

const TDesC & aItemTextA descriptor containing the null item text
const TDesC & aFileNameA descriptor containing the ringing tone file name form null item

InsertNullItemL(const TDesC &)

voidInsertNullItemL(const TDesC &aItemText)

Adds a text (e.g. "None") as the first item of the list, which will not be sorted among the file name items.

Parameters

const TDesC & aItemTextA descriptor containing the null item text

InsertNullItemL(const TDesC &, const TDesC &)

voidInsertNullItemL(const TDesC &aItemText,
const TDesC &aFileName
)

Adds a text (e.g. "None") as the first item of the list, which will not be sorted among the file name items.

Parameters

const TDesC & aItemTextA descriptor containing the null item text
const TDesC & aFileNameA descriptor containing the ringing tone file name form null item

LoadDirectoriesL(const TInt)

voidLoadDirectoriesL(const TIntaDirectoriesResourceId)[private]

Loads directories from resource file

Parameters

const TInt aDirectoriesResourceIdResource ID to directory structure

MdcaCount()

TInt MdcaCount()const [private]

MdcaPoint(TInt)

TPtrC16 MdcaPoint(TIntaIndex)const [private]

Parameters

TInt aIndex

MediaFileType(const TDesC &)

TInt32 MediaFileType(const TDesC &aFileName)const

Returns file media type

Parameters

const TDesC & aFileNameA descriptor containing the media file name

NewL(const TInt, const TInt)

CFLDFileListModel *NewL(const TIntaModelResourceId,
const TIntaDirectoriesResourceId
)[static]

Two-phased static constructor.

Parameters

const TInt aModelResourceIdA CLF model resource, see CLFContentListing.rh
const TInt aDirectoriesResourceIdA resource using FILELISTDIRECTORIES structure, see FileListModel.rh for details

NewLC(const TInt, const TInt)

CFLDFileListModel *NewLC(const TIntaModelResourceId,
const TIntaDirectoriesResourceId
)[static]

Two-phased static constructor.

Parameters

const TInt aModelResourceIdA CLF model resource, see CLFContentListing.rh
const TInt aDirectoriesResourceIdA resource using FILELISTDIRECTORIES structure, see FileListModel.rh for details

PopulateListBoxL()

voidPopulateListBoxL()[private]

List all files from the list model to the list box.

PopulateReferenceListL()

voidPopulateReferenceListL()[private]

Fill the entry reference list according to the added directories list and filtering parameters

RefreshEntryListL()

voidRefreshEntryListL()

Refreshes the file list.

ResetExclusiveMediaTypes()

voidResetExclusiveMediaTypes()

Removes all the defined exlusive media types

ResetExclusiveMimeTypes()

voidResetExclusiveMimeTypes()

Removes all the defined exlusive MIME types

ScanRomDirectoriesAndInsertL()

voidScanRomDirectoriesAndInsertL()[private]

Scans user defined Rom directories and adds found entries into iRomRingingToneArray

ScanRomDirectoriesL()

voidScanRomDirectoriesL()[private]

Scans user defined Rom directories and adds found entries into iRomRingingToneArray

SetEntryFormatter(MFLDEntryFormatter *)

voidSetEntryFormatter(MFLDEntryFormatter *aFormatter)

Sets an MFLDEntryFormatter inherited for the model. Ownership of the given object is transferred to CFLDFileListModel.

Parameters

MFLDEntryFormatter * aFormatterA pointer to a MFLDEntryFormatter inherited object.

SetMaxFileSize(const TInt)

voidSetMaxFileSize(const TIntaMaxFileSize)

Sets the maximum file size for the list.

Parameters

const TInt aMaxFileSizeThe maximum file size in bytes. If you want to allow all file sizes, set this to KFLDNoSizeFiltering (defined in FileListModel.hrh).

SetPopupList(CFLDPopupList *)

voidSetPopupList(CFLDPopupList *aPopupList)

Sets popup list to Model. Needed to update the listbox after the model has changed (e.g. after inserting a memory card).

Parameters

CFLDPopupList * aPopupListThe popup list

SetWantedMediaTypesL(const TArray< TCLFMediaType > &)

voidSetWantedMediaTypesL(const TArray< TCLFMediaType > &aMediaTypes)

Sets wanted media types. Overrides all settings defined inside resource, defined with AddExclusive -methods or with SetWanted -methods.

Parameters

const TArray< TCLFMediaType > & aMediaTypesThe array containing wanted media types

SetWantedMimeTypesL(const MDesCArray &)

voidSetWantedMimeTypesL(const MDesCArray &aMimeTypes)

Sets wanted mime types. Overrides all settings defined inside resource, defined with AddExclusive -methods or with SetWanted -methods.

Parameters

const MDesCArray & aMimeTypesThe array containing wanted MIME types

Member Data Documentation

CFLDChangedItemObserver * iChangedItemObserver

CFLDChangedItemObserver *iChangedItemObserver[private]

CDesCArraySeg iDirectoryPaths

CDesCArraySeg iDirectoryPaths[private]

Contains descriptors containing the user-defined phone directory paths

RPointerArray< HBufC > iEndNullTextArray

RPointerArray< HBufC >iEndNullTextArray[private]

RPointerArray< HBufC > iEndNullTextRingingToneArray

RPointerArray< HBufC >iEndNullTextRingingToneArray[private]

MCLFContentListingEngine * iEngine

MCLFContentListingEngine *iEngine[private]

MFLDEntryFormatter * iEntryFormatter

MFLDEntryFormatter *iEntryFormatter[private]

RPointerArray< CFLDEntryReference > iEntryReferences

RPointerArray< CFLDEntryReference >iEntryReferences[private]

Contains references to all the entries. This is the list that gets sorted and filtered

RArray< TInt32 > iExclusiveMediaTypes

RArray< TInt32 >iExclusiveMediaTypes[private]

CDesCArraySeg iExclusiveMimeTypes

CDesCArraySeg iExclusiveMimeTypes[private]

TInt iMaxFileSize

TInt iMaxFileSize[private]

MCLFItemListModel * iModel

MCLFItemListModel *iModel[private]

RPointerArray< HBufC > iNullTextArray

RPointerArray< HBufC >iNullTextArray[private]

RPointerArray< HBufC > iNullTextRingingToneArray

RPointerArray< HBufC >iNullTextRingingToneArray[private]

CFLDOperationObserver * iObserver

CFLDOperationObserver *iObserver[private]

CFLDPopupList * iPopupList

CFLDPopupList *iPopupList[private]

CDesCArraySeg iRomDirectoryPaths

CDesCArraySeg iRomDirectoryPaths[private]

Contains descriptors containing the user-defined ROM directory paths

RPointerArray< MCLFModifiableItem > iRomRingingToneArray

RPointerArray< MCLFModifiableItem >iRomRingingToneArray[private]

TBool iRomTonesOnly

TBool iRomTonesOnly[private]

CActiveSchedulerWait iWait

CActiveSchedulerWait iWait[private]

CFLDWaitNote * iWaitNote

CFLDWaitNote *iWaitNote[private]