CMPXCollectionPath Class Reference

class CMPXCollectionPath : public CBase

Encapsulates a 'bookmark' to a specific collection entry, i.e. encapsulates a specific path in a collection hierarchy; you can navigate through the items at this level.

mpxcommon.lib

Inherits from

Public Member Functions
~CMPXCollectionPath()
IMPORT_C voidAppendL(const TArray< TMPXItemId > &)
IMPORT_C voidAppendL(const TMPXItemId &)
IMPORT_C voidBack()
IMPORT_C voidClearSelection()
IMPORT_C CMPXCollectionPath *ContainerPathL()
IMPORT_C TIntCount()
IMPORT_C voidDeselect(const TMPXItemId &)
IMPORT_C voidDeselect(TInt)
IMPORT_C voidDeselectAll()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C TIntHandleChange(const TUid &, const TMPXItemId &, const TMPXItemId &, CMPXCollectionPath::TMPXCollectionPathChange, TInt &)
IMPORT_C const TMPXItemId &Id()
IMPORT_C const TMPXItemId &Id(TInt)
IMPORT_C const TMPXItemId &IdOfIndex(TInt)
IMPORT_C TIntIndex()
IMPORT_C TIntIndex(TInt)
IMPORT_C TIntIndexOfId(const TMPXItemId &)
IMPORT_C voidInsertL(const TMPXItemId &, TInt)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsSelected(const TMPXItemId &)
IMPORT_C TBoolIsSelected(TInt)
IMPORT_C const TArray< TMPXItemId >Items()
IMPORT_C TIntLevels()
IMPORT_C CMPXCollectionPath *NewL(const CMPXCollectionPath &)
IMPORT_C CMPXCollectionPath *NewL(RReadStream &)
IMPORT_C CMPXCollectionPath *NewL()
IMPORT_C const TArray< TMPXAttribute >OpenAttributes()
IMPORT_C TMPXOpenModeOpenNextMode()
IMPORT_C TMPXOpenModeOpenPreviousMode()
IMPORT_C voidRemove(const TMPXItemId &)
IMPORT_C voidRemove(TInt)
IMPORT_C voidReset()
IMPORT_C voidSelectAllL()
IMPORT_C voidSelectL(const TMPXItemId &)
IMPORT_C voidSelectL(TInt)
IMPORT_C TArray< TInt >Selection()
IMPORT_C voidSelectionL(RArray< TMPXItemId > &)
IMPORT_C voidSet(TInt)
IMPORT_C voidSet(const TMPXItemId &)
IMPORT_C voidSet(TMPXOpenMode)
IMPORT_C voidSet(const TArray< TMPXAttribute > &)
IMPORT_C voidSetL(const TArray< TMPXAttribute > &)
IMPORT_C voidSetToFirst()
IMPORT_C voidSetToLast()
IMPORT_C voidUpdate(TInt, TMPXItemId &)
IMPORT_C TBooloperator++()
IMPORT_C TBooloperator--()
Private Member Functions
CMPXCollectionPath()
voidConstructL(const CMPXCollectionPath &)
voidConstructL()
voidConstructL(RReadStream &)
CMPXCollectionPathNode &TopLevel()
const CMPXCollectionPathNode &TopLevel()
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()
Public Member Enumerations
enumTMPXCollectionPathChange { EAdded, EDeleted, EModified, EGroupModified }
enumTMPXCollectionPathLevel { ECollectionUid = 0, ECollectionRoot = 0 }
enumTMPXPathChangeResult { EPathUnchanged = 0, EPathModified, EPathClipped }
Private Attributes
RArray< TMPXItemId >iIds
TMPXItemIdiInvalidId
RPointerArray< CMPXCollectionPathNode >iNodeArray
RArray< TInt >iSelection

Constructor & Destructor Documentation

CMPXCollectionPath()

CMPXCollectionPath()[private]

C++ default constructor.

Since
S60 3.2.3

~CMPXCollectionPath()

IMPORT_C~CMPXCollectionPath()[virtual]

Destructor.

Since
S60 3.2.3

