MCLFSortingStyle Class Reference

#include <mw/MCLFSortingStyle.h>

Link against: ContentListingFramework.lib

class MCLFSortingStyle
Public Member Functions
virtual ~MCLFSortingStyle()
pure virtual voidAddFieldL(TCLFFieldId)
pure virtual voidGetFieldsL(RArray< TCLFFieldId > &)
pure virtual TCLFSortingStyleOrdering Ordering()
pure virtual voidResetL()
pure virtual voidSetOrdering(TCLFSortingStyleOrdering)
pure virtual voidSetSortingDataType(TCLFItemDataType)
pure virtual voidSetUndefinedItemPosition(TCLFUndefinedItemPosition)
pure virtual TCLFItemDataType SortingDataType()
pure virtual TCLFUndefinedItemPosition UndefinedItemPosition()

Detailed Description

Sorting style for Content Listing Framework. This class can be used to define primary and secondary sorting styles for Content Listing Framework list model. Sorting styles are used to sort the list model. Secondary sorting style is used to sort items that could not be sorted by the primary sorting style. In other words, items that do not have the field defined by primary or any previous secondary sorting style, the items are sorted using the next secondary sorting style. When a secondary sorting style is appended, 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. Usage:
  // Create a sorting style instance
  MCLFSortingStyle* sortingStyle = ContentListingFactory::NewSortingStyleLC();

  // Set sort ordering
  sortingStyle->SetOrdering( ECLFOrderingDescending );

  // Set undefied item position. Undefined items are items that doesn't
  // have field that is defined in sorting style fields
  sortingStyle->SetUndefinedItemPosition( ECLFSortingStyleUndefinedEnd );

  // All sorting style parameter fields are string type
  sortingStyle->SetSortingDataType( ECLFItemDataTypeDesC );

  // Set default sorting parameter
  sortingStyle->AddFieldL( ECLFFieldIdSongName );

  // Set secondary sorting parameter
  sortingStyle->AddFieldL( ECLFFieldIdFileName );

  // If item doesn't have ECLFFieldIdSongName field then
  // ECLFFieldIdFileName field is used to sort item.
Since
S60 3.1

Constructor & Destructor Documentation

~MCLFSortingStyle ( )

~MCLFSortingStyle()[inline, virtual]

Destructor.

Member Function Documentation

AddFieldL ( TCLFFieldId )

voidAddFieldL(TCLFFieldIdaFieldId)[pure virtual]
Add new field to the sorting style. First added field will be the default field. Remember to set type of field(s) with SetSortingDataType. Fields that are some other type will be ignored. See TCLFDefaultFieldId in CLFContentListing.hrh
Since
S60 3.1
ParameterDescription
aFieldIdId of the sorting parameter field

GetFieldsL ( RArray< TCLFFieldId > & )

voidGetFieldsL(RArray< TCLFFieldId > &aArray)const [pure virtual]
Get IDs of fields that have been set to the sorting style.
Since
S60 3.1
ParameterDescription
aArrayArray of field IDs

Ordering ( )

TCLFSortingStyleOrdering Ordering()const [pure virtual]
Get current sort ordering of the sorting style.
Since
S60 3.1

Returns: Current sort ordering

ResetL ( )

voidResetL()[pure virtual]
Reset settings of the sorting style to default.
Since
S60 3.1

SetOrdering ( TCLFSortingStyleOrdering )

voidSetOrdering(TCLFSortingStyleOrderingaOrdering)[pure virtual]
Set sort ordering. Ordering can be ascending or descending. See TCLFSortingStyleOrdering
Since
S60 3.1
ParameterDescription
aOrderingSort ordering to be set

SetSortingDataType ( TCLFItemDataType )

voidSetSortingDataType(TCLFItemDataTypeaDataType)[pure virtual]
Set data type of sorting parameter fields. Data type can be text, time or number. See TCLFItemDataType
Since
S60 3.1
ParameterDescription
aDataTypeData type to be set

SetUndefinedItemPosition ( TCLFUndefinedItemPosition )

voidSetUndefinedItemPosition(TCLFUndefinedItemPositionaUndefinedItemPosition)[pure virtual]
Set undefined item position. Items not having information for defined sorting parameter fields are placed to top or bottom of the model. See TCLFUndefinedItemPosition
Since
S60 3.1
ParameterDescription
aUndefinedItemPositionPosition for undefiened items

SortingDataType ( )

TCLFItemDataType SortingDataType()const [pure virtual]
Get current sorting data type of fields.
Since
S60 3.1

Returns: Current data type sorting of sorting fields

UndefinedItemPosition ( )

TCLFUndefinedItemPosition UndefinedItemPosition()const [pure virtual]
Get current position of undefined items.
Since
S60 3.1

Returns: Current position for undefined items