CMsvEntry Class Reference

class CMsvEntry : public CBase

Accesses and acts upon a particular Message Server entry. The current entry that a CMsvEntry object relates is referred to as its context.

It may be helpful to consider CMsvEntry functions in two broad groups. The first provides means to access the various types of storage associated with an entry. The second provides a means to discover and access other entries that the entry owns (its children).

Message client applications, Client-side MTMs, and User Interface MTMs all commonly use CMsvEntry objects. CMsvEntry objects though represent a lower level of access to an entry than that provided by a Client-side MTM or User Interface MTM. In particular, any MTM-specific functionality, such as address lists or subject fields, must be accessed by a message client application through an MTM inteface.

A CMsvEntry object is relatively expensive in RAM usage, as it caches its children, updating them as necessary when notified of changes. They should therefore be created sparingly.

Note that Server-side MTMs do not use this class, but a similar one, CMsvServerEntry.

Inherits from

Public Member Functions
~CMsvEntry()
IMPORT_C voidAddObserverL(MMsvEntryObserver &)
IMPORT_C voidChangeAttributesL(const CMsvEntrySelection &, TUint, TUint)
IMPORT_C voidChangeL(const TMsvEntry &)
IMPORT_C voidChangeL(const TMsvEntry &, TSecureId)
IMPORT_C CMsvOperation *ChangeL(const TMsvEntry &, TRequestStatus &)
IMPORT_C CMsvOperation *ChangeL(const TMsvEntry &, TSecureId, TRequestStatus &)
IMPORT_C const TMsvEntry &ChildDataL(TMsvId)
IMPORT_C CMsvEntry *ChildEntryL(TMsvId)
IMPORT_C CMsvEntrySelection *ChildrenL()
IMPORT_C CMsvEntrySelection *ChildrenWithMtmL(TUid)
IMPORT_C CMsvEntrySelection *ChildrenWithServiceL(TMsvId)
IMPORT_C CMsvEntrySelection *ChildrenWithTypeL(TUid)
IMPORT_C CMsvOperation *CopyL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C CMsvOperation *CopyL(TMsvId, TMsvId, TRequestStatus &)
IMPORT_C voidCopyL(const CMsvEntrySelection &, TMsvId, TMsvLocalOperationProgress &)
IMPORT_C voidCopyL(TMsvId, TMsvId)
TInt Count()
IMPORT_C CMsvOperation *CreateL(const TMsvEntry &, TRequestStatus &)
IMPORT_C CMsvOperation *CreateL(const TMsvEntry &, TSecureId, TRequestStatus &)
IMPORT_C voidCreateL(TMsvEntry &)
IMPORT_C voidCreateL(TMsvEntry &, TSecureId)
IMPORT_C CMsvOperation *DeleteL(const CMsvEntrySelection &, TRequestStatus &)
IMPORT_C CMsvOperation *DeleteL(TMsvId, TRequestStatus &)
IMPORT_C voidDeleteL(TMsvId)
IMPORT_C voidDeleteL(const CMsvEntrySelection &, TMsvLocalOperationProgress &)
IMPORT_C CMsvStore *EditStoreL()
const TMsvEntry &Entry()
TMsvId EntryId()
voidHandleSessionEventL(TMsvSessionEvent, TAny *, TAny *, TAny *)
voidHandleStoreEvent(TMsvStoreEvent, TMsvId)
IMPORT_C TBoolHasStoreL()
IMPORT_C CMsvOperation *MoveL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C CMsvOperation *MoveL(TMsvId, TMsvId, TRequestStatus &)
IMPORT_C voidMoveL(TMsvId, TMsvId)
IMPORT_C voidMoveL(const CMsvEntrySelection &, TMsvId, TMsvLocalOperationProgress &)
IMPORT_C CMsvEntry *NewL(CMsvSession &, TMsvId, const TMsvSelectionOrdering &)
TMsvId OwningService()
IMPORT_C CMsvStore *ReadStoreL()
IMPORT_C voidRemoveObserver(MMsvEntryObserver &)
CMsvSession &Session()
IMPORT_C voidSetEntryL(TMsvId)
IMPORT_C voidSetEntryNoCheckL(TMsvId)
IMPORT_C voidSetMtmListL(const CArrayFix< TUid > &)
IMPORT_C voidSetSortTypeL(const TMsvSelectionOrdering &)
const TMsvSelectionOrdering &SortType()
IMPORT_C const TMsvEntry &operator[](TInt)
Private Member Functions
CMsvEntry(CMsvSession &, const TMsvSelectionOrdering &)
TBool AreChildren(const CMsvEntrySelection &)
voidCheckDeletedGrandchildrenL(TMsvId)
voidCheckIfContextMovedL(const CMsvEntrySelection &)
voidCheckNewGrandchildrenL(TMsvId)
voidChildrenChangedL(const CMsvEntrySelection &)
voidConstructL(TMsvId)
voidContextChangedL(MMsvEntryObserver::TMsvEntryEvent)
TInt CopyOneL(TMsvId, TMsvId)
voidDeleteChild(TInt)
TInt DeleteOneL(TMsvId)
voidDeletedChildrenL(const CMsvEntrySelection &)
CMsvOperation *DoDeleteL(const CMsvEntrySelection &, TRequestStatus &)
voidDoGetChildrenL()
CMsvClientEntry *DoGetEntryLC(TMsvId, TMsvId &)
CMsvEntrySelection *DoGetNewChildrenL(const CMsvEntrySelection &)
CMsvEntrySelection *DoMakeSelectionL(TMsvId)
voidDoSortTypeL(CMsvClientEntry *)
CMsvEntryArray *GetNewSortedListL(const TMsvSelectionOrdering &, const CArrayFix< TUid > &)
voidHandleMediaChangeL()
TBool IsAChild(TMsvId)
voidLog(TRefByValue< const TDesC >, ...)
TInt MoveOneL(TMsvId, TMsvId)
voidNewChildrenL(const CMsvEntrySelection &)
voidNotifyAllObserversL(MMsvEntryObserver::TMsvEntryEvent, TAny *, TAny *, TAny *)
voidNotifyChildChangedL(TMsvId)
voidReplaceChildL(TInt, const TMsvEntry &)
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 Member Enumerations
enumTEntryState { EValid, EInvalidChangingContext, EInvalidDeletedContext, EInvalidOldContext, EInvalidMissingChildren }
Private Attributes
CArrayPtrFlat< CMsvClientEntry > *iEntries
const TMsvEntry *iEntryPtr
CMsvSession &iMsvSession
CArrayFixFlat< TUid > *iMtmList
TUint32 iNotifySequence
TBool iOberserverAdded
CArrayPtrFlat< MMsvEntryObserver > *iObservers
TMsvSelectionOrdering iOrdering
TMsvId iOwningService
CMsvEntryArray *iSortedChildren
TEntryState iState
CMsvStore *iStore

