#include <mw/msvstore.h>
Link against: msgs_autoshutdown.lib
class CMsvStore : public CBase, public CBase |
Public Member Functions | |
---|---|
~CMsvStore() | |
IMPORT_C MMsvAttachmentManagerSync & | AttachmentManagerExtensionsL() |
IMPORT_C MMsvAttachmentManager & | AttachmentManagerL() |
IMPORT_C TInt | Commit() |
IMPORT_C void | CommitL() |
IMPORT_C void | CreateShareProtectedAttachmentL(const TDesC &, RFile &, CMsvAttachment *) |
IMPORT_C void | DeleteBodyTextL() |
IMPORT_C void | DeleteL() |
IMPORT_C TBool | HasBodyTextL() |
IMPORT_C CMsvPlainBodyText * | InitialisePlainBodyTextForReadL(TInt) |
IMPORT_C CMsvPlainBodyText * | InitialisePlainBodyTextForWriteL(TBool, TUint, TUint) |
IMPORT_C TBool | IsNullL() |
IMPORT_C TBool | IsPresentL(TUid) |
IMPORT_C void | Remove(TUid) |
IMPORT_C void | RemoveL(TUid) |
void | Restore8BitBodyTextL(RFileReadStream &) |
IMPORT_C void | RestoreBodyTextL(CRichText &) |
IMPORT_C void | RestoreBodyTextL(CRichText &, TUint) |
IMPORT_C void | Revert() |
IMPORT_C void | RevertL() |
IMPORT_C TInt | SizeL() |
IMPORT_C void | StoreBodyTextL(const CRichText &) |
Protected Member Functions | |
---|---|
CMsvStore(MMsvStoreObserver &, RFs &, TMsvId, MMsvStoreManager &) | |
IMPORT_C CMsvStore * | OpenForReadL(MMsvStoreObserver &, RFs &, MMsvStoreManager &, TMsvId) |
IMPORT_C CMsvStore * | OpenForWriteL(MMsvStoreObserver &, RFs &, MMsvStoreManager &, TMsvId) |
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.
IMPORT_C | CMsvStore | ( | MMsvStoreObserver & | aObserver, |
RFs & | aFs, | |||
TMsvId | aId, | |||
MMsvStoreManager & | aStoreManager | |||
) | [protected] |
IMPORT_C | ~CMsvStore | ( | ) |
Destructor.
If the message store is currently locked, the destructor releases it before deleting the object.
IMPORT_C MMsvAttachmentManagerSync & | AttachmentManagerExtensionsL | ( | ) |
IMPORT_C MMsvAttachmentManager & | AttachmentManagerL | ( | ) |
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.
See also: MMsvAttachmentManager
IMPORT_C TInt | Commit | ( | ) |
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.
IMPORT_C void | CommitL | ( | ) |
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 |
IMPORT_C void | CreateShareProtectedAttachmentL | ( | const TDesC & | aFileName, |
RFile & | aAttachmentFile, | |||
CMsvAttachment * | aAttachmentInfo | |||
) |
IMPORT_C void | DeleteBodyTextL | ( | ) |
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 |
IMPORT_C void | DeleteL | ( | ) |
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 |
IMPORT_C TBool | HasBodyTextL | ( | ) | const |
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.
IMPORT_C CMsvPlainBodyText * | InitialisePlainBodyTextForReadL | ( | TInt | aChunkLength | ) |
Parameters | |
---|---|
aChunkLength | The length of the chunk that will be processed while reading. |
Leave Codes | |
---|---|
KErrAccessDenied | If Store is opened in Write mode. |
IMPORT_C CMsvPlainBodyText * | InitialisePlainBodyTextForWriteL | ( | TBool | aIs8Bit, |
TUint | aCharsetId, | |||
TUint | aDefaultCharsetId | |||
) |
Parameters | |
---|---|
aIs8Bit | TBool indicating whether to store bdy text as 8/16 bit. |
aCharsetId | The charset of the body part. |
aDefaultCharsetId | The default charset of the system. |
Leave Codes | |
---|---|
KErrAccessDenied | If Store is opened in Read mode. |
IMPORT_C TBool | IsNullL | ( | ) | const |
Tests whether the message store contains any streams.
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 | |
---|---|
aUid | Identifier of stream |
IMPORT_C CMsvStore * | OpenForReadL | ( | MMsvStoreObserver & | aObserver, |
RFs & | aFs, | |||
MMsvStoreManager & | aStoreManager, | |||
TMsvId | aId | |||
) | [protected, static] |
IMPORT_C CMsvStore * | OpenForWriteL | ( | MMsvStoreObserver & | aObserver, |
RFs & | aFs, | |||
MMsvStoreManager & | aStoreManager, | |||
TMsvId | aId | |||
) | [protected, static] |
IMPORT_C void | Remove | ( | TUid | aUid | ) |
Deletes the identified stream from the store. The function returns, whether or not it completes successfully.
Write access is needed for this function.
Parameters | |
---|---|
aUid | The UID of the stream to delete |
IMPORT_C void | RemoveL | ( | TUid | aUid | ) |
Deletes the identified stream from the store. It leaves if it cannot complete successfully.
Write access is needed for this function.
Parameters | |
---|---|
aUid | The UID of the stream to delete |
Leave Codes | |
---|---|
KErrAccessDenied | The store is read only |
Other | Standard streaming error codes |
void | Restore8BitBodyTextL | ( | RFileReadStream & | aInputStream | ) |
Restores 8 bit body text from the Message Store
Parameters | |
---|---|
aInputStream | on completion the RFileReadStream contains the message body text stream. |
IMPORT_C void | RestoreBodyTextL | ( | CRichText & | aRichTextBody | ) |
Parameters | |
---|---|
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 |
IMPORT_C void | RestoreBodyTextL | ( | CRichText & | aRichTextBody, |
TUint | aCharsetOverride | |||
) |
Parameters | |
---|---|
aRichTextBody | On return, the message store's body text is inserted into this object. Any previously existing contents is lost. |
aCharsetOverride | The charset with which to override the existing charset when data is stored a 8 bit format. |
Leave Codes | |
---|---|
KErrNotFound | There is no body text stream in the store |
Other | Standard streaming leave codes |
IMPORT_C void | Revert | ( | ) |
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.
IMPORT_C void | RevertL | ( | ) |
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 |
IMPORT_C TInt | SizeL | ( | ) |
Gets the size of the message store.
IMPORT_C void | StoreBodyTextL | ( | const CRichText & | aRichTextBody | ) |
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 | |
---|---|
aRichTextBody | The body data to be externalised |
Leave Codes | |
---|---|
KErrAccessDenied | Store is not open for writing |
Other | Standard streaming leave codes |