CMsvServerEntry Class Reference

class CMsvServerEntry : public CActive

Accesses and acts upon a particular Message Server entry.

It provides similar functionality to that which CMsvEntry gives to client-side programs. The current entry that a CMsvServerEntry object relates is similarly referred to as its context.

A difference to note is that CMsvEntry functions, when used on a remote context, can result in requests to Server-side MTMs to change data on a remote server, as well as the local Message Server index. Naturally, as CMsvServerEntry is designed to be used by Server-side MTMs themselves, its comparable functions only alter the Message Server index.

A CBaseServerMTM-derived object gets an initial CMsvServerEntry on construction. It can get further CMsvServerEntry objects by calling NewEntryL() . The context can be changed by SetEntry() .

The context is locked, preventing it being accessed by other MTMs. The lock is released when the object is deleted, or the context changes.

As with CMsvEntry , CBaseServerMTM functions can be divided into 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).

Inherits from

Public Member Functions
~CMsvServerEntry ()
IMPORT_C TInt ChangeAttributes (const CMsvEntrySelection &, TUint , TUint )
IMPORT_C TInt ChangeEntry (const TMsvEntry &, TSecureId )
IMPORT_C TInt ChangeEntry (const TMsvEntry &)
IMPORT_C TInt ChangeEntryBulk (const TMsvEntry &, TSecureId )
IMPORT_C TInt ChangeEntryBulk (const TMsvEntry &)
IMPORT_C void CompleteBulk ()
IMPORT_C void CopyEntriesL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C void CopyEntriesL (const CMsvEntrySelection &, TMsvId , CMsvEntrySelection &, TRequestStatus &)
IMPORT_C void CopyEntryL ( TMsvId , TMsvId , TRequestStatus &)
IMPORT_C void CopyEntryL ( TMsvId , TMsvId , TMsvId &, TRequestStatus &)
IMPORT_C TInt CreateEntry ( TMsvEntry &)
IMPORT_C TInt CreateEntry ( TMsvEntry &, TSecureId )
IMPORT_C TInt CreateEntry ( TMsvEntry &, TSecureId , TBool )
IMPORT_C TInt CreateEntryBulk ( TMsvEntry &, TSecureId )
IMPORT_C TInt CreateEntryBulk ( TMsvEntry &)
IMPORT_C TInt DeleteEntries ( CMsvEntrySelection &)
IMPORT_C TInt DeleteEntry ( TMsvId )
IMPORT_C CMsvStore * EditStoreL ()
const TMsvEntry & Entry ()
IMPORT_C RFs & FileSession ()
IMPORT_C TInt GetChildren ( CMsvEntrySelection &)
IMPORT_C TInt GetChildrenWithMtm ( TUid , CMsvEntrySelection &)
IMPORT_C TInt GetChildrenWithService ( TMsvId , CMsvEntrySelection &)
IMPORT_C TInt GetChildrenWithType ( TUid , CMsvEntrySelection &)
IMPORT_C TInt GetEntryFromId ( TMsvId , TMsvEntry *&)
void HandleStoreEvent ( MMsvStoreObserver::TMsvStoreEvent , TMsvId )
IMPORT_C TBool HasStoreL ()
IMPORT_C void MoveEntriesL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C TInt MoveEntriesWithinService ( CMsvEntrySelection &, TMsvId )
IMPORT_C void MoveEntryL ( TMsvId , TMsvId , TRequestStatus &)
IMPORT_C TInt MoveEntryWithinService ( TMsvId , TMsvId )
IMPORT_C CMsvServerEntry * NewEntryL ( TMsvId )
IMPORT_C CMsvServerEntry * NewL ( CMsvServer &, TMsvId )
IMPORT_C TMsvId OwningService ()
IMPORT_C CMsvStore * ReadStoreL ()
IMPORT_C TInt SetEntry ( TMsvId )
void SetMtm ( TUid )
void SetSort ( TMsvSelectionOrdering &)
const TMsvSelectionOrdering & Sort ()
Protected Member Functions
CMsvServerEntry ( CMsvServer &)
void ConstructL ( TMsvId )
void DoCancel ()
void RunL ()
Private Member Functions
TBool AreChildren (const CMsvEntrySelection &)
TInt DoChangeEntry (const TMsvEntry &, TSecureId , TBool , TBool )
void DoCopyEntriesL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
void DoDeleteEntriesL ( CMsvEntrySelection &, CMsvEntrySelection *&, CMsvEntrySelection *&)
void DoDeleteEntryL ( TMsvId , CMsvEntrySelection *&, CMsvEntrySelection *&)
TInt DoGetChildren ( TMsvId , TUid , TUid , CMsvEntrySelection &)
void DoGetChildrenL ( TMsvId , TUid , TUid , CMsvEntrySelection &)
void DoMoveEntriesL ( CMsvEntrySelection &, TMsvId , CMsvEntrySelection *&)
void DoMoveEntryL ( TMsvId , TMsvId )
TInt IncreaseBufferSizes ( TInt , TInt )
TBool IsAChild ( TMsvId )
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
Inherited Enumerations
CActive:TPriority
Private Attributes
TMsvId * iCompletedEntryId
CMsvEntrySelection * iCompletedSelection
TSecureId iContextOwnerId
CMsvCopyMoveEntriesBase * iCopyMove
HBufC * iDescription
HBufC * iDetails
TMsvEntry iEntry
enum CMsvServerEntry::@78 iEntryState
TBool iLockedStore
TUid iMtm
TRequestStatus * iObserverStatus
TMsvSelectionOrdering iOrdering
CMsvServer & iServer
TMsvId iSource
CMsvStore * iStore
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CMsvServerEntry(CMsvServer &)

