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 .
Private Member Enumerations | |
---|---|
enum | TEntryState { 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 |
CMsvEntry | ( | CMsvSession & | aMsvSession, |
const TMsvSelectionOrdering & | aOrdering | ||
) | [private] |
CMsvSession & aMsvSession | |
const TMsvSelectionOrdering & aOrdering |
IMPORT_C void | AddObserverL | ( | 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 .
MMsvEntryObserver & aObserver | The observer to be registered for events |
TBool | AreChildren | ( | const CMsvEntrySelection & | aSelection | ) | const [private] |
const CMsvEntrySelection & aSelection |
IMPORT_C void | ChangeAttributesL | ( | const CMsvEntrySelection & | aSelection, |
TUint | aSetAttributes, | |||
TUint | aClearAttributes | |||
) |
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.
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 |
IMPORT_C void | ChangeL | ( | 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.
const TMsvEntry & aEntry | The new index entry values for the context |
IMPORT_C void | ChangeL | ( | const TMsvEntry & | aEntry, |
TSecureId | aOwnerId | |||
) |
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.
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.
const TMsvEntry & aEntry | The new index entry values for the context |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C CMsvOperation * | ChangeL | ( | const TMsvEntry & | aEntry, |
TSecureId | aOwnerId, | |||
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.
const TMsvEntry & aEntry | The new index entry values for the context |
TSecureId aOwnerId | The ID of process that owns the changed entry. |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
void | CheckDeletedGrandchildrenL | ( | TMsvId | aId | ) | [private] |
TMsvId aId |
void | CheckIfContextMovedL | ( | const CMsvEntrySelection & | aSelection | ) | [private] |
const CMsvEntrySelection & aSelection |
void | CheckNewGrandchildrenL | ( | TMsvId | aId | ) | [private] |
TMsvId aId |
IMPORT_C const TMsvEntry & | ChildDataL | ( | TMsvId | aId | ) | const |
Gets the index entry of context's child with the specified ID.
TMsvId aId | ID of the child |
IMPORT_C CMsvEntry * | ChildEntryL | ( | TMsvId | aId | ) | const |
TMsvId aId | ID of a child entry |
void | ChildrenChangedL | ( | const CMsvEntrySelection & | aSelection | ) | [private] |
const CMsvEntrySelection & aSelection |
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 .
IMPORT_C CMsvEntrySelection * | ChildrenWithMtmL | ( | TUid | aMtm | ) | 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 .
TUid aMtm | MTM type by which to filter |
IMPORT_C CMsvEntrySelection * | ChildrenWithServiceL | ( | TMsvId | aServiceId | ) | 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.
TMsvId aServiceId | Service by which to filter |
IMPORT_C CMsvEntrySelection * | ChildrenWithTypeL | ( | TUid | aType | ) | 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 .
TUid aType | Entry type by which to filter. |
void | ContextChangedL | ( | MMsvEntryObserver::TMsvEntryEvent | aEvent | ) | [private] |
MMsvEntryObserver::TMsvEntryEvent aEvent |
IMPORT_C CMsvOperation * | CopyL | ( | const CMsvEntrySelection & | aSelection, |
TMsvId | aTargetId, | |||
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.
const CMsvEntrySelection & aSelection | List of IDs of the entries to be copied |
TMsvId aTargetId | The ID of the entry to own the copies |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C CMsvOperation * | CopyL | ( | TMsvId | aMsvId, |
TMsvId | aTargetId, | |||
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.
TMsvId aMsvId | The ID of the entry to be copied |
TMsvId aTargetId | The ID of the entry to own the copy |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C void | CopyL | ( | const CMsvEntrySelection & | aSelection, |
TMsvId | aTargetId, | |||
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.
const CMsvEntrySelection & aSelection | List of IDs of the entries to be copied |
TMsvId aTargetId | The ID of the entry to own the copies |
TMsvLocalOperationProgress & aProgress | On return, records the outcome of the copy |
IMPORT_C void | CopyL | ( | TMsvId | aMsvId, |
TMsvId | aTargetId | |||
) |
Creates, synchronously, a copy of a child of the context as a new entry owned by the specified target ID.
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.
const TMsvEntry & aEntry | Index entry value for the new entry |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C CMsvOperation * | CreateL | ( | const TMsvEntry & | aEntry, |
TSecureId | aOwnerId, | |||
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.
const TMsvEntry & aEntry | Index entry value for the new entry |
TSecureId aOwnerId | The ID of process that owns the created entry. |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C void | CreateL | ( | 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.
TMsvEntry & aEntry | Index entry value for the new entry |
IMPORT_C void | CreateL | ( | TMsvEntry & | aEntry, |
TSecureId | aOwnerId | |||
) |
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.
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.
const CMsvEntrySelection & aSelection | List of ID of the entries to be deleted |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C CMsvOperation * | DeleteL | ( | TMsvId | aMsvId, |
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.
TMsvId aMsvId | ID of entry to be deleted |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C void | DeleteL | ( | TMsvId | aId | ) |
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.
TMsvId aId | ID of entry to be deleted |
IMPORT_C void | DeleteL | ( | 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.
const CMsvEntrySelection & aSelection | List of ID of the entries to be deleted |
TMsvLocalOperationProgress & aProgress | Progress information for the delete operation |
void | DeletedChildrenL | ( | const CMsvEntrySelection & | aSelection | ) | [private] |
const CMsvEntrySelection & aSelection |
CMsvOperation * | DoDeleteL | ( | const CMsvEntrySelection & | aSelection, |
TRequestStatus & | aStatus | |||
) | [private] |
const CMsvEntrySelection & aSelection | |
TRequestStatus & aStatus |
CMsvClientEntry * | DoGetEntryLC | ( | TMsvId | aId, |
TMsvId & | aOwningService | |||
) | [private] |
CMsvEntrySelection * | DoGetNewChildrenL | ( | const CMsvEntrySelection & | aSelection | ) | [private] |
const CMsvEntrySelection & aSelection |
CMsvEntrySelection * | DoMakeSelectionL | ( | TMsvId | aId | ) | [private] |
TMsvId aId |
void | DoSortTypeL | ( | CMsvClientEntry * | aContext | ) | [private] |
CMsvClientEntry * aContext |
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.
CMsvEntryArray * | GetNewSortedListL | ( | const TMsvSelectionOrdering & | aOrdering, |
const CArrayFix < TUid > & | aMtmList | |||
) | [private] |
const TMsvSelectionOrdering & aOrdering | |
const CArrayFix < TUid > & aMtmList |
void | HandleSessionEventL | ( | TMsvSessionEvent | aEvent, |
TAny * | aArg1, | |||
TAny * | aArg2, | |||
TAny * | aArg3 | |||
) |
void | HandleStoreEvent | ( | TMsvStoreEvent | aEvent, |
TMsvId | aId | |||
) |
TMsvStoreEvent aEvent | |
TMsvId aId |
IMPORT_C TBool | HasStoreL | ( | ) | const |
Checks if the context has an associated message store.
void | Log | ( | TRefByValue < const TDesC > | aFmt, |
... | ||||
) | [private] |
TRefByValue < const TDesC > aFmt | |
... |
IMPORT_C CMsvOperation * | MoveL | ( | const CMsvEntrySelection & | aSelection, |
TMsvId | aTargetId, | |||
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.
const CMsvEntrySelection & aSelection | List of IDs of the entries to be moved |
TMsvId aTargetId | The ID of the entry to own the moved entires |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C CMsvOperation * | MoveL | ( | TMsvId | aMsvId, |
TMsvId | aTargetId, | |||
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.
TMsvId aMsvId | The ID of the entry to be moved |
TMsvId aTargetId | The ID of the entry to own the moved entries |
TRequestStatus & aStatus | The request status to be completed when the operation has finished |
IMPORT_C void | MoveL | ( | TMsvId | aMsvId, |
TMsvId | aTargetId | |||
) |
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.
IMPORT_C void | MoveL | ( | const CMsvEntrySelection & | aSelection, |
TMsvId | aTargetId, | |||
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.
const CMsvEntrySelection & aSelection | List of IDs of the entries to be moved |
TMsvId aTargetId | The ID of the entry to own the moved entires |
TMsvLocalOperationProgress & aProgress | On return, records the outcome of the move |
void | NewChildrenL | ( | const CMsvEntrySelection & | aSelection | ) | [private] |
const CMsvEntrySelection & aSelection |
IMPORT_C CMsvEntry * | NewL | ( | CMsvSession & | aMsvSession, |
TMsvId | aMsvId, | |||
const TMsvSelectionOrdering & | aOrdering | |||
) | [static] |
CMsvSession & aMsvSession | The client s Message Server session |
TMsvId aMsvId | ID of the entry to access |
const TMsvSelectionOrdering & aOrdering |
void | NotifyAllObserversL | ( | MMsvEntryObserver::TMsvEntryEvent | aEvent, |
TAny * | aArg1, | |||
TAny * | aArg2, | |||
TAny * | aArg3 | |||
) | [private] |
MMsvEntryObserver::TMsvEntryEvent aEvent | |
TAny * aArg1 | |
TAny * aArg2 | |
TAny * aArg3 |
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:
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.
IMPORT_C void | RemoveObserver | ( | MMsvEntryObserver & | aObserver | ) |
Unregisters an observer previously registered with AddObserverL() .
MMsvEntryObserver & aObserver | A reference to an observer to be unregistered for events |
void | ReplaceChildL | ( | TInt | pos, |
const TMsvEntry & | aEntry | |||
) | [private] |
CMsvSession & | Session | ( | ) | [inline] |
Gets the Message Server session used by this object. This is the same session passed by the client in NewL() .
IMPORT_C void | SetEntryL | ( | TMsvId | aId | ) |
Sets the context to the specified entry.
If the function leaves, the context is unchanged.
TMsvId aId | ID of the message entry which is to become the new context |
IMPORT_C void | SetEntryNoCheckL | ( | TMsvId | aId | ) |
Sets the context to the specified entry.
If the function leaves, the context is unchanged.
TMsvId aId | ID of the message entry which is to become the new context |
IMPORT_C void | SetMtmListL | ( | 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.
IMPORT_C void | SetSortTypeL | ( | 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.
const TMsvSelectionOrdering & aOrdering | Sort order to use |
const TMsvSelectionOrdering & | SortType | ( | ) | const [inline] |
Gets the current sort order of children of the entry. The sort order is initially set through NewL() .
IMPORT_C const TMsvEntry & | operator[] | ( | TInt | aIndex | ) | 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.
TInt aIndex | Array index |
EValid | |
EInvalidChangingContext | |
EInvalidDeletedContext | |
EInvalidOldContext | |
EInvalidMissingChildren |
CArrayPtrFlat < MMsvEntryObserver > * | iObservers | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.