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 void AppendL (const TArray < TMPXItemId > &)
IMPORT_C void AppendL (const TMPXItemId &)
IMPORT_C void Back ()
IMPORT_C void ClearSelection ()
IMPORT_C CMPXCollectionPath * ContainerPathL ()
IMPORT_C TInt Count ()
IMPORT_C void Deselect (const TMPXItemId &)
IMPORT_C void Deselect ( TInt )
IMPORT_C void DeselectAll ()
IMPORT_C void ExternalizeL ( RWriteStream &)
IMPORT_C TInt HandleChange (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 TInt Index ()
IMPORT_C TInt Index ( TInt )
IMPORT_C TInt IndexOfId (const TMPXItemId &)
IMPORT_C void InsertL (const TMPXItemId &, TInt )
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C TBool IsSelected (const TMPXItemId &)
IMPORT_C TBool IsSelected ( TInt )
IMPORT_C const TArray < TMPXItemId > Items ()
IMPORT_C TInt Levels ()
IMPORT_C CMPXCollectionPath * NewL (const CMPXCollectionPath &)
IMPORT_C CMPXCollectionPath * NewL ( RReadStream &)
IMPORT_C CMPXCollectionPath * NewL ()
IMPORT_C const TArray < TMPXAttribute > OpenAttributes ()
IMPORT_C TMPXOpenMode OpenNextMode ()
IMPORT_C TMPXOpenMode OpenPreviousMode ()
IMPORT_C void Remove (const TMPXItemId &)
IMPORT_C void Remove ( TInt )
IMPORT_C void Reset ()
IMPORT_C void SelectAllL ()
IMPORT_C void SelectL (const TMPXItemId &)
IMPORT_C void SelectL ( TInt )
IMPORT_C TArray < TInt > Selection ()
IMPORT_C void SelectionL ( RArray < TMPXItemId > &)
IMPORT_C void Set ( TInt )
IMPORT_C void Set (const TMPXItemId &)
IMPORT_C void Set ( TMPXOpenMode )
IMPORT_C void Set (const TArray < TMPXAttribute > &)
IMPORT_C void SetL (const TArray < TMPXAttribute > &)
IMPORT_C void SetToFirst ()
IMPORT_C void SetToLast ()
IMPORT_C void Update ( TInt , TMPXItemId &)
IMPORT_C TBool operator++ ()
IMPORT_C TBool operator-- ()
Private Member Functions
CMPXCollectionPath ()
void ConstructL (const CMPXCollectionPath &)
void ConstructL ()
void ConstructL ( 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
enum TMPXCollectionPathChange { EAdded , EDeleted , EModified , EGroupModified }
enum TMPXCollectionPathLevel { ECollectionUid  = 0, ECollectionRoot  = 0 }
enum TMPXPathChangeResult { EPathUnchanged  = 0, EPathModified , EPathClipped }
Private Attributes
RArray < TMPXItemId > iIds
TMPXItemId iInvalidId
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 void AppendL ( const TArray < TMPXItemId > & aIds )

Append a level.

Since
S60 3.2.3

Parameters

const TArray < TMPXItemId > & aIds IDs of items at this level

AppendL(const TMPXItemId &)

IMPORT_C void AppendL ( const TMPXItemId & aId )

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

Since
S60 3.2.3

Parameters

const TMPXItemId & aId id of item at this level

Back()

IMPORT_C void Back ( )

Back a level.

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

ClearSelection()

IMPORT_C void ClearSelection ( )

Clears selection.

Since
S60 3.2.3

ConstructL(const CMPXCollectionPath &)

void ConstructL ( const CMPXCollectionPath & aPath ) [private]

2nd phase constructor.

Since
S60 3.2.3

Parameters

const CMPXCollectionPath & aPath collection path

ConstructL()

void ConstructL ( ) [private]

2nd phase constructor.

Since
S60 3.2.3

ConstructL(RReadStream &)

void ConstructL ( RReadStream & aStream ) [private]

2nd phase constructor.

Since
S60 3.2.3

Parameters

RReadStream & aStream stream

ContainerPathL()

IMPORT_C CMPXCollectionPath * ContainerPathL ( ) const

Count()

IMPORT_C TInt Count ( ) const

Number of items at the top level.

Since
S60 3.2.3

Deselect(const TMPXItemId &)

IMPORT_C void Deselect ( 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 & aId ID of the item

Deselect(TInt)

IMPORT_C void Deselect ( TInt aIndex )

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 aIndex index of the item

DeselectAll()

IMPORT_C void DeselectAll ( )

Deselect all of items at top level in the path.

Since
S60 3.2.3

ExternalizeL(RWriteStream &)

IMPORT_C void ExternalizeL ( RWriteStream & aStream ) const

Externalize a object of this class to steam.

Since
S60 3.2.3

Parameters

RWriteStream & aStream write stream

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

IMPORT_C TInt HandleChange ( const TUid & aCollectionId,
const TMPXItemId & aId,
const TMPXItemId & aDeprecatedId,
CMPXCollectionPath::TMPXCollectionPathChange aChange,
TInt & aSelection
)

Handle collection change.

Since
S60 3.2.3

Parameters

const TUid & aCollectionId collection id of changes
const TMPXItemId & aId Id of item change
const TMPXItemId & aDeprecatedId old Id of the item changed
CMPXCollectionPath::TMPXCollectionPathChange aChange change type
TInt & aSelection

Id()

IMPORT_C const TMPXItemId & Id ( ) const

Current ID.

Since
S60 3.2.3

Id(TInt)

IMPORT_C const TMPXItemId & Id ( TInt aLevel ) const

Return item id at a specific level.

Since
S60 3.2.3

Parameters

TInt aLevel level of depth

IdOfIndex(TInt)

IMPORT_C const TMPXItemId & IdOfIndex ( TInt aIndex ) 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 TInt Index ( ) const

Current index.

Since
S60 3.2.3

Index(TInt)

IMPORT_C TInt Index ( TInt aLevel ) const

Return item index at a specific level.

Since
S60 3.2.3

Parameters

TInt aLevel level of depth

IndexOfId(const TMPXItemId &)

IMPORT_C TInt IndexOfId ( const TMPXItemId & aId ) const

Index from item id at the top level.

Since
S60 3.2.3

Parameters

const TMPXItemId & aId item id

InsertL(const TMPXItemId &, TInt)

IMPORT_C void InsertL ( const TMPXItemId & aId,
TInt aPos
)

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 & aId the id to be inserted
TInt aPos the position where the id to be inserted. The position is relative to zero.

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( RReadStream & aStream )

Internalize a object of this class from steam.

Since
S60 3.2.3

Parameters

RReadStream & aStream read stream

IsSelected(const TMPXItemId &)

IMPORT_C TBool IsSelected ( const TMPXItemId & aId ) const

Queries if item is selected.

Since
S60 3.2.3

Parameters

const TMPXItemId & aId ID of item

IsSelected(TInt)

IMPORT_C TBool IsSelected ( TInt aIndex ) const

Queries if item is selected.

Since
S60 3.2.3

Parameters

TInt aIndex index 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 TInt Levels ( ) 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 & aPath reference to an existing collection path

NewL(RReadStream &)

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

Two-phase constructor.

Since
S60 3.2.3

Parameters

RReadStream & aStream reference 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 TMPXOpenMode OpenNextMode ( ) const

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

Since
S60 3.2.3

OpenPreviousMode()

IMPORT_C TMPXOpenMode OpenPreviousMode ( ) const

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

Since
S60 3.2.3

Remove(const TMPXItemId &)

IMPORT_C void Remove ( 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 & aId ID of the item

Remove(TInt)

IMPORT_C void Remove ( TInt aIndex )

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 aIndex index of the item

Reset()

IMPORT_C void Reset ( )

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 void SelectAllL ( )

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 void SelectL ( 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 & aId ID of the item

SelectL(TInt)

IMPORT_C void SelectL ( TInt aIndex )

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 aIndex index 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 void SelectionL ( 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 > & aIds array of ids returned, id may be duplicated. e.g. music playlist can contains an item more than once.

Set(TInt)

IMPORT_C void Set ( TInt aIndex )

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 aIndex index of the item

Set(const TMPXItemId &)

IMPORT_C void Set ( 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 & aId id of the item

Set(TMPXOpenMode)

IMPORT_C void Set ( TMPXOpenMode aMode )

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 aMode the open mode

Set(const TArray< TMPXAttribute > &)

IMPORT_C void Set ( 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 > & aAttrs the open attributes

SetL(const TArray< TMPXAttribute > &)

IMPORT_C void SetL ( 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 > & aAttrs the open attributes

SetToFirst()

IMPORT_C void SetToFirst ( )

Go to the first item.

Since
S60 3.2.3

SetToLast()

IMPORT_C void SetToLast ( )

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 void Update ( TInt aIndex,
TMPXItemId & aNewId
)

Update the item ID for a particular item.

Since
S60 3.2.3

Parameters

TInt aIndex index to update
TMPXItemId & aNewId the item id to set to the index

operator++()

IMPORT_C TBool operator++ ( )

Go to next item.

Since
S60 3.2.3

operator--()

IMPORT_C TBool operator-- ( )

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

TMPXItemId iInvalidId [private]

RPointerArray< CMPXCollectionPathNode > iNodeArray

RPointerArray < CMPXCollectionPathNode > iNodeArray [private]

RArray< TInt > iSelection

RArray < TInt > iSelection [private]