Member Functions Documentation

AppendL(const TArray< TMPXItemId > &)

IMPORT_C voidAppendL(const TArray< TMPXItemId > &aIds)

Append a level.

Since
S60 3.2.3

Parameters

const TArray< TMPXItemId > & aIdsIDs of items at this level

AppendL(const TMPXItemId &)

IMPORT_C voidAppendL(const TMPXItemId &aId)

Append a level, where only single ID exists or is known.

Since
S60 3.2.3

Parameters

const TMPXItemId & aIdid of item at this level

Back()

IMPORT_C voidBack()

Back a level.

Since
S60 3.2.3
panic
USER 0 if no more level in the path

ClearSelection()

IMPORT_C voidClearSelection()

Clears selection.

Since
S60 3.2.3

ConstructL(const CMPXCollectionPath &)

voidConstructL(const CMPXCollectionPath &aPath)[private]

2nd phase constructor.

Since
S60 3.2.3

Parameters

const CMPXCollectionPath & aPathcollection path

ConstructL()

voidConstructL()[private]

2nd phase constructor.

Since
S60 3.2.3

ConstructL(RReadStream &)

voidConstructL(RReadStream &aStream)[private]

2nd phase constructor.

Since
S60 3.2.3

Parameters

RReadStream & aStreamstream

ContainerPathL()

IMPORT_C CMPXCollectionPath *ContainerPathL()const

Count()

IMPORT_C TIntCount()const

Number of items at the top level.

Since
S60 3.2.3

Deselect(const TMPXItemId &)

IMPORT_C voidDeselect(const TMPXItemId &aId)

Deselects an item in the path.

Since
S60 3.2.3
panic
USER 0, if aId was not selected

Parameters

const TMPXItemId & aIdID of the item

Deselect(TInt)

IMPORT_C voidDeselect(TIntaIndex)

Deselects an item in the path.

Since
S60 3.2.3
panic
USER 130, if aIndex is out of bound
panic
USER 0, if aIndex was not selected

Parameters

TInt aIndexindex of the item

DeselectAll()

IMPORT_C voidDeselectAll()

Deselect all of items at top level in the path.

Since
S60 3.2.3

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalize a object of this class to steam.

Since
S60 3.2.3

Parameters

RWriteStream & aStreamwrite stream

HandleChange(const TUid &, const TMPXItemId &, const TMPXItemId &, CMPXCollectionPath::TMPXCollectionPathChange, TInt &)

IMPORT_C TIntHandleChange(const TUid &aCollectionId,
const TMPXItemId &aId,
const TMPXItemId &aDeprecatedId,
CMPXCollectionPath::TMPXCollectionPathChangeaChange,
TInt &aSelection
)

Handle collection change.

Since
S60 3.2.3

Parameters

const TUid & aCollectionIdcollection id of changes
const TMPXItemId & aIdId of item change
const TMPXItemId & aDeprecatedIdold Id of the item changed
CMPXCollectionPath::TMPXCollectionPathChange aChangechange type
TInt & aSelection

Id()

IMPORT_C const TMPXItemId &Id()const

Current ID.

Since
S60 3.2.3

Id(TInt)

IMPORT_C const TMPXItemId &Id(TIntaLevel)const

Return item id at a specific level.

Since
S60 3.2.3

Parameters

TInt aLevellevel of depth

IdOfIndex(TInt)

IMPORT_C const TMPXItemId &IdOfIndex(TIntaIndex)const

Return the item id for the item at aIndex at the top level.

Since
S60 3.2.3

Parameters

TInt aIndex

Index()

IMPORT_C TIntIndex()const

Current index.

Since
S60 3.2.3

Index(TInt)

IMPORT_C TIntIndex(TIntaLevel)const

Return item index at a specific level.

Since
S60 3.2.3

Parameters

TInt aLevellevel of depth

IndexOfId(const TMPXItemId &)

IMPORT_C TIntIndexOfId(const TMPXItemId &aId)const

Index from item id at the top level.

Since
S60 3.2.3

Parameters

