CMPXCollectionMediator Class Reference

class CMPXCollectionMediator : public CBase

Mediator class to handle Music Player specific requirements ie: files with genre podcast must be stored in podcast db.

mpxcollectionmediator.lib

Inherits from

Public Member Functions
~CMPXCollectionMediator ()
IMPORT_C void AddItemAsyncL ( CMPXMedia *&)
IMPORT_C void AddItemL ( CMPXMedia *&)
IMPORT_C void AddItemL ( CMPXMediaArray &)
IMPORT_C void CheckItemL ( CMPXMedia &)
IMPORT_C void MoveItemL ( CMPXMedia *&, TUid , TUid )
IMPORT_C void MoveItemL ( CMPXMedia *&, TUid , TUid , MMPXMoveItemObserver *)
IMPORT_C CMPXCollectionMediator * NewL ( MMPXCollection &, MMPXMediatorObserver *)
IMPORT_C CMPXCollectionMediator * NewL ()
IMPORT_C CMPXCollectionMediator * NewLC ( MMPXCollection &, MMPXMediatorObserver *)
IMPORT_C void SetItemL ( CMPXMedia *&)
IMPORT_C void SetItemL ( CMPXMediaArray &)
IMPORT_C void SetItemL ( TArray < CMPXMedia * > &, CMPXCollectionPath &, RArray < TInt > &)
Private Member Functions
CMPXCollectionMediator ( MMPXCollection &, MMPXMediatorObserver *)
CMPXCollectionMediator ()
void ConstructL ()
void DoAddToCollectionL ( CMPXMedia *, TUid )
void DoMoveItemL ( CMPXMedia *&, TUid )
void DoSetToCollectionL ( CMPXMedia *, TUid )
TBool IsPodcastL ( CMPXMedia &)
void UpdatePathToPodcastL ( CMPXMedia &)
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()
Private Attributes
MMPXCollection * iColUtil
RFs iFs
CMPXMoveItemHelper * iMoveHelper
TUid iMusicCollectionID
MMPXMediatorObserver * iObserver
HBufC * iPodCastBuf
TUid iPodCastCollectionID
HBufC * iPodCastEngBuf
HBufC * iUnknownBuf

Constructor & Destructor Documentation

CMPXCollectionMediator(MMPXCollection &, MMPXMediatorObserver *)

CMPXCollectionMediator ( MMPXCollection & aColUtil,
MMPXMediatorObserver * aObs
) [private]
Private constructor.
Since
S60 v3.2.3

Parameters

MMPXCollection & aColUtil collection utility to share with the owner.
MMPXMediatorObserver * aObs observer to mediator operations

CMPXCollectionMediator()

CMPXCollectionMediator ( ) [private]
Private constructor.
Since
S60 v3.2.3

~CMPXCollectionMediator()

~CMPXCollectionMediator ( ) [virtual]
Virtual destructor.
Since
S60 v3.2.3

Member Functions Documentation

AddItemAsyncL(CMPXMedia *&)

IMPORT_C void AddItemAsyncL ( CMPXMedia *& aMediaProp )

Add a media to the collection asynchronously.

leave
KErrArgument leave if not a supported media type

Parameters

CMPXMedia *& aMediaProp media item.

AddItemL(CMPXMedia *&)

IMPORT_C void AddItemL ( CMPXMedia *& aMediaProp )
Add a media to the collection. Upon successfull addition, its KMPXMediaGeneralId will be updated.
Since
S60 v3.2.3
leave
KErrArgument leave if not a supported media type

Parameters

CMPXMedia *& aMediaProp media item.

AddItemL(CMPXMediaArray &)

IMPORT_C void AddItemL ( CMPXMediaArray & aMPArray )
Add a list of files to the collection db.
Since
S60 v3.2.3
leave
KErrArgument leave if not a supported media type

Parameters

CMPXMediaArray & aMPArray

CheckItemL(CMPXMedia &)

IMPORT_C void CheckItemL ( CMPXMedia & aMedia )
Static item to check if the collection id is correct. Updates the collection path object to podcast if it is podcast.
Since
S60 v3.2.3

Parameters

CMPXMedia & aMedia media object

ConstructL()

void ConstructL ( ) [private]
2nd phase constructor.
Since
S60 v3.2.3

DoAddToCollectionL(CMPXMedia *, TUid)

void DoAddToCollectionL ( CMPXMedia * aMedia,
TUid aCollectionId
) [private]
Add a file to the collection.
Since
S60 v3.2.3

Parameters

CMPXMedia * aMedia media to add.
TUid aCollectionId

DoMoveItemL(CMPXMedia *&, TUid)

void DoMoveItemL ( CMPXMedia *& aMedia,
TUid aNewCollection
) [private]
Move a file from one db to another.
Since
S60 v3.2.3

Parameters

CMPXMedia *& aMedia media object.
TUid aNewCollection new colection