Constructor & Destructor Documentation

CMsvEntry(CMsvSession &, const TMsvSelectionOrdering &)

CMsvEntry(CMsvSession &aMsvSession,
const TMsvSelectionOrdering &aOrdering
)[private]

Parameters

CMsvSession & aMsvSession
const TMsvSelectionOrdering & aOrdering

~CMsvEntry()

IMPORT_C~CMsvEntry()

Destructor.

This cleans up the object. CMsvEntry objects must be deleted by client applications when they are no longer required. Note that deleting a CMsvEntry object does not delete the context, simply the immediate means of accessing it.

Member Functions Documentation

AddObserverL(MMsvEntryObserver &)

IMPORT_C voidAddObserverL(MMsvEntryObserver &aObserver)

Registers an observer for the object.

CMsvEntry objects can call back observer objects that implement the MMsvEntryObserver interface when certain events occur. Any number of observers can be registered.

Observers are called primarily when the context changes state or contents. For details, see MMsvEntryObserver::TMsvEntryEvent.

leave
KErrNoMemory Not enough memory to register the observer

Parameters

MMsvEntryObserver & aObserverThe observer to be registered for events

AreChildren(const CMsvEntrySelection &)

TBool AreChildren(const CMsvEntrySelection &aSelection)const [private]

Parameters

const CMsvEntrySelection & aSelection

ChangeAttributesL(const CMsvEntrySelection &, TUint, TUint)

IMPORT_C voidChangeAttributesL(const CMsvEntrySelection &aSelection,
TUintaSetAttributes,
TUintaClearAttributes
)

Sets or clears multiple fields in a selection of children of the context.

Fields to change are specified using a bitmask of TMsvAttribute values. Possible fields that can be changed using this function are the PC synchronisation, Visibility, Pending Deletion, Read, In-preparation, Connected, and New flags.

leave
KErrNotFound An entry was not a child of the context
CMsvSession::ChangeAttributesL()

Parameters

const CMsvEntrySelection & aSelectionThe entries to change
TUint aSetAttributesA bitmask of the fields to set
TUint aClearAttributesA bitmask of the fields to clear

ChangeL(const TMsvEntry &)

IMPORT_C voidChangeL(const TMsvEntry &aEntry)

Sets the context's index entry to the specified values. The function is performed synchronously.

This function can only be used on local entries.

leave
KErrAccessDenied The entry is locked by another client
leave
KErrArgument aEntry is invalid or the ID specified in aEntry is not the same as the context ID
leave
KErrNoMemory The operation could not be created or passed to the server