const TMPXItemId & aIditem id

InsertL(const TMPXItemId &, TInt)

IMPORT_C voidInsertL(const TMPXItemId &aId,
TIntaPos
)

Insert an id at top level.

Since
S60 3.2.3
leave
Leave with system errror code
panic
USER 131 if a pos is negative or is greater than the number of ids at top top level

Parameters

const TMPXItemId & aIdthe id to be inserted
TInt aPosthe position where the id to be inserted. The position is relative to zero.

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalize a object of this class from steam.

Since
S60 3.2.3

Parameters

RReadStream & aStreamread stream

IsSelected(const TMPXItemId &)

IMPORT_C TBoolIsSelected(const TMPXItemId &aId)const

Queries if item is selected.

Since
S60 3.2.3

Parameters

const TMPXItemId & aIdID of item

IsSelected(TInt)

IMPORT_C TBoolIsSelected(TIntaIndex)const

Queries if item is selected.

Since
S60 3.2.3

Parameters

TInt aIndexindex of item

Items()

IMPORT_C const TArray< TMPXItemId >Items()const

Retrieve a TArray of the top level items.

Since
S60 3.2.3
panic
USER 0 if no level in the path

Levels()

IMPORT_C TIntLevels()const

Number of levels into the collection.

Since
S60 3.2.3

NewL(const CMPXCollectionPath &)

IMPORT_C CMPXCollectionPath *NewL(const CMPXCollectionPath &aPath)[static]

Two-phase constructor.

Since
S60 3.2.3

Parameters

const CMPXCollectionPath & aPathreference to an existing collection path

NewL(RReadStream &)

IMPORT_C CMPXCollectionPath *NewL(RReadStream &aStream)[static]

Two-phase constructor.

Since
S60 3.2.3

Parameters

RReadStream & aStreamreference to a stream

NewL()

IMPORT_C CMPXCollectionPath *NewL()[static]

Two-phase constructor.

Since
S60 3.2.3

OpenAttributes()

IMPORT_C const TArray< TMPXAttribute >OpenAttributes()const

Open attributes for next level.

Since
S60 3.2.3
panic
USER 0 if no level in the path

OpenNextMode()

IMPORT_C TMPXOpenModeOpenNextMode()const

The open mode with which to navigate to the next level.

Since
S60 3.2.3

OpenPreviousMode()

IMPORT_C TMPXOpenModeOpenPreviousMode()const

The open mode with which to navigate to the previous level.

Since
S60 3.2.3

Remove(const TMPXItemId &)

IMPORT_C voidRemove(const TMPXItemId &aId)

Removes an item in the path and adjust selection indices accordingly.

Since
S60 3.2.3
panic
USER 0, if aId was not selected

Parameters

const TMPXItemId & aIdID of the item

Remove(TInt)

IMPORT_C voidRemove(TIntaIndex)

Removes an item in the path and adjust selection indices accordingly.

Since
S60 3.2.3
panic
USER 0, if aIndex was not selected

Parameters

TInt aIndexindex of the item

Reset()

IMPORT_C voidReset()

Resets the collection path object. removes all node arrays. removes all top level ids. removes all selection ids.

Since
S60 3.2.3

SelectAllL()

IMPORT_C voidSelectAllL()

Select all of items at top level in the path.

Since
S60 3.2.3
leave
The function leaves with one of the system wide error codes, if the operation fails

SelectL(const TMPXItemId &)

IMPORT_C voidSelectL(const TMPXItemId &aId)

Select an item with the id in the path. If the id appears more than once in the path, Select(TInt aIndex) can be used.

Since
S60 3.2.3
panic
USER 0 if aId is not found

Parameters

const TMPXItemId & aIdID of the item

SelectL(TInt)

IMPORT_C voidSelectL(TIntaIndex)

Select an item in the path.

Since
S60 3.2.3
leave
The function leaves with one of the system wide error codes, if the operation fails
panic
USER 130, if aIndex is out of bound

Parameters

TInt aIndexindex of the item

Selection()

IMPORT_C TArray< TInt >Selection()const

