Location:
msventry.h
Link against:
msgs.lib
CMsvServerEntry
Supported from 5.0
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).
In pre-Unicode releases, this class had an import library msvd.lib and was derived only from CBase
.
|
Defined in CMsvServerEntry
:
Cancel()
, CancelMoveEntry()
, ChangeAttributes()
, ChangeEntry()
, CopyEntriesL()
, CopyEntryL()
, CreateEntry()
, DeleteEntries()
, DeleteEntry()
, EditStoreL()
, Entry()
, FileSession()
, GetChildren()
, GetChildrenWithMtm()
, GetChildrenWithService()
, GetChildrenWithType()
, GetFilePath()
, HasDirectory()
, HasDirectoryL()
, HasStore()
, HasStoreL()
, MoveEntriesL()
, MoveEntriesWithinService()
, MoveEntry()
, MoveEntryCompleted()
, MoveEntryL()
, MoveEntryWithinService()
, NewEntryL()
, OwningService()
, ReadStoreL()
, SetEntry()
, SetMtm()
, SetSort()
, Sort()
, ~CMsvServerEntry()
Inherited from CActive
:
Deque()
,
DoCancel()
,
EPriorityHigh
,
EPriorityIdle
,
EPriorityLow
,
EPriorityStandard
,
EPriorityUserInput
,
IsActive()
,
IsAdded()
,
Priority()
,
RunError()
,
RunL()
,
SetActive()
,
SetPriority()
,
TPriority
,
iStatus
Inherited from CBase
:
operator new()
~CMsvServerEntry();
Frees resources for the object. It:
releases the lock on the entry
releases the lock on the associated message store if has been opened with EditStoreL()
cancels any outstanding asynchronous MoveEntryL()
move operation
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()
.
|
|
|
TInt ChangeAttributes(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes);
Supported from 5.1
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:
PC synchronisation
Visibility flag
Read flag
In-preparation flag
Connected flag
New flag
|
|
TInt ChangeEntry(const TMsvEntry& aEntry);
Sets the context’s index entry to the specified values.
|
|
const TMsvEntry& Entry() const;
Gets the context’s index entry.
|
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.
|
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.
|
|
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.
|
|
TBool HasStore() const;
Supported from 5.1
Withdrawn in 6.0
Tests if the context has an associated message store.
In pre-Unicode versions a Message store flag was available and could be accessed through TMsvEntry::Store()
. This function replaces that functionality.
|
TBool HasStoreL() const;
Supported from 6.0
Tests if the context has an associated message store.
|
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.
|
|
TInt GetFilePath(TFileName& aFilePath) const;
Gets the context’s binary file directory.
If the directory specified in the context does not exist, it is created.
|
|
TBool HasDirectory() const;
Supported from 5.1
Withdrawn in 6.0
Tests if the context has an associated binary files directory.
In pre-Unicode versions a folder index flag was available, and could be accessed through TMsvEntry::Folder()
. This function replaces that functionality.
|
TBool HasDirectoryL() const;
Supported from 6.0
Tests if the context has an associated binary files directory.
|
void SetMtm(TUid aMtm);
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.
|
void SetSort(TMsvSelectionOrdering& aOrdering);
Sets the sort order that is used when listing children, for example with GetChildren()
.
|
const TMsvSelectionOrdering& Sort();
Gets the current sort order of children of the entry.
|
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.
|
|
TInt GetChildrenWithService(TMsvId aServiceId, CMsvEntrySelection& aSelection);
Supported from 6.0
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.
|
|
TInt GetChildrenWithMtm(TUid aMtm, CMsvEntrySelection& aSelection);
Supported from 6.0
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.
|
|
TInt GetChildrenWithType(TUid aType, CMsvEntrySelection& aSelection);
Supported from 6.0
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.
|
|
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.
|
|
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.
|
|
TInt DeleteEntry(TMsvId aId, CMsvEntrySelection& aDeletedEntries);
Withdrawn in 5.1
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.
aDeletedEntries
returns the IDs of all the entries deleted.
|
|
TInt DeleteEntries(CMsvEntrySelection& aSelection);
Supported from 5.1
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.
|
|
void CopyEntriesL(const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aObserverStatus);
Supported from 5.1
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.
|
|
void CopyEntryL(TMsvId aId, TMsvId aDestination, TRequestStatus& aObserverStatus);
Supported from 5.1
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.
|
|
void CancelMoveEntry();
Withdrawn in 5.1
Cancels an asynchronous move that has been begun with MoveEntryL()
. For Unicode releases see Cancel()
.
void MoveEntriesL(const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aObserverStatus);
Supported from 5.1
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.
|
|
TInt MoveEntriesWithinService(CMsvEntrySelection& aSelection, TMsvId aDestination);
Supported from 5.1
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.
|
|
void MoveEntryCompleted(TInt aError);
Withdrawn in 5.1
Informs the client of this by signalling an active object that the client has supplied for the purpose. Clients must call MoveEntryCompleted()
after this occurs. This ensures that all session observers are notified of the change.
In Unicode releases the Message Server performs this function itself.
|
TInt MoveEntry(TMsvId aId, TMsvId aDestination);
Withdrawn in 5.1
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 Unicode releases, see MoveEntryWithinService()
.
|
|
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()
.
|
|
TInt MoveEntryWithinService(TMsvId aId, TMsvId aDestination);
Supported from 5.1
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()
.
|
|
void Cancel();
Supported from 5.1
Cancels an asynchronous move or copy operation. This function is inherited from CActive
.
For pre-Unicode releases see CancelMoveEntry()
.
RFs& FileSession();
Supported from 5.1
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.
|