Parameters

const TMsvEntry & aEntryThe new index entry values for the context

ChangeL(const TMsvEntry &, TSecureId)

IMPORT_C voidChangeL(const TMsvEntry &aEntry,
TSecureIdaOwnerId
)

Sets the context's index entry to the specified values. The function is performed synchronously. Sets the owner of the changed entry to process specified by the supplied ID.

This function can only be used on local entries.

leave
KErrAccessDenied The entry is locked by another client
leave
KErrArgument aEntry is invalid or the ID specified in aEntry is not the same as the context ID
leave
KErrNoMemory The operation could not be created or passed to the server

Parameters

const TMsvEntry & aEntryThe new index entry values for the context
TSecureId aOwnerIdThe ID of process that owns the changed entry.

ChangeL(const TMsvEntry &, TRequestStatus &)

IMPORT_C CMsvOperation *ChangeL(const TMsvEntry &aEntry,
TRequestStatus &aStatus
)

Sets the context's index entry to the specified values. The returned CMsvOperation object completes when the change is complete.

It is important to note that the state of the context is undefined until the observer of the entry has been informed that the entry has been changed, or the operation is completed with an error. If the function leaves, the context is unchanged.

leave
KErrAccessDenied The entry is locked by another client
leave
KErrArgument aEntry is invalid or the ID specified in aEntry is not the same as the context ID
leave
KErrNoMemory The operation could not be created or passed to the server

Parameters

const TMsvEntry & aEntryThe new index entry values for the context
TRequestStatus & aStatusThe request status to be completed when the operation has finished

ChangeL(const TMsvEntry &, TSecureId, TRequestStatus &)

IMPORT_C CMsvOperation *ChangeL(const TMsvEntry &aEntry,
TSecureIdaOwnerId,
TRequestStatus &aStatus
)

Sets the context's index entry to the specified values. The returned CMsvOperation object completes when the change is complete. Sets the owner of the changed entry to process specified by the supplied ID.

It is important to note that the state of the context is undefined until the observer of the entry has been informed that the entry has been changed, or the operation is completed with an error. If the function leaves, the context is unchanged.

leave
KErrAccessDenied The entry is locked by another client
leave
KErrArgument aEntry is invalid or the ID specified in aEntry is not the same as the context ID
leave
KErrNoMemory The operation could not be created or passed to the server

Parameters

const TMsvEntry & aEntryThe new index entry values for the context
TSecureId aOwnerIdThe ID of process that owns the changed entry.
TRequestStatus & aStatusThe request status to be completed when the operation has finished

CheckDeletedGrandchildrenL(TMsvId)

voidCheckDeletedGrandchildrenL(TMsvIdaId)[private]

Parameters

TMsvId aId

CheckIfContextMovedL(const CMsvEntrySelection &)

voidCheckIfContextMovedL(const CMsvEntrySelection &aSelection)[private]

Parameters

const CMsvEntrySelection & aSelection

CheckNewGrandchildrenL(TMsvId)

voidCheckNewGrandchildrenL(TMsvIdaId)[private]

Parameters

TMsvId aId

ChildDataL(TMsvId)

IMPORT_C const TMsvEntry &ChildDataL(TMsvIdaId)const

Gets the index entry of context's child with the specified ID.

leave
KErrNotFound No child exists with that ID

Parameters

TMsvId aIdID of the child

ChildEntryL(TMsvId)

IMPORT_C CMsvEntry *ChildEntryL(TMsvIdaId)const

Gets a new CMsvEntry object with its context set to the child entry ID. aMsvId must specify a child of the current context.

The CMsvEntry object must be deleted by the client application when it is no longer required.

leave
KErrNotFound aMsvId does not specify a child of the context

Parameters

TMsvId aIdID of a child entry

ChildrenChangedL(const CMsvEntrySelection &)

voidChildrenChangedL(const CMsvEntrySelection &aSelection)[private]

Parameters

const CMsvEntrySelection & aSelection

ChildrenL()

IMPORT_C CMsvEntrySelection *ChildrenL()const

Gets a selection containing the IDs of all the context children. If the entry has no children, the selection is empty.

The calling function is responsible for the deletion of the returned CMsvEntrySelection.

leave
KErrNoMemory Not enough memory to create the selection

ChildrenWithMtmL(TUid)

IMPORT_C CMsvEntrySelection *ChildrenWithMtmL(TUidaMtm)const

Gets a selection containing the IDs of all the context children filtered by MTM type. i.e. the index entry's iMtm field equals aMtm.

If the entry has no such children, the selection is empty.

The calling function is responsible for the deletion of the returned CMsvEntrySelection.