DoSetToCollectionL(CMPXMedia *, TUid)

void DoSetToCollectionL ( CMPXMedia * aMedia,
TUid aCollectionId
) [private]
Set a file to the collection.
Since
S60 v3.2.3

Parameters

CMPXMedia * aMedia media to set.
TUid aCollectionId

IsPodcastL(CMPXMedia &)

TBool IsPodcastL ( CMPXMedia & aMedia ) [private]
Is this item recognizable as podcast.
Since
S60 v3.2.3

Parameters

CMPXMedia & aMedia media object.

MoveItemL(CMPXMedia *&, TUid, TUid)

IMPORT_C void MoveItemL ( CMPXMedia *& aMedia,
TUid aOldCollectionId,
TUid aNewCollectionId
)
Moves an item from one collection to another. Updates the media properties "genre" to Unknown if moving from podcast -> local audio.
Since
S60 v3.2.3

Parameters

CMPXMedia *& aMedia
TUid aOldCollectionId old collection id.
TUid aNewCollectionId new collection id

MoveItemL(CMPXMedia *&, TUid, TUid, MMPXMoveItemObserver *)

IMPORT_C void MoveItemL ( CMPXMedia *& aMedia,
TUid aOldCollectionId,
TUid aNewCollectionId,
MMPXMoveItemObserver * aObs
)
Moves an item from one collection to another. Updates the media properties "genre" to Unknown if moving from podcast -> local audio.
Since
S60 v3.2.3

Parameters

CMPXMedia *& aMedia properties of the object.
TUid aOldCollectionId old collection id.
TUid aNewCollectionId new collection id.
MMPXMoveItemObserver * aObs observer for event

NewL(MMPXCollection &, MMPXMediatorObserver *)

IMPORT_C CMPXCollectionMediator * NewL ( MMPXCollection & aColUtil,
MMPXMediatorObserver * aObs = NULL
) [static]
Two-phased constructor.
Since
S60 v3.2.3

Parameters

MMPXCollection & aColUtil collection utility.
MMPXMediatorObserver * aObs = NULL observer.

NewL()

IMPORT_C CMPXCollectionMediator * NewL ( ) [static]
Two-phased constructor. Only use to execute "CheckItemL" not for adding/moving in collection.
Since
S60 v3.2.3

NewLC(MMPXCollection &, MMPXMediatorObserver *)

IMPORT_C CMPXCollectionMediator * NewLC ( MMPXCollection & aColUtil,
MMPXMediatorObserver * aObs = NULL
) [static]
Two-phased constructor.
Since
S60 v3.2.3

Parameters

MMPXCollection & aColUtil
MMPXMediatorObserver * aObs = NULL

SetItemL(CMPXMedia *&)

IMPORT_C void SetItemL ( CMPXMedia *& aMediaProp )
Updates the media properties of a file. Used for media objects where the caller does not know the collection for which the item should belong to.
Since
S60 v3.2.3

Parameters

CMPXMedia *& aMediaProp media to update

SetItemL(CMPXMediaArray &)

IMPORT_C void SetItemL ( CMPXMediaArray & aMPArray )
Updates media for a list of items. Used for media objects where the caller does not know the collection for which the item should belong to.
Since
S60 v3.2.3

Parameters

CMPXMediaArray & aMPArray list of media item

SetItemL(TArray< CMPXMedia * > &, CMPXCollectionPath &, RArray< TInt > &)

IMPORT_C void SetItemL ( TArray < CMPXMedia * > & aArray,
CMPXCollectionPath & aPath,
RArray < TInt > & aIndices
)
Update media for items in the same collection depth. Not implemented.
Since
S60 v3.2.3

Parameters

TArray < CMPXMedia * > & aArray list of items.
CMPXCollectionPath & aPath collection path of the item.
RArray < TInt > & aIndices list of indices

UpdatePathToPodcastL(CMPXMedia &)

void UpdatePathToPodcastL ( CMPXMedia & aMedia ) [private]
Change a collection id to the podcast db.
Since
S60 v3.2.3

Parameters

CMPXMedia & aMedia media to update the collection id to podcast

Member Data Documentation

MMPXCollection * iColUtil

MMPXCollection * iColUtil [private]

RFs iFs

RFs iFs [private]

CMPXMoveItemHelper * iMoveHelper

CMPXMoveItemHelper * iMoveHelper [private]

TUid iMusicCollectionID

TUid iMusicCollectionID [private]

MMPXMediatorObserver * iObserver

MMPXMediatorObserver * iObserver [private]

HBufC * iPodCastBuf

HBufC * iPodCastBuf [private]

TUid iPodCastCollectionID

TUid iPodCastCollectionID [private]

HBufC * iPodCastEngBuf

HBufC * iPodCastEngBuf [private]

HBufC * iUnknownBuf

HBufC * iUnknownBuf [private]