Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: MSVSTORE.H
Link against: msgs.lib
Link against: msgs_autoshutdown.lib

Class CMsvStore

class CMsvStore : public CBase;

Description

Provides an interface over the message store that is associated with a message entry. It is similar to the dictionary store in supporting the concept of streams referenced by UID.

This class is intended for use by MTM implementations. Message client applications access the store through the higher-level functions provided by Client-side and User Interface MTMs.

A CMsvStore object is created by a CMsvEntry object and passed to a client process. The client process then becomes responsible for deleting the CMsvStore object. The store can be opened in two modes, read or edit, and only one CMsvStore object can have edit access to a store.

CMsvStore provides functions for general manipulation of the store, and for accessing the standard body text stream. RMsvReadStream and RMsvWriteStream must be used to access other streams.

Derivation

Members

Defined in CMsvStore:
AttachmentManagerExtensionsL(), AttachmentManagerL(), Commit(), CommitL(), DeleteBodyTextL(), DeleteL(), HasBodyTextL(), IsNullL(), IsPresentL(), Remove(), RemoveL(), RestoreBodyTextL(), Revert(), RevertL(), SizeL(), StoreBodyTextL(), ~CMsvStore()

Inherited from CBase:
Delete(), Extension_(), operator new()

See also


Construction and destruction


~CMsvStore()

IMPORT_C ~CMsvStore();

Description

Destructor.

If the message store is currently locked, the destructor releases it before deleting the object.

[Top]


Member functions


StoreBodyTextL()

IMPORT_C void StoreBodyTextL(const CRichText &aRichTextBody);

Description

Stores the body text stream of the message store. Any existing data is overwritten. Write access is needed for this function. A commit must be done following this function for the new data to be retained.

Parameters

const CRichText &aRichTextBody

The body data to be externalised

Leave codes

KErrAccessDenied

Store is not open for writing

Other

Standard streaming leave codes


RestoreBodyTextL()

IMPORT_C void RestoreBodyTextL(CRichText &aRichTextBody);

Description

Reads the body text stream from the message store into the given rich text object.

Parameters

CRichText &aRichTextBody

On return, the message store's body text is inserted into this object. Any previously existing contents is lost.

Leave codes

KErrNotFound

There is no body text stream in the store

Other

Standard streaming leave codes


DeleteBodyTextL()

IMPORT_C void DeleteBodyTextL();

Description

Deletes the stream that contains the body text. Write access is needed for this function.

Leave codes

KErrAccessDenied

Store is not open for writing

Other

Standard streaming leave codes


HasBodyTextL()

IMPORT_C TBool HasBodyTextL() const;

Description

Checks if the store has a body text stream; IsPresentL(KMsvEntryRichTextBody) will always return EFalse when the store_8bit_flag in imcm.rss is enabled.

Return value

TBool

ETrue if the store has a body text stream, else EFalse


DeleteL()

IMPORT_C void DeleteL();

Description

Deletes the message store. After a delete, the behaviour of the object is undefined: it can only be deleted.

Write access is needed for this function.

Leave codes

KErrAccessDenied

The store is read only

Other

Standard file store error codes


SizeL()

IMPORT_C TInt SizeL();

Description

Gets the size of the message store.

Return value

TInt

Size of the message store in bytes


IsNullL()

IMPORT_C TBool IsNullL() const;

Description

Tests whether the message store contains any streams.

Return value

TBool

ETrue if the store has no streams, else EFalse


IsPresentL()

IMPORT_C TBool IsPresentL(TUid aUid) const;

Description

Tests whether the message store contains a stream identifier. Do not use to check if there is a body text part stored with the email; use CMsvStore::HasBodyTextL() instead.

Parameters

TUid aUid

Identifier of stream

Return value

TBool

ETrue if the store has a stream aUid, else EFalse


Remove()

IMPORT_C void Remove(TUid aUid);

Description

Deletes the identified stream from the store. The function returns, whether or not it completes successfully.

Write access is needed for this function.

Parameters

TUid aUid

The UID of the stream to delete


RemoveL()

IMPORT_C void RemoveL(TUid aUid);

Description

Deletes the identified stream from the store. It leaves if it cannot complete successfully.

Write access is needed for this function.

Parameters

TUid aUid

The UID of the stream to delete

Leave codes

KErrAccessDenied

The store is read only

Other

Standard streaming error codes


Revert()

IMPORT_C void Revert();

Description

Reverts the store to the previous commit level. This removes all changes that have been made to the store since the last commit.

The function cannot leave: it returns, whether or not it completes successfully.

Write access is needed for this function.


RevertL()

IMPORT_C void RevertL();

Description

Reverts the store to the previous commit level. This removes all changes that have been made to the store since the last commit.

The function leaves if it cannot complete successfully.

Write access is needed for this function.

Leave codes

KErrAccessDenied

The store is read only

Other

Standard streaming error codes


Commit()

IMPORT_C TInt Commit();

Description

Commits changes to the message store, returning any error code.

Committing changes makes these changes permanent, and means that the store cannot be rolled back to a state before the changes were begun.

You should use this function before deleting a CMsvStore, if you have made changes to it through RMsvWriteStream . Note that StoreBodyTextL() performs a commit itself, so an additional commit is not required after its use.

The functions is identical to the following one, except that it returns an error code if an error occurs.

Write access is needed.

Return value

TInt

Changes committed successfully Store open for read only Unable to commit changes


CommitL()

IMPORT_C void CommitL();

Description

Commits changes to the message store, leaving if an error occurs.

Committing changes makes these changes permanent, and means that the store cannot be rolled back to a state before the changes were begun.

You should use this function before deleting a CMsvStore, if you have made changes to it through RMsvWriteStream . Note that StoreBodyTextL() performs a commit itself, so an additional commit is not required after its use.

The functions is identical to the previous one, except that it leaves with the error code if an error occurs.

Write access is needed.

Leave codes

KErrAccessDenied

Store open for read only

Standard

streaming error codes Unable to commit changes


AttachmentManagerL()

IMPORT_C MMsvAttachmentManager &AttachmentManagerL();

Description

Returns an interface for the Attachment Manager.

This methods returns an interface that can be used to provided attachment management functionality for each message entry.

Return value

MMsvAttachmentManager &

A reference to the Attachment Manager interface

See also:


AttachmentManagerExtensionsL()

IMPORT_C MMsvAttachmentManagerSync &AttachmentManagerExtensionsL();

Description

Return value

MMsvAttachmentManagerSync &