leave
KErrNoMemory Not enough memory to create the selection

Parameters

TUid aMtmMTM type by which to filter

ChildrenWithServiceL(TMsvId)

IMPORT_C CMsvEntrySelection *ChildrenWithServiceL(TMsvIdaServiceId)const

Gets a selection containing the IDs of all the context children filtered by message service. i.e. the index entry's iServiceId field equals aId.

If the entry has no such children, the selection is empty.

The calling function is responsible for the deletion of the returned CMsvEntrySelection.
leave
KErrNoMemory Not enough memory to create the selection

Parameters

TMsvId aServiceIdService by which to filter

ChildrenWithTypeL(TUid)

IMPORT_C CMsvEntrySelection *ChildrenWithTypeL(TUidaType)const

Gets a selection containing the IDs of all the context children filtered by entry type. i.e. is the entry a folder, a message, etc.

If the entry has no such children, the selection is empty.

The calling function is responsible for the deletion of the returned CMsvEntrySelection.

leave
KErrNoMemory Not enough memory to create the selection

Parameters

TUid aTypeEntry type by which to filter.

ConstructL(TMsvId)

voidConstructL(TMsvIdaMsvId)[private]

Parameters

TMsvId aMsvId

ContextChangedL(MMsvEntryObserver::TMsvEntryEvent)

voidContextChangedL(MMsvEntryObserver::TMsvEntryEventaEvent)[private]

CopyL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C CMsvOperation *CopyL(const CMsvEntrySelection &aSelection,
TMsvIdaTargetId,
TRequestStatus &aStatus
)

Creates, asynchronously. copies of children of the context as new entries owned by the specified target ID.

All descendants will be copied as well. Any files and stores associated with the entries are also copied.

The returned CMsvOperation object completes when copying is complete.

leave
KErrNoMemory The operation could not be created or passed to the server
leave
KErrNotFound An entry was not a child of the context

Parameters

const CMsvEntrySelection & aSelectionList of IDs of the entries to be copied
TMsvId aTargetIdThe ID of the entry to own the copies
TRequestStatus & aStatusThe request status to be completed when the operation has finished

CopyL(TMsvId, TMsvId, TRequestStatus &)

IMPORT_C CMsvOperation *CopyL(TMsvIdaMsvId,
TMsvIdaTargetId,
TRequestStatus &aStatus
)

Creates, asynchronously, a copy of a child of the context as a new entry owned by the specified target ID.

All descendants will be copied as well. Any files and stores associated with the entry are also copied.

The returned CMsvOperation object completes when copying is complete.

leave
KErrNoMemory The operation could not be created or passed to the server
leave
KErrNotFound An entry was not a child of the context

Parameters

TMsvId aMsvIdThe ID of the entry to be copied
TMsvId aTargetIdThe ID of the entry to own the copy
TRequestStatus & aStatusThe request status to be completed when the operation has finished

CopyL(const CMsvEntrySelection &, TMsvId, TMsvLocalOperationProgress &)

IMPORT_C voidCopyL(const CMsvEntrySelection &aSelection,
TMsvIdaTargetId,
TMsvLocalOperationProgress &aProgress
)

Creates, synchronously. copies of children of the context as new entries owned by the specified target ID.

All descendants will be copied as well. Any files and stores associated with the entries are also copied.

leave
KErrNoMemory
leave
KErrNotFound An entry was not a child of the context

Parameters

const CMsvEntrySelection & aSelectionList of IDs of the entries to be copied
TMsvId aTargetIdThe ID of the entry to own the copies
TMsvLocalOperationProgress & aProgressOn return, records the outcome of the copy

CopyL(TMsvId, TMsvId)

IMPORT_C voidCopyL(TMsvIdaMsvId,
TMsvIdaTargetId
)

Creates, synchronously, a copy of a child of the context as a new entry owned by the specified target ID.

Parameters

TMsvId aMsvIdThe ID of the entry to be copied
TMsvId aTargetIdThe ID of the entry to own the copy

CopyOneL(TMsvId, TMsvId)

TInt CopyOneL(TMsvIdaMsvId,
TMsvIdaTargetId
)[private]

Parameters

TMsvId aMsvId
TMsvId aTargetId

Count()

TInt Count()const [inline]

Gets the number of children of the context.

CreateL(const TMsvEntry &, TRequestStatus &)

IMPORT_C CMsvOperation *CreateL(const TMsvEntry &aEntry,
TRequestStatus &aStatus
)

Creates a new child entry owned by the context asynchronously.

Note that all session observers are notified when a new entry is created with an EMsvEntriesCreated event (see TMsvSessionEvent). CMsvEntry objects are such session observers themselves. When the object receives such a session notification, it calls all registered entry observers with a TMsvEntryEvent event EMsvNewChildren, passing in the ID of the new child.