CMsvServerEntry ( CMsvServer & aIndex ) [protected]

Parameters

CMsvServer & aIndex

~CMsvServerEntry()

~CMsvServerEntry ( )

Frees resources for the object. It:

1. releases the lock on the entry

2. releases the lock on the associated message store if has been opened with EditStoreL()

3. cancels any outstanding asynchronous MoveEntryL() move operation

Member Functions Documentation

AreChildren(const CMsvEntrySelection &)

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

Parameters

const CMsvEntrySelection & aSelection

ChangeAttributes(const CMsvEntrySelection &, TUint, TUint)

IMPORT_C TInt ChangeAttributes ( const CMsvEntrySelection & aSelection,
TUint aSetAttributes,
TUint aClearAttributes
)

Provides a quick way to set or clear multiple fields in a selection of entries.

Fields to change are specified using a bitmask of TMsvAttribute values. Possible fields that can be changed using this function are:

1. PC synchronisation

2. Visibility flag

3. Read flag

4. In-preparation flag

5. Connected flag

6. New flag

TMsvAttribute

Parameters

const CMsvEntrySelection & aSelection The entries to change
TUint aSetAttributes A bitmask of the fields to set
TUint aClearAttributes A bitmask of the fields to clear

ChangeEntry(const TMsvEntry &, TSecureId)

IMPORT_C TInt ChangeEntry ( const TMsvEntry & aEntry,
TSecureId aOwnerId
)

Sets the context's index entry to the specified values and updates the owner of the entry to that specified by the supplied ID.

Parameters

const TMsvEntry & aEntry The new details for the entry.
TSecureId aOwnerId The ID of the process that should own the entry.

ChangeEntry(const TMsvEntry &)

IMPORT_C TInt ChangeEntry ( const TMsvEntry & aEntry )

Sets the context's index entry to the specified values.

Parameters

const TMsvEntry & aEntry The new details for the entry.

ChangeEntryBulk(const TMsvEntry &, TSecureId)

IMPORT_C TInt ChangeEntryBulk ( const TMsvEntry & aEntry,
TSecureId aOwnerId
)

Sets the context's index entry to the specified values and updates the owner of the entry to that specified by the supplied ID. It does this as part of a bulk operation, so the changes are not immediately committed to file.

Parameters

const TMsvEntry & aEntry The new details for the entry.
TSecureId aOwnerId The ID of the process that should own the entry. Only commits changes to file at specified bulk commit interval.

ChangeEntryBulk(const TMsvEntry &)

IMPORT_C TInt ChangeEntryBulk ( const TMsvEntry & aEntry )

Sets the context's index entry to the specified values and updates the owner of the entry to that specified by the supplied ID. It does this as part of a bulk operation, so the changes are not immediately committed to file.

Parameters

const TMsvEntry & aEntry The new details for the entry.

CompleteBulk()

IMPORT_C void CompleteBulk ( )

Completes the current bulk transaction (if any) Requests that the message server commit to the index file on disk any entries which have not been committed and to generate notifications for any entries which require them.

ConstructL(TMsvId)

void ConstructL ( TMsvId aId ) [protected]

