MCLFItemListModel Class Reference

class MCLFItemListModel
List Model for Content Listing Framework. This model is used to list Content Listing items. These items provide infomation of media files on the device and one item represents one media file. The model can be manipulated by sorters, post filters and groupers. List Model is created by using Content Listing Engine. Usage:
  // Create a new List Model instance
  MCLFItemListModel* listModel = iEngine->CreateListModelLC( *myObserver );

  // Append music-type to wanted types array to exclude
  // all other files than music files from the list model
  RArray<TCLFMediaType> myMediaTypes;
  CleanupClosePushL( myMediaTypes );
  myMediaTypes.AppendL( ECLFMediaTypeMusic );

  // Set wanted types with SetWantedMimeTypesL or/and SetWantedMediaTypesL.
  // You can add both if you want.
  listModel->SetWantedMediaTypesL( myMediaTypes.Array() );
  CleanupStack::PopAndDestroy( &myMediaTypes );

  // Set sorting style (if you want to sort items)
  listModel->SetSortingStyle( mySortingStyle );

  // You can also add post filter, custom sorter and custom grouper to model.

  // Refresh the List Model.
  // The model will fetch items from server and use post filter to filter items,
  // grouping style or custom grouper to group items and finally sort items
  // with sorting style or custom sorter.
  listModel->RefreshL();

  // You can also refresh the post filter and sorting only. This call does not
  // fetch items from the server. The model is only filtered and sorted.
  listModel->RefreshL( ECLFRefreshPostFilter | ECLFRefreshSorting );
ContentListingFramework.lib
Since
S60 3.1

Constructor & Destructor Documentation

~MCLFItemListModel()

~MCLFItemListModel()[inline, virtual]

Destructor.

Member Functions Documentation

AppendSecondarySortingStyleL(MCLFSortingStyle &)

voidAppendSecondarySortingStyleL(MCLFSortingStyle &aSortingStyle)[pure virtual]
Append a secondary sorting style to the list model. If an item doesn't have the field defined by primary or any previous secondary sorting style, the items are sorted using the next secondary sorting style. When a sorting style is appended using this method, it becomes the least significant sorting style until a new one is added after it. Items with undefined fields are placed before or after items with defined fields, depending on the undefined field position setting in MCLFSortingStyle.
Since
S60 3.1

Parameters

MCLFSortingStyle & aSortingStyleSecondary sorting style to add.

CancelRefresh()

voidCancelRefresh()[pure virtual]
Cancel asynchronous refresh operation.
Since
S60 3.1

Extension()

MCLFItemListModelExt *Extension()[private, inline, virtual]

This member is internal and not intended for use.

Item(TInt)

const MCLFItem &Item(TIntaIndex)const [pure virtual]
Get Content Listing Framework item from the List Model.
Since
S60 3.1
Pre-condition
aIndex >= 0 && aIndex < ItemCount()

Parameters

TInt aIndexIndex of the item

ItemCount()

TInt ItemCount()const [pure virtual]
Get number of items that are in the model.
Since
S60 3.1

RefreshL()

voidRefreshL()[pure virtual]
Refresh the model. This function is asynchronous (non-blocking) and MCLFOperationObserver is called when the refresh operation is completed. Operations in refresh are executed in the following order: 1. Model gets wanted items from server. Use SetWantedMediaTypesL and/or SetWantedMimeTypesL to define wanted items. 2. Model uses post filter to filter items. 3. Model groups items if grouping is selected. 4. Model sorting items.
Since
S60 3.1

RefreshL(TInt32)

voidRefreshL(TInt32aRefreshType)[pure virtual]
Refresh the model. This function is synchronous (blocking). Use parameter(s) to define the type of refresh. See TCLFRefreshTypeFlags for refresh flags.
Since
S60 3.1

Parameters

TInt32 aRefreshTypeFlag(s) to use for refreshing.

SetCustomGrouper(MCLFCustomGrouper *)

voidSetCustomGrouper(MCLFCustomGrouper *aCustomGrouper)[pure virtual]
Activate or remove custom grouper. See MCLFCustomGrouper for an example implementation of a custom grouper. Custom grouper will overwrite grouping style.
Since
S60 3.1

Parameters

MCLFCustomGrouper * aCustomGrouperCustom grouper to activate, if pointer is NULL then then grouping style is used

SetCustomSorter(MCLFCustomSorter *)

voidSetCustomSorter(MCLFCustomSorter *aCustomSorter)[pure virtual]
Activate or remove custom sorter. Custom sorter will overwrite sorting style (if there is a sorting style activated). See MCLFCustomSorter for an example implementation of a custom sorter.
Since
S60 3.1

Parameters

MCLFCustomSorter * aCustomSorterCustom sorter to activate. If the pointer is NULL, sorting style is used (if there is one activated)

SetGroupingStyle(TCLFGrouping)

voidSetGroupingStyle(TCLFGroupingaGrouping)[pure virtual]
Activate a grouping style for the List Model. Use ECLFNoGrouping as the grouping style if you want to remove grouping. Default grouping style is ECLFNoGrouping.
Since
S60 3.1

Parameters

TCLFGrouping aGroupingGrouping style to activate

SetPostFilter(MCLFPostFilter *)

voidSetPostFilter(MCLFPostFilter *aPostFilter)[pure virtual]
Activate or remove post filter. Post filter removes items from the List Model. See MCLFPostFilter for an example implementation of a post filter.
Since
S60 3.1

Parameters

MCLFPostFilter * aPostFilterPost filter to activate, if pointer is NULL then active post filter will be removed.

SetSortingStyle(MCLFSortingStyle *)

voidSetSortingStyle(MCLFSortingStyle *aSortingStyle)[pure virtual]
Activate or remove Sorting style. Setting a new sorting style will remove all old secondary sorters. Removing the sorting will also remove all secondary sorters too.
Since
S60 3.1

Parameters

MCLFSortingStyle * aSortingStyleSorting style to activate, if the pointer is NULL then sorting styles are removed

SetWantedMediaTypesL(const TArray< TInt > &)

voidSetWantedMediaTypesL(const TArray< TInt > &aMediaTypes)[pure virtual]
Wanted media types of media files that will be requested to the model. Overwrites old media types if they were set.
Since
S60 3.1

Parameters

const TArray< TInt > & aMediaTypesList of wanted media types

SetWantedMediaTypesL(TResourceReader &)

voidSetWantedMediaTypesL(TResourceReader &aResource)[pure virtual]
Wanted media types of media files that will be requested to the model. Overwrites old media types if they were set.
Since
S60 3.1

Parameters

TResourceReader & aResourceResource reader to media type list resource. Use resource struct CLF_MEDIA_TYPE_ARRAY

SetWantedMimeTypesL(const MDesCArray &)

voidSetWantedMimeTypesL(const MDesCArray &aMimeTypes)[pure virtual]
Wanted mime types of media files that will be requested to the model. Overwrites old mime types if they were set.
Since
S60 3.1

Parameters

const MDesCArray & aMimeTypesList of wanted mime types. Mime types can contain wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character

SetWantedMimeTypesL(TResourceReader &)

voidSetWantedMimeTypesL(TResourceReader &aResource)[pure virtual]
Wanted mime types of media files that will be requested to the model. Overwrites old mime types if they were set.
Since
S60 3.1

Parameters

TResourceReader & aResourceResource reader to mime type list resource. Use resource struct CLF_MIME_TYPE_ARRAY.