If aEntry is not a service entry, then the context must not be set to the root entry and iServiceId field must be defined . If aEntry is a service entry, then the context must be set to the root entry.

The returned CMsvOperation object completes when creation is complete.

leave
KErrArgument aEntry is invalid

Parameters

const TMsvEntry & aEntryIndex entry value for the new entry
TRequestStatus & aStatusThe request status to be completed when the operation has finished

CreateL(const TMsvEntry &, TSecureId, TRequestStatus &)

IMPORT_C CMsvOperation *CreateL(const TMsvEntry &aEntry,
TSecureIdaOwnerId,
TRequestStatus &aStatus
)

Creates a new child entry owned by the context asynchronously. Sets the owner of the created entry to process specified by the supplied ID.

Note that all session observers are notified when a new entry is created with an EMsvEntriesCreated event (see TMsvSessionEvent). CMsvEntry objects are such session observers themselves. When the object receives such a session notification, it calls all registered entry observers with a TMsvEntryEvent event EMsvNewChildren, passing in the ID of the new child.

If aEntry is not a service entry, then the context must not be set to the root entry and iServiceId field must be defined . If aEntry is a service entry, then the context must be set to the root entry.

The returned CMsvOperation object completes when creation is complete.

leave
KErrArgument aEntry is invalid

Parameters

const TMsvEntry & aEntryIndex entry value for the new entry
TSecureId aOwnerIdThe ID of process that owns the created entry.
TRequestStatus & aStatusThe request status to be completed when the operation has finished

CreateL(TMsvEntry &)

IMPORT_C voidCreateL(TMsvEntry &aEntry)

Creates a new child entry owned by the context synchronously.

Note that all session observers are notified when a new entry is created with an EMsvEntriesCreated event (see TMsvSessionEvent). CMsvEntry objects are such session observers themselves. When the object receives such a session notification, it calls all registered entry observers with a TMsvEntryEvent event EMsvNewChildren, passing in the ID of the new child.

If aEntry is not a service entry, then the context must not be set to the root entry and iServiceId field must be defined . If aEntry is a service entry, then the context must be set to the root entry.

This function can only be used on local entries.

leave
KErrArgument aEntry is invalid

Parameters

TMsvEntry & aEntryIndex entry value for the new entry

CreateL(TMsvEntry &, TSecureId)

IMPORT_C voidCreateL(TMsvEntry &aEntry,
TSecureIdaOwnerId
)

Creates a new child entry owned by the context synchronously. Sets the owner of the created entry to process specified by the supplied ID.

Note that all session observers are notified when a new entry is created with an EMsvEntriesCreated event (see TMsvSessionEvent). CMsvEntry objects are such session observers themselves. When the object receives such a session notification, it calls all registered entry observers with a TMsvEntryEvent event EMsvNewChildren, passing in the ID of the new child.

If aEntry is not a service entry, then the context must not be set to the root entry and iServiceId field must be defined . If aEntry is a service entry, then the context must be set to the root entry.

This function can only be used on local entries.

leave
KErrArgument aEntry is invalid

Parameters

TMsvEntry & aEntryIndex entry value for the new entry
TSecureId aOwnerIdThe ID of process that owns the created entry.

DeleteChild(TInt)

voidDeleteChild(TIntaPosition)[private]

Parameters

TInt aPosition

DeleteL(const CMsvEntrySelection &, TRequestStatus &)

IMPORT_C CMsvOperation *DeleteL(const CMsvEntrySelection &aSelection,
TRequestStatus &aStatus
)

Deletes child entries of the context asynchronously.

The delete works recursively through all the descendants. If a child or any descendant is locked by another client or any store or file is open, then that child will not be deleted. Any files and stores associated with the entries are deleted.

The returned CMsvOperation object completes when deletion is complete.

leave
KErrNotFound A specified entry was not a child of the context
leave
KErrNotSupported If deleting entries from non-current drive

Parameters

const CMsvEntrySelection & aSelectionList of ID of the entries to be deleted
TRequestStatus & aStatusThe request status to be completed when the operation has finished

DeleteL(TMsvId, TRequestStatus &)

IMPORT_C CMsvOperation *DeleteL(TMsvIdaMsvId,
TRequestStatus &aStatus
)

Deletes a child entry of the context asynchronously.

The delete works recursively through all the descendants. If a child or any descendant is locked by another client or any store or file is open, then that child will not be deleted. Any files and stores associated with the entry are deleted.

The returned CMsvOperation object completes when deletion is complete.

leave
KErrNotFound The specified entry was not a child of the context
leave
KErrNotSupported If deleting entries from non-current drive