Parameters

TMsvId aId

CopyEntriesL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void CopyEntriesL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aObserverStatus
)

Copies a selection of children of the context to another entry that belongs to a different service. All descendants will be copied as well.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

leave
KErrArgument The destination is a child of an aSelection entry
leave
KErrInUse The store or a file associated with an entry is open
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound An aSelection entry is not a child of the context
leave
KErrPathNotFound The destination does not exist

Parameters

const CMsvEntrySelection & aSelection The IDs of the entry to copy. On return, contains the children that could not be fully copied.
TMsvId aDestination The ID of new parent
TRequestStatus & aObserverStatus The request status to be completed when the operation has finished

CopyEntriesL(const CMsvEntrySelection &, TMsvId, CMsvEntrySelection &, TRequestStatus &)

IMPORT_C void CopyEntriesL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
CMsvEntrySelection & aCompletedSelection,
TRequestStatus & aObserverStatus
)

Copies a selection of children of the context to another entry that belongs to a different service. All descendants will be copied as well.

This overload returns the IDs of the new entries.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

leave
KErrArgument The destination is a child of an aSelection entry
leave
KErrInUse The store or a file associated with an entry is open
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound An aSelection entry is not a child of the context
leave
KErrPathNotFound The destination does not exist

Parameters

const CMsvEntrySelection & aSelection The IDs of the entry to copy. On return, contains the children that could not be fully copied.
TMsvId aDestination The ID of new parent
CMsvEntrySelection & aCompletedSelection On return, the IDs of the new entries.
TRequestStatus & aObserverStatus The request status to be completed when the operation has finished

CopyEntryL(TMsvId, TMsvId, TRequestStatus &)

IMPORT_C void CopyEntryL ( TMsvId aId,
TMsvId aDestination,
TRequestStatus & aObserverStatus
)

Copies a child of the context to another entry. All descendants will be copied as well.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

If the function leaves, no changes are made.

leave
KErrArgument The destination is a child of an aSelection entry
leave
KErrInUse The store or a file associated with an entry is open
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound An aSelection entry is not a child of the context
leave
KErrPathNotFound The destination does not exist

Parameters

TMsvId aId The ID of the entry to copy
TMsvId aDestination The ID of new parent
TRequestStatus & aObserverStatus The request status to be completed when the operation has finished

CopyEntryL(TMsvId, TMsvId, TMsvId &, TRequestStatus &)

IMPORT_C void CopyEntryL ( TMsvId aId,
TMsvId aDestination,
TMsvId & aCompletedEntry,
TRequestStatus & aObserverStatus
)

Copies a child of the context to another entry. All descendants will be copied as well.

This overload returns the ID of the new entry.

The copy is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the copy is complete.

If the function leaves, no changes are made.

leave
KErrArgument The destination is a child of an aSelection entry
leave
KErrInUse The store or a file associated with an entry is open
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound An aSelection entry is not a child of the context
leave
KErrPathNotFound The destination does not exist

Parameters

TMsvId aId The ID of the entry to copy
TMsvId aDestination The ID of new parent
TMsvId & aCompletedEntry On return, the ID of the new entry
TRequestStatus & aObserverStatus The request status to be completed when the operation has finished

CreateEntry(TMsvEntry &)

IMPORT_C TInt CreateEntry ( TMsvEntry & aEntry )

Creates a new entry as a child of the current context.

The parent ID and entry ID are set by the Message Server.

Parameters

TMsvEntry & aEntry Index entry value for the new entry

CreateEntry(TMsvEntry &, TSecureId)

IMPORT_C TInt CreateEntry ( TMsvEntry & aEntry,
TSecureId aOwnerId
)

Creates a new entry as a child of the current context.

Ownership of the created entry is given to the process with the specified SID.

The parent ID and entry ID are set by the Message Server.

Parameters

TMsvEntry & aEntry Index entry value for the new entry
TSecureId aOwnerId The SID of the process that will own the create entry.

CreateEntry(TMsvEntry &, TSecureId, TBool)

IMPORT_C TInt CreateEntry ( TMsvEntry & aEntry,
TSecureId aOwnerId,
TBool aBulk
)

Creates a new entry as a child of the current context.

Ownership of the created entry is given to the process with the specified SID.

The parent ID and entry ID are set by the Message Server.

Parameters

