MCLFItemListModel Class Reference

API published in: S60 3rd Ed FP 1

Link against: contentlistingframework.lib

Capability Information

Required Capabilities

None


#include <mclfitemlistmodel.h>

Detailed Description

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 );

Public Member Functions

virtual  ~MCLFItemListModel ()
  Destructor.
virtual const MCLFItem Item (TInt aIndex) const =0
  Get Content Listing Framework item from the List Model.
virtual TInt  ItemCount () const =0
  Get number of items that are in the model.
virtual void  SetSortingStyle (MCLFSortingStyle *aSortingStyle)=0
  Activate or remove Sorting style.
virtual void  AppendSecondarySortingStyleL (MCLFSortingStyle &aSortingStyle)=0
  Append a secondary sorting style to the list model.
virtual void  SetCustomSorter (MCLFCustomSorter *aCustomSorter)=0
  Activate or remove custom sorter.
virtual void  SetGroupingStyle (TCLFGrouping aGrouping)=0
  Activate a grouping style for the List Model.
virtual void  SetCustomGrouper (MCLFCustomGrouper *aCustomGrouper)=0
  Activate or remove custom grouper.
virtual void  SetPostFilter (MCLFPostFilter *aPostFilter)=0
  Activate or remove post filter.
virtual void  SetWantedMimeTypesL (const MDesCArray &aMimeTypes)=0
  Wanted mime types of media files that will be requested to the model.
virtual void  SetWantedMimeTypesL (TResourceReader &aResource)=0
  Wanted mime types of media files that will be requested to the model.
virtual void  SetWantedMediaTypesL (const TArray< TInt > &aMediaTypes)=0
  Wanted media types of media files that will be requested to the model.
virtual void  SetWantedMediaTypesL (TResourceReader &aResource)=0
  Wanted media types of media files that will be requested to the model.
virtual void  RefreshL ()=0
  Refresh the model.
virtual void  RefreshL (TInt32 aRefreshType)=0
  Refresh the model.
virtual void  CancelRefresh ()=0
  Cancel asynchronous refresh operation.

Constructor & Destructor Documentation

virtual MCLFItemListModel::~MCLFItemListModel  )  [inline, virtual]
 

Destructor.


Member Function Documentation

virtual void MCLFItemListModel::AppendSecondarySortingStyleL 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.

Parameters:
aSortingStyle  Secondary sorting style to add.
virtual void MCLFItemListModel::CancelRefresh  )  [pure virtual]
 

Cancel asynchronous refresh operation.

virtual const MCLFItem& MCLFItemListModel::Item TInt  aIndex  )  const [pure virtual]
 

Get Content Listing Framework item from the List Model.

Precondition:
aIndex >= 0 && aIndex < ItemCount()
Parameters:
aIndex  Index of the item
Returns:
Content Listing Framework item
virtual TInt MCLFItemListModel::ItemCount  )  const [pure virtual]
 

Get number of items that are in the model.

Returns:
Count of items
virtual void MCLFItemListModel::RefreshL TInt32  aRefreshType  )  [pure virtual]
 

Refresh the model.

This function is synchronous (blocking). Use parameter(s) to define the type of refresh. See TCLFRefreshTypeFlags for refresh flags.

Parameters:
aRefreshType  Flag(s) to use for refreshing.
virtual void MCLFItemListModel::RefreshL  )  [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.

virtual void MCLFItemListModel::SetCustomGrouper 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.

Parameters:
aCustomGrouper  Custom grouper to activate, if pointer is NULL then then grouping style is used
virtual void MCLFItemListModel::SetCustomSorter 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.

Parameters:
aCustomSorter  Custom sorter to activate. If the pointer is NULL, sorting style is used (if there is one activated)
virtual void MCLFItemListModel::SetGroupingStyle TCLFGrouping  aGrouping  )  [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.

Parameters:
aGrouping  Grouping style to activate
virtual void MCLFItemListModel::SetPostFilter 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.

Parameters:
aPostFilter  Post filter to activate, if pointer is NULL then active post filter will be removed.
virtual void MCLFItemListModel::SetSortingStyle 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.

Parameters:
aSortingStyle  Sorting style to activate, if the pointer is NULL then sorting styles are removed
virtual void MCLFItemListModel::SetWantedMediaTypesL 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.

Parameters:
aResource  Resource reader to media type list resource. Use resource struct CLF_MEDIA_TYPE_ARRAY
virtual void MCLFItemListModel::SetWantedMediaTypesL 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.

Parameters:
aMediaTypes  List of wanted media types
virtual void MCLFItemListModel::SetWantedMimeTypesL 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.

Parameters:
aResource  Resource reader to mime type list resource. Use resource struct CLF_MIME_TYPE_ARRAY.
virtual void MCLFItemListModel::SetWantedMimeTypesL 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.

Parameters:
aMimeTypes  List 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

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top