Parameters

TMsvId aMsvIdID of entry to be deleted
TRequestStatus & aStatusThe request status to be completed when the operation has finished

DeleteL(TMsvId)

IMPORT_C voidDeleteL(TMsvIdaId)

Deletes a child entry of the context synchronously.

The delete works recursively through all the descendants. If a child or any descendant is locked by another client or any store or file is open, then that child will not be deleted. Any files and stores associated with the entry are deleted.

This function can only be used on local entries.

leave
KErrNotFound The specified entry was not a child of the context
leave
KErrNotSupported If deleting entries from non-current drive

Parameters

TMsvId aIdID of entry to be deleted

DeleteL(const CMsvEntrySelection &, TMsvLocalOperationProgress &)

IMPORT_C voidDeleteL(const CMsvEntrySelection &aSelection,
TMsvLocalOperationProgress &aProgress
)

Deletes child entries of the context synchronously.

The delete works recursively through all the descendants. If a child or any descendant is locked by another client or any store or file is open, then that child will not be deleted. Any files and stores associated with the entries are deleted.

leave
KErrNotFound A specified entry was not a child of the context
leave
KErrNotSupported If deleting entries from non-current drive

Parameters

const CMsvEntrySelection & aSelectionList of ID of the entries to be deleted
TMsvLocalOperationProgress & aProgressProgress information for the delete operation

DeleteOneL(TMsvId)

TInt DeleteOneL(TMsvIdaMsvId)[private]

Parameters

TMsvId aMsvId

DeletedChildrenL(const CMsvEntrySelection &)

voidDeletedChildrenL(const CMsvEntrySelection &aSelection)[private]

Parameters

const CMsvEntrySelection & aSelection

DoDeleteL(const CMsvEntrySelection &, TRequestStatus &)

CMsvOperation *DoDeleteL(const CMsvEntrySelection &aSelection,
TRequestStatus &aStatus
)[private]

Parameters

const CMsvEntrySelection & aSelection
TRequestStatus & aStatus

DoGetChildrenL()

voidDoGetChildrenL()[private]

DoGetEntryLC(TMsvId, TMsvId &)

CMsvClientEntry *DoGetEntryLC(TMsvIdaId,
TMsvId &aOwningService
)[private]

Parameters

TMsvId aId
TMsvId & aOwningService

DoGetNewChildrenL(const CMsvEntrySelection &)

CMsvEntrySelection *DoGetNewChildrenL(const CMsvEntrySelection &aSelection)[private]

Parameters

const CMsvEntrySelection & aSelection

DoMakeSelectionL(TMsvId)

CMsvEntrySelection *DoMakeSelectionL(TMsvIdaId)[private]

Parameters

TMsvId aId

DoSortTypeL(CMsvClientEntry *)

voidDoSortTypeL(CMsvClientEntry *aContext)[private]

Parameters

CMsvClientEntry * aContext

EditStoreL()

IMPORT_C CMsvStore *EditStoreL()

Gets the message store for the current context with read-write access.

Only one client can edit a message store at one time. If another client is already writing to the store, KErrAccessDenied is returned. Other clients can be reading the store.

If the message store does not exist when EditStore() is called, a new message store is created.

The returned CMsvStore must be deleted when it is no longer required.

leave
KErrAccessDenied Store is locked by another process or the entry is read only
leave
KErrNoMemory Not enough memory to open the store

Entry()

const TMsvEntry &Entry()const [inline]

Gets the index entry for the context.

EntryId()

TMsvId EntryId()const [inline]

Gets the ID of the context.

GetNewSortedListL(const TMsvSelectionOrdering &, const CArrayFix< TUid > &)

CMsvEntryArray *GetNewSortedListL(const TMsvSelectionOrdering &aOrdering,
const CArrayFix< TUid > &aMtmList
)[private]

Parameters

const TMsvSelectionOrdering & aOrdering
const CArrayFix< TUid > & aMtmList

HandleMediaChangeL()

voidHandleMediaChangeL()[private]

HandleSessionEventL(TMsvSessionEvent, TAny *, TAny *, TAny *)

voidHandleSessionEventL(TMsvSessionEventaEvent,
TAny *aArg1,
TAny *aArg2,
TAny *aArg3
)

Parameters

TMsvSessionEvent aEvent
TAny * aArg1
TAny * aArg2
TAny * aArg3

HandleStoreEvent(TMsvStoreEvent, TMsvId)

voidHandleStoreEvent(TMsvStoreEventaEvent,
TMsvIdaId
)

Parameters

TMsvStoreEvent aEvent
TMsvId aId

HasStoreL()

IMPORT_C TBoolHasStoreL()const