TMsvEntry & aEntry Index entry value for the new entry
TSecureId aOwnerId The SID of the process that will own the create entry.
TBool aBulk A boolean value to indicate whether this is part of a bulk operation. (ETrue = bulk)

CreateEntryBulk(TMsvEntry &, TSecureId)

IMPORT_C TInt CreateEntryBulk ( TMsvEntry & aEntry,
TSecureId aOwnerId
)

Creates a new entry as a child of the current context as part of a bulk creation operation. The entry will not be committed to file immediately.

The parent ID and entry ID are set by the Message Server.

Parameters

TMsvEntry & aEntry Index entry value for the new entry
TSecureId aOwnerId The SID of the process that will own the create entry.

CreateEntryBulk(TMsvEntry &)

IMPORT_C TInt CreateEntryBulk ( TMsvEntry & aEntry )

Creates a new entry as a child of the current context as part of a bulk creation operation

The parent ID and entry ID are set by the Message Server.

Parameters

TMsvEntry & aEntry Index entry value for the new entry

DeleteEntries(CMsvEntrySelection &)

IMPORT_C TInt DeleteEntries ( CMsvEntrySelection & aSelection )

Deletes a selection of child entries. The delete works recursively through all the descendants.

If a child or any descendant is locked by another client, then no entries are deleted.

Parameters

CMsvEntrySelection & aSelection The entries to delete. On return, contains the children that could not be fully deleted

DeleteEntry(TMsvId)

IMPORT_C TInt DeleteEntry ( TMsvId aId )

Deletes a child entry of the context. The delete works recursively through all the descendants.

If a child or any descendant is locked by another client, then no entries are deleted.

Parameters

TMsvId aId The ID of the entry to delete

DoCancel()

void DoCancel ( ) [protected, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

DoChangeEntry(const TMsvEntry &, TSecureId, TBool, TBool)

TInt DoChangeEntry ( const TMsvEntry & aEntry,
TSecureId aOwnerId,
TBool aForcedUpdate,
TBool aBulk
) [private]

Parameters

const TMsvEntry & aEntry
TSecureId aOwnerId
TBool aForcedUpdate
TBool aBulk

DoCopyEntriesL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

void DoCopyEntriesL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aObserverStatus
) [private]

Parameters

const CMsvEntrySelection & aSelection
TMsvId aDestination
TRequestStatus & aObserverStatus

DoDeleteEntriesL(CMsvEntrySelection &, CMsvEntrySelection *&, CMsvEntrySelection *&)

void DoDeleteEntriesL ( CMsvEntrySelection & aSelection,
CMsvEntrySelection *& aDeleted,
CMsvEntrySelection *& aMoved
) [private]

Parameters

CMsvEntrySelection & aSelection
CMsvEntrySelection *& aDeleted
CMsvEntrySelection *& aMoved

DoDeleteEntryL(TMsvId, CMsvEntrySelection *&, CMsvEntrySelection *&)

void DoDeleteEntryL ( TMsvId aId,
CMsvEntrySelection *& aDeleted,
CMsvEntrySelection *& aMoved
) [private]

Parameters

TMsvId aId
CMsvEntrySelection *& aDeleted
CMsvEntrySelection *& aMoved

DoGetChildren(TMsvId, TUid, TUid, CMsvEntrySelection &)

TInt DoGetChildren ( TMsvId aServiceId,
TUid aMtm,
TUid aType,
CMsvEntrySelection & aSelection
) [private]

Parameters

TMsvId aServiceId
TUid aMtm
TUid aType
CMsvEntrySelection & aSelection

DoGetChildrenL(TMsvId, TUid, TUid, CMsvEntrySelection &)

void DoGetChildrenL ( TMsvId aServiceId,
TUid aMtm,
TUid aType,
CMsvEntrySelection & aSelection
) [private]

Parameters

TMsvId aServiceId
TUid aMtm
TUid aType
CMsvEntrySelection & aSelection

DoMoveEntriesL(CMsvEntrySelection &, TMsvId, CMsvEntrySelection *&)

void DoMoveEntriesL ( CMsvEntrySelection & aSelection,
TMsvId aDestination,
CMsvEntrySelection *& aMoved
) [private]

Parameters

CMsvEntrySelection & aSelection
TMsvId aDestination
CMsvEntrySelection *& aMoved

DoMoveEntryL(TMsvId, TMsvId)

void DoMoveEntryL ( TMsvId aId,
TMsvId aDestination
) [private]

Parameters

TMsvId aId
TMsvId aDestination