Array of currently selected indices.

Since
S60 3.2.3

SelectionL(RArray< TMPXItemId > &)

IMPORT_C voidSelectionL(RArray< TMPXItemId > &aIds)const

Current selected ids.

Since
S60 3.2.3
leave
The function leaves with one of the system wide error codes, if the operation fails.

Parameters

RArray< TMPXItemId > & aIdsarray of ids returned, id may be duplicated. e.g. music playlist can contains an item more than once.

Set(TInt)

IMPORT_C voidSet(TIntaIndex)

Go to specific item at top level.

Since
S60 3.2.3
panic
USER 130, if aIndex is out of bound
panic
USER 0, if collection path is invalid(zero level)

Parameters

TInt aIndexindex of the item

Set(const TMPXItemId &)

IMPORT_C voidSet(const TMPXItemId &aId)

Go to specific item at top level.

Since
S60 3.2.3
panic
USER 0, if aId is invalid or invalid collection path

Parameters

const TMPXItemId & aIdid of the item

Set(TMPXOpenMode)

IMPORT_C voidSet(TMPXOpenModeaMode)

Sets the open mode with which to navigate to the next level.

Since
S60 3.2.3
panic
USER 0, if collection path is invalid(zero level)

Parameters

TMPXOpenMode aModethe open mode

Set(const TArray< TMPXAttribute > &)

IMPORT_C voidSet(const TArray< TMPXAttribute > &aAttrs)

Sets the open attributes with which to navigate to the next level.

Since
S60 3.2.3
panic
USER 0, if collection path is invalid(zero level)
Use method CMPXCollectionPath::SetL( const TArray<TMPXAttribute>& aAttrs) instead.

Parameters

const TArray< TMPXAttribute > & aAttrsthe open attributes

SetL(const TArray< TMPXAttribute > &)

IMPORT_C voidSetL(const TArray< TMPXAttribute > &aAttrs)

Sets the open attributes with which to navigate to the next level.

Since
S60 3.2.3
leave
system error code
panic
USER 0, if collection path is invalid(zero level)

Parameters

const TArray< TMPXAttribute > & aAttrsthe open attributes

SetToFirst()

IMPORT_C voidSetToFirst()

Go to the first item.

Since
S60 3.2.3

SetToLast()

IMPORT_C voidSetToLast()

Go to the last item.

Since
S60 3.2.3

TopLevel()

CMPXCollectionPathNode &TopLevel()[private]

The top level node of the path.

Since
S60 3.2.3
panic
USER 0 if no level in the path

TopLevel()

const CMPXCollectionPathNode &TopLevel()const [private]

The top level node of the path.

Since
S60 3.2.3
panic
USER 0 if no level in the path

Update(TInt, TMPXItemId &)

IMPORT_C voidUpdate(TIntaIndex,
TMPXItemId &aNewId
)

Update the item ID for a particular item.

Since
S60 3.2.3

Parameters

TInt aIndexindex to update
TMPXItemId & aNewIdthe item id to set to the index

operator++()

IMPORT_C TBooloperator++()

Go to next item.

Since
S60 3.2.3

operator--()

IMPORT_C TBooloperator--()

Go to previous item.

Since
S60 3.2.3

Member Enumerations Documentation

Enum TMPXCollectionPathChange

Collection path change type.

Enumerators

EAdded
EDeleted
EModified
EGroupModified

Enum TMPXCollectionPathLevel

Convenience enumeration to identify levels within a collection path.

Enumerators

ECollectionUid = 0
ECollectionRoot = 0

Enum TMPXPathChangeResult

Enumerators

EPathUnchanged = 0
EPathModified
EPathClipped

Member Data Documentation

RArray< TMPXItemId > iIds

RArray< TMPXItemId >iIds[private]

TMPXItemId iInvalidId

TMPXItemIdiInvalidId[private]

RPointerArray< CMPXCollectionPathNode > iNodeArray

RPointerArray< CMPXCollectionPathNode >iNodeArray[private]

RArray< TInt > iSelection

RArray< TInt >iSelection[private]