Checks if the context has an associated message store.

IsAChild(TMsvId)

TBool IsAChild(TMsvIdaId)const [private]

Parameters

TMsvId aId

Log(TRefByValue< const TDesC >, ...)

voidLog(TRefByValue< const TDesC >aFmt,
...
)[private]

Parameters

TRefByValue< const TDesC > aFmt
...

MoveL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C CMsvOperation *MoveL(const CMsvEntrySelection &aSelection,
TMsvIdaTargetId,
TRequestStatus &aStatus
)

Moves, asynchronously, children of the context to become entries owned by the target entry.

All descendants will be moved as well. Any files and stores associated with the entries are also moved.

The returned CMsvOperation object completes when moving is complete.

leave
KErrNoMemory The operation could not be created or passed to the server
leave
KErrNotFound An entry was not a child of the context

Parameters

const CMsvEntrySelection & aSelectionList of IDs of the entries to be moved
TMsvId aTargetIdThe ID of the entry to own the moved entires
TRequestStatus & aStatusThe request status to be completed when the operation has finished

MoveL(TMsvId, TMsvId, TRequestStatus &)

IMPORT_C CMsvOperation *MoveL(TMsvIdaMsvId,
TMsvIdaTargetId,
TRequestStatus &aStatus
)

Moves, asynchronously, a child of the context to become an entry owned by the target entry.

All descendants will be moved as well. Any files and stores associated with the entry are also moved.

The returned CMsvOperation object completes when moving is complete.

leave
KErrNoMemory The operation could not be created or passed to the server
leave
KErrNotFound An entry was not a child of the context

Parameters

TMsvId aMsvIdThe ID of the entry to be moved
TMsvId aTargetIdThe ID of the entry to own the moved entries
TRequestStatus & aStatusThe request status to be completed when the operation has finished

MoveL(TMsvId, TMsvId)

IMPORT_C voidMoveL(TMsvIdaMsvId,
TMsvIdaTargetId
)

Moves, synchronously, a child of the context to become an entry owned by the target entry.

All descendants will be moved as well. Any files and stores associated with the entry are also moved.

leave
KErrNoMemory
leave
KErrNotFound An entry was not a child of the context

Parameters

TMsvId aMsvIdThe ID of the entry to be moved
TMsvId aTargetIdThe ID of the entry to own the moved entries

MoveL(const CMsvEntrySelection &, TMsvId, TMsvLocalOperationProgress &)

IMPORT_C voidMoveL(const CMsvEntrySelection &aSelection,
TMsvIdaTargetId,
TMsvLocalOperationProgress &aProgress
)

Moves, synchronously, children of the context to become entries owned by the target entry.

All descendants will be moved as well. Any files and stores associated with the entries are also moved.

leave
KErrNoMemory
leave
KErrNotFound An entry was not a child of the context

Parameters

const CMsvEntrySelection & aSelectionList of IDs of the entries to be moved
TMsvId aTargetIdThe ID of the entry to own the moved entires
TMsvLocalOperationProgress & aProgressOn return, records the outcome of the move

MoveOneL(TMsvId, TMsvId)

TInt MoveOneL(TMsvIdaMsvId,
TMsvIdaTargetId
)[private]

Parameters

TMsvId aMsvId
TMsvId aTargetId

NewChildrenL(const CMsvEntrySelection &)

voidNewChildrenL(const CMsvEntrySelection &aSelection)[private]

Parameters

const CMsvEntrySelection & aSelection

NewL(CMsvSession &, TMsvId, const TMsvSelectionOrdering &)

IMPORT_C CMsvEntry *NewL(CMsvSession &aMsvSession,
TMsvIdaMsvId,
const TMsvSelectionOrdering &aOrdering
)[static]

Creates a new CMsvEntry for the specified entry ID.

Note that this function does not create a new entry, but simply a new object to access an existing entry. To create a new entry, use CreateL().

leave
KErrNotFound The requested entry does not exist
leave
KErrNoMemory A memory allocation failed

Parameters

CMsvSession & aMsvSessionThe client s Message Server session
TMsvId aMsvIdID of the entry to access
const TMsvSelectionOrdering & aOrdering

NotifyAllObserversL(MMsvEntryObserver::TMsvEntryEvent, TAny *, TAny *, TAny *)

voidNotifyAllObserversL(MMsvEntryObserver::TMsvEntryEventaEvent,
TAny *aArg1,
TAny *aArg2,
TAny *aArg3
)[private]

Parameters

MMsvEntryObserver::TMsvEntryEvent aEvent
TAny * aArg1
TAny * aArg2
TAny * aArg3

NotifyChildChangedL(TMsvId)

voidNotifyChildChangedL(TMsvIdaId)[private]

Parameters

TMsvId aId

OwningService()

TMsvId OwningService()const [inline]

Gets the ID of the service entry that owns the context.

Local entries are considered as being members of the local service:

ReadStoreL()

IMPORT_C CMsvStore *ReadStoreL()

Obtains the message store for the current context with read-only access.

Multiple clients can read from a store simultaneously. If another client is already writing to the store, the function leaves with KErrAccessDenied.

The returned CMsvStore must be deleted when it is no longer required.

leave
KErrNoMemory Not enough memory to open store
leave
KErrAccessDenied Another client is currently writing to the store
leave
KErrNotFound There is no store associated with this entry

RemoveObserver(MMsvEntryObserver &)

IMPORT_C voidRemoveObserver(MMsvEntryObserver &aObserver)

Unregisters an observer previously registered with AddObserverL().

Parameters

MMsvEntryObserver & aObserverA reference to an observer to be unregistered for events

ReplaceChildL(TInt, const TMsvEntry &)

voidReplaceChildL(TIntpos,
const TMsvEntry &aEntry
)[private]

Parameters

TInt pos
const TMsvEntry & aEntry

Session()

CMsvSession &Session()[inline]

Gets the Message Server session used by this object. This is the same session passed by the client in NewL().

SetEntryL(TMsvId)

IMPORT_C voidSetEntryL(TMsvIdaId)

Sets the context to the specified entry.

If the function leaves, the context is unchanged.

leave
KErrNotFound aId could not be found in the index

Parameters

TMsvId aIdID of the message entry which is to become the new context

SetEntryNoCheckL(TMsvId)

IMPORT_C voidSetEntryNoCheckL(TMsvIdaId)

Sets the context to the specified entry.

If the function leaves, the context is unchanged.

leave
KErrNotFound aMsvId could not be found in the index

Parameters

TMsvId aIdID of the message entry which is to become the new context

SetMtmListL(const CArrayFix< TUid > &)

IMPORT_C voidSetMtmListL(const CArrayFix< TUid > &aMtmList)

Sets the MTM order to the specified sort order. When children of an entry are sorted, entries belonging to the same MTM type can be grouped together.

MTM grouping can be switched on or off through setting the appropriate TMsvSelectionOrdering value by SetSortTypeL().

If the function leaves, the sort order is unchanged.

leave
KErrNoMemory Insufficient memory to resort the entries

Parameters

const CArrayFix< TUid > & aMtmListThe order of MTMs to use for sorting

SetSortTypeL(const TMsvSelectionOrdering &)

IMPORT_C voidSetSortTypeL(const TMsvSelectionOrdering &aOrdering)

Sets the sort order that is used when listing children, for example with ChildrenL().

If the function leaves, the sort order is unchanged.

leave
KErrNoMemory Insufficient memory to resort the entries

Parameters

const TMsvSelectionOrdering & aOrderingSort order to use

SortType()

const TMsvSelectionOrdering &SortType()const [inline]

Gets the current sort order of children of the entry. The sort order is initially set through NewL().

operator[](TInt)

IMPORT_C const TMsvEntry &operator[](TIntaIndex)const

Gets the index entry of the child at the position specified by the array index. The child entries of the context can be considered as a zero-based array, with entries sorted according to the current sort order.

Note:

The function panics with E32USER-CBase 21 if aIndex was out of range.

Parameters

TInt aIndexArray index

Member Enumerations Documentation

Enum TEntryState

Enumerators

EValid
EInvalidChangingContext
EInvalidDeletedContext
EInvalidOldContext
EInvalidMissingChildren

Member Data Documentation

CArrayPtrFlat< CMsvClientEntry > * iEntries

CArrayPtrFlat< CMsvClientEntry > *iEntries[private]

const TMsvEntry * iEntryPtr

const TMsvEntry *iEntryPtr[private]

CMsvSession & iMsvSession

CMsvSession &iMsvSession[private]

CArrayFixFlat< TUid > * iMtmList

CArrayFixFlat< TUid > *iMtmList[private]

TUint32 iNotifySequence

TUint32 iNotifySequence[private]

TBool iOberserverAdded

TBool iOberserverAdded[private]

CArrayPtrFlat< MMsvEntryObserver > * iObservers

CArrayPtrFlat< MMsvEntryObserver > *iObservers[private]

TMsvSelectionOrdering iOrdering

TMsvSelectionOrdering iOrdering[private]

TMsvId iOwningService

TMsvId iOwningService[private]

CMsvEntryArray * iSortedChildren

CMsvEntryArray *iSortedChildren[private]

TEntryState iState

TEntryState iState[private]

CMsvStore * iStore

CMsvStore *iStore[private]