EditStoreL()

IMPORT_C CMsvStore * EditStoreL ( )

Obtains 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. However, any number of clients can read from the store simultaneously.

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 is read-only
leave
KErrNoMemory Not enough memory to open store

Entry()

const TMsvEntry & Entry ( ) const [inline]

Gets the context's index entry.

FileSession()

IMPORT_C RFs & FileSession ( )

Allows a Server-side MTM to access the file session handle created by the Message Server. This is preferable, as more efficient, to creating another handle.

GetChildren(CMsvEntrySelection &)

IMPORT_C TInt GetChildren ( CMsvEntrySelection & aSelection )

Gets a selection containing the IDs of all the context children.

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

Parameters

CMsvEntrySelection & aSelection Initially, this must be an empty selection. On return, it lists the children.

GetChildrenWithMtm(TUid, CMsvEntrySelection &)

IMPORT_C TInt GetChildrenWithMtm ( TUid aMtm,
CMsvEntrySelection & aSelection
)

Gets a selection containing the IDs of all the context children with the specified MTM.

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

Parameters

TUid aMtm MTM by which to filter children
CMsvEntrySelection & aSelection Initially, this must be an empty selection. On return, it lists the children.

GetChildrenWithService(TMsvId, CMsvEntrySelection &)

IMPORT_C TInt GetChildrenWithService ( TMsvId aServiceId,
CMsvEntrySelection & aSelection
)

Gets a selection containing the IDs of all the context children with the specified service.

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

Parameters

TMsvId aServiceId Service by which to filter children
CMsvEntrySelection & aSelection Initially, this must be an empty selection. On return, it lists the children.

GetChildrenWithType(TUid, CMsvEntrySelection &)

IMPORT_C TInt GetChildrenWithType ( TUid aType,
CMsvEntrySelection & aSelection
)

Gets a selection containing the IDs of all the context children with the specified entry type.

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

Parameters

TUid aType Entry type by which to filter children
CMsvEntrySelection & aSelection Initially, this must be an empty selection. On return, it lists the children.

GetEntryFromId(TMsvId, TMsvEntry *&)

IMPORT_C TInt GetEntryFromId ( TMsvId aId,
TMsvEntry *& aEntry
)

Gets the index entry for a specified entry ID.

Parameters

TMsvId aId ID of the entry to get
TMsvEntry *& aEntry On return, a pointer to the index entry with ID aId

HandleStoreEvent(MMsvStoreObserver::TMsvStoreEvent, TMsvId)

void HandleStoreEvent ( MMsvStoreObserver::TMsvStoreEvent aEvent,
TMsvId aId
)

HasStoreL()

IMPORT_C TBool HasStoreL ( ) const

Tests if the context has an associated message store.

IncreaseBufferSizes(TInt, TInt)

TInt IncreaseBufferSizes ( TInt aNewDescriptionSize,
TInt aNewDetailsSize
) [private]

Parameters

TInt aNewDescriptionSize
TInt aNewDetailsSize

IsAChild(TMsvId)

TBool IsAChild ( TMsvId aId ) const [private]

Parameters

TMsvId aId

MoveEntriesL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void MoveEntriesL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aObserverStatus
)

Moves a selection of children of the context to another entry that belongs to a different service. All descendants will be moved as well.

The move is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the move is complete.

leave
KErrArgument The destination is a child of an aSelection entry
leave
KErrInUse The store or a file associated with an entry is open
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound An aSelection entry is not a child of the context
leave
KErrPathNotFound The destination does not exist

Parameters

const CMsvEntrySelection & aSelection The IDs of the entry to move. On return, contains the children that could not be fully moved.
TMsvId aDestination The ID of new parent
TRequestStatus & aObserverStatus The request status to be completed when the operation has finished

MoveEntriesWithinService(CMsvEntrySelection &, TMsvId)

IMPORT_C TInt MoveEntriesWithinService ( CMsvEntrySelection & aSelection,
TMsvId aDestination
)

Moves a child of the context to under another entry. All descendants will be moved as well. The destination must belong to the same service as the context.

Parameters

CMsvEntrySelection & aSelection The entries to move. On return, contains the children that could not be fully moved.
TMsvId aDestination The ID of new parent

MoveEntryL(TMsvId, TMsvId, TRequestStatus &)

IMPORT_C void MoveEntryL ( TMsvId aId,
TMsvId aDestination,
TRequestStatus & aObserverStatus
)

Moves a child of the context to another entry that belongs to a different service. All descendants will be moved as well.

The move is carried out asynchronously. The caller should supply in aObserverStatus the status word of an active object that it owns. The function will signal this to be completed when the move is complete.

If the function leaves, no changes are made.

In pre-Unicode versions an asynchronous move can be cancelled through CancelMoveEntry(); in other releases, use Cancel() .

leave
KErrArgument The destination is a child of aId
leave
KErrInUse The store or a file associated with the entry is open
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound aId is not a child of the context
leave
KErrPathNotFound The destination does not exist

Parameters

TMsvId aId The ID of the entry to move
TMsvId aDestination The ID of new parent
TRequestStatus & aObserverStatus The request status to be completed when the operation has finished

MoveEntryWithinService(TMsvId, TMsvId)

IMPORT_C TInt MoveEntryWithinService ( TMsvId aId,
TMsvId aDestination
)

Moves a child of the context to under another entry. All descendants will be moved as well. The destination must belong to the same service as the context.

If an error occurs, no changes are made.

For pre-Unicode releases see the synchronous overload of MoveEntry().

Parameters

TMsvId aId The ID of the entry to move
TMsvId aDestination The ID of new parent

NewEntryL(TMsvId)

IMPORT_C CMsvServerEntry * NewEntryL ( TMsvId aId )

Gets a new CMsvServerEntry object for the specified entry ID.

The call locks the entry, preventing it being accessed by other clients.

The object must be deleted when it is no longer required. The lock is released when the object is deleted or the context is changed with SetEntry() .

leave
KErrLocked Entry is locked
leave
KErrNoMemory A memory allocation failed
leave
KErrNotFound The entry does not exist

Parameters

TMsvId aId ID of the entry to access

NewL(CMsvServer &, TMsvId)

IMPORT_C CMsvServerEntry * NewL ( CMsvServer & aServer,
TMsvId aId
) [static]

Parameters

CMsvServer & aServer
TMsvId aId

OwningService()

IMPORT_C TMsvId OwningService ( ) const

Gets the ID of the service that owns the context.

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

If the entry is the root, then the root ID (KMsvRootIndexEntryId) is returned.

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
KErrAccessDenied Store is locked by another process
leave
KErrNoMemory Not enough memory to open store
leave
KErrNotFound There is no store associated with this entry

RunL()

void RunL ( ) [protected, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

SetEntry(TMsvId)

IMPORT_C TInt SetEntry ( TMsvId aId )

Changes the context of the specified entry.

The call locks the entry, preventing it from being accessed by other clients. The lock is released when the object is deleted or the context is changed.

Note that you can change the context to KMsvNullIndexEntryId to unlock an entry without locking another.

Parameters

TMsvId aId ID of the entry to access

SetMtm(TUid)

void SetMtm ( TUid aMtm ) [inline]

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

Parameters

TUid aMtm UID of MTM for sort

SetSort(TMsvSelectionOrdering &)

void SetSort ( TMsvSelectionOrdering & aOrdering ) [inline]

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

Parameters

TMsvSelectionOrdering & aOrdering Sort order to use

Sort()

const TMsvSelectionOrdering & Sort ( ) [inline]

Gets the current sort order of children of the entry.

Member Data Documentation

TMsvId * iCompletedEntryId

TMsvId * iCompletedEntryId [private]

CMsvEntrySelection * iCompletedSelection

CMsvEntrySelection * iCompletedSelection [private]

TSecureId iContextOwnerId

TSecureId iContextOwnerId [private]

CMsvCopyMoveEntriesBase * iCopyMove

CMsvCopyMoveEntriesBase * iCopyMove [private]

HBufC * iDescription

HBufC * iDescription [private]

HBufC * iDetails

HBufC * iDetails [private]

TMsvEntry iEntry

TMsvEntry iEntry [private]

enum CMsvServerEntry::@78 iEntryState

enum CMsvServerEntry::@78 iEntryState [private]

TBool iLockedStore

TBool iLockedStore [private]

TUid iMtm

TUid iMtm [private]

TRequestStatus * iObserverStatus

TRequestStatus * iObserverStatus [private]

TMsvSelectionOrdering iOrdering

TMsvSelectionOrdering iOrdering [private]

CMsvServer & iServer

CMsvServer & iServer [private]

TMsvId iSource

TMsvId iSource [private]

CMsvStore * iStore

CMsvStore * iStore [private]