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 ()
void AddExclusiveMediaTypeL (const TInt32 )
void AddExclusiveMimeTypeL (const TDesC &)
TInt FindFileL (const TDesC &)
void GetFileName ( TDes &, const TInt )
CFLDPopupList * GetPopupList ()
void InsertEndNullItemL (const TDesC &)
void InsertEndNullItemL (const TDesC &, const TDesC &)
void InsertNullItemL (const TDesC &)
void InsertNullItemL (const TDesC &, const TDesC &)
TInt32 MediaFileType (const TDesC &)
CFLDFileListModel * NewL (const TInt , const TInt )
CFLDFileListModel * NewLC (const TInt , const TInt )
void RefreshEntryListL ()
void ResetExclusiveMediaTypes ()
void ResetExclusiveMimeTypes ()
void SetEntryFormatter ( MFLDEntryFormatter *)
void SetMaxFileSize (const TInt )
void SetPopupList (CFLDPopupList *)
void SetWantedMediaTypesL (const TArray < TCLFMediaType > &)
void SetWantedMimeTypesL (const MDesCArray &)
Private Member Functions
CFLDFileListModel ()
TInt AddDirectoryL (const TDesC &)
TInt AddRomDirectoryL (const TDesC &)
TBool CheckRules ( TPtrC &, TInt32 , TPtrC &)
TInt CheckToneFileSizeL (const TDesC &, TInt )
void ConstructL (const TInt , const TInt )
void FilterItemsL (const TArray < MCLFItem * > &, RPointerArray < MCLFItem > &)
void GetFileNameAtIndex ( TInt , TDes &)
void LoadDirectoriesL (const TInt )
TInt MdcaCount ()
TPtrC16 MdcaPoint ( TInt )
void PopulateListBoxL ()
void PopulateReferenceListL ()
void ScanRomDirectoriesAndInsertL ()
void ScanRomDirectoriesL ()
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 & aDirectory Directory to be scanned

AddExclusiveMediaTypeL(const TInt32)

void AddExclusiveMediaTypeL ( const TInt32 aMediaType )

Adds a new media type into blocking list.

Parameters

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

AddExclusiveMimeTypeL(const TDesC &)

void AddExclusiveMimeTypeL ( const TDesC & aMimeType )

Adds a new MIME type into blocking list.

Parameters

const TDesC & aMimeType The blocked MIME type

AddRomDirectoryL(const TDesC &)

TInt AddRomDirectoryL ( const TDesC & aDirectory ) [private]

Adds directory into iRomDirectoryPaths

Parameters

const TDesC & aDirectory Directory to be scanned

CheckRules(TPtrC &, TInt32, TPtrC &)

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

Parameters

TPtrC & aMimeType
TInt32 aMediaType
TPtrC & aPathAndFileName

CheckToneFileSizeL(const TDesC &, TInt)

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

Checks ringing tone file size.

Parameters

const TDesC & aFile file to check.
TInt aSizeLimit maximum allowed file size in bytes.

ConstructL(const TInt, const TInt)

void ConstructL ( const TInt aModelResourceId,
const TInt aDirectoriesResourceId
) [private]

Second phase constructor

Parameters

const TInt aModelResourceId A CLF model resource, see CLFContentListing.rh
const TInt aDirectoriesResourceId A resource using FILELISTDIRECTORIES structure, see FileListModel.rh for details

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

void FilterItemsL ( 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 & aFileName The file name to be searched

GetFileName(TDes &, const TInt)

void GetFileName ( TDes & aFileName,
const TInt aIndex
)

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

Parameters

TDes & aFileName A 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 aIndex Index of the entry to retrieve

GetFileNameAtIndex(TInt, TDes &)

void GetFileNameAtIndex ( TInt aIndex,
TDes & aFileName
) const [private]

Gets a filename at specific index.

Parameters

TInt aIndex Index of the file (whole list is indexed)
TDes & aFileName Descriptor where the filename is stored.

GetPopupList()

CFLDPopupList * GetPopupList ( )

Returns PopupList.

InsertEndNullItemL(const TDesC &)

void InsertEndNullItemL ( 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 & aItemText A descriptor containing the null item text

InsertEndNullItemL(const TDesC &, const TDesC &)

void InsertEndNullItemL ( 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 & aItemText A descriptor containing the null item text
const TDesC & aFileName A descriptor containing the ringing tone file name form null item

InsertNullItemL(const TDesC &)

void InsertNullItemL ( 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 & aItemText A descriptor containing the null item text

InsertNullItemL(const TDesC &, const TDesC &)

void InsertNullItemL ( 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 & aItemText A descriptor containing the null item text
const TDesC & aFileName A descriptor containing the ringing tone file name form null item

LoadDirectoriesL(const TInt)

void LoadDirectoriesL ( const TInt aDirectoriesResourceId ) [private]

Loads directories from resource file

Parameters

const TInt aDirectoriesResourceId Resource ID to directory structure

MdcaCount()

TInt MdcaCount ( ) const [private]

MdcaPoint(TInt)

TPtrC16 MdcaPoint ( TInt aIndex ) const [private]

Parameters

TInt aIndex

MediaFileType(const TDesC &)

TInt32 MediaFileType ( const TDesC & aFileName ) const

Returns file media type

Parameters

const TDesC & aFileName A descriptor containing the media file name

NewL(const TInt, const TInt)

CFLDFileListModel * NewL ( const TInt aModelResourceId,
const TInt aDirectoriesResourceId
) [static]

Two-phased static constructor.

Parameters

const TInt aModelResourceId A CLF model resource, see CLFContentListing.rh
const TInt aDirectoriesResourceId A resource using FILELISTDIRECTORIES structure, see FileListModel.rh for details

NewLC(const TInt, const TInt)

CFLDFileListModel * NewLC ( const TInt aModelResourceId,
const TInt aDirectoriesResourceId
) [static]

Two-phased static constructor.

Parameters

const TInt aModelResourceId A CLF model resource, see CLFContentListing.rh
const TInt aDirectoriesResourceId A resource using FILELISTDIRECTORIES structure, see FileListModel.rh for details

PopulateListBoxL()

void PopulateListBoxL ( ) [private]

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

PopulateReferenceListL()

void PopulateReferenceListL ( ) [private]

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

RefreshEntryListL()

void RefreshEntryListL ( )

Refreshes the file list.

ResetExclusiveMediaTypes()

void ResetExclusiveMediaTypes ( )

Removes all the defined exlusive media types

ResetExclusiveMimeTypes()

void ResetExclusiveMimeTypes ( )

Removes all the defined exlusive MIME types

ScanRomDirectoriesAndInsertL()

void ScanRomDirectoriesAndInsertL ( ) [private]

Scans user defined Rom directories and adds found entries into iRomRingingToneArray

ScanRomDirectoriesL()

void ScanRomDirectoriesL ( ) [private]

Scans user defined Rom directories and adds found entries into iRomRingingToneArray

SetEntryFormatter(MFLDEntryFormatter *)

void SetEntryFormatter ( MFLDEntryFormatter * aFormatter )

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

Parameters

MFLDEntryFormatter * aFormatter A pointer to a MFLDEntryFormatter inherited object.

SetMaxFileSize(const TInt)

void SetMaxFileSize ( const TInt aMaxFileSize )

Sets the maximum file size for the list.

Parameters

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

SetPopupList(CFLDPopupList *)

void SetPopupList ( 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 * aPopupList The popup list

SetWantedMediaTypesL(const TArray< TCLFMediaType > &)

void SetWantedMediaTypesL ( 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 > & aMediaTypes The array containing wanted media types

SetWantedMimeTypesL(const MDesCArray &)

void SetWantedMimeTypesL ( const MDesCArray & aMimeTypes )

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

Parameters

const MDesCArray & aMimeTypes The 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]