CMmsAttachmentHandler Class Reference

class CMmsAttachmentHandler : public CBase

Attachment handling functions that can be called from both client and server side

mmsgenutil.lib
Since
3.2

Inherits from

Constructor & Destructor Documentation

CMmsAttachmentHandler()

CMmsAttachmentHandler ( ) [private]

C++ constructor.

~CMmsAttachmentHandler()

~CMmsAttachmentHandler ( ) [virtual]

Destructor.

Member Functions Documentation

AttachmentsSizeL(CMsvStore &)

IMPORT_C TInt AttachmentsSizeL ( CMsvStore & aStore ) [static]

Returns total size of all attachments including mime headers and binary attachment data. Linked attachments are included This function is needed to allocate the encoding buffer.

Parameters

CMsvStore & aStore Read store for the message entry

ConstructL()

void ConstructL ( ) [private]

Constructor.

CreateAttachmentL(CMsvStore &, RFile &, RFs &, TDriveUnit, TDesC8 &, CMsvMimeHeaders &, CMsvAttachment *, TMsvAttachmentId &)

IMPORT_C void CreateAttachmentL ( CMsvStore & aStore,
RFile & aFile,
RFs & aFs,
TDriveUnit aMessageDrive,
TDesC8 & aMimeType,
CMsvMimeHeaders & aMimeHeaders,
CMsvAttachment * aAttachmentInfo,
TMsvAttachmentId & aAttaId
) [static]

Create attachment entry and copy specified file to binary file storage.

Parameters

CMsvStore & aStore an open EditStore. Caller must commit store (several attachments can be added before committing store)
RFile & aFile opened file handle, source of the attachment. File must be in public location to be accessible. Caller must close the file afterwards.
RFs & aFs File session handle. Needed to check disk space
TDriveUnit aMessageDrive the drive the message store is on. (needed for disk space check)
TDesC8 & aMimeType mime type of the attachmet.
CMsvMimeHeaders & aMimeHeaders mime headers for the attachment. If content type is not defined, function adds the mime type and subtype from aMimeType Suggested filename in mimeHeaders is used as attachment name
CMsvAttachment * aAttachmentInfo must be initialized to a CMsvAttachment::EMsvFile on return contains data about the attachment. Ownership of attachmentinfo is transferred to attachment manager, it must not be deleted by caller. Attachment manager will be destroyed when store is deleted. After that aAttachmentInfo will no longer be available.
TMsvAttachmentId & aAttaId attachment id of the newly created attachment

CreateTextAttachmentL(CMsvStore &, TMsvAttachmentId &, const TDesC &, const TDesC &, RFs &, TDriveUnit, TBool)

IMPORT_C void CreateTextAttachmentL ( CMsvStore & aStore,
TMsvAttachmentId & aAttachmentId,
const TDesC & aText,
const TDesC & aFile,
RFs & aFs,
TDriveUnit aMessageDrive,
TBool aConvertParagraphSeparator = ETrue
) [static]

Create text/plain attachment. Creates a text attachment from descriptor. Has option to convert all unicode paragraph separator marks to line feeds. Converts text from unicode (ucs-2) to utf-8 before storing it.

Parameters

CMsvStore & aStore an open EditStore. Caller must commit store (several attachments can be added before committing store)
TMsvAttachmentId & aAttachmentId returned ID of the new attachment entry
const TDesC & aText UNICODE text to be added as a text/plain attachment.
const TDesC & aFile suggested filename for the attachment
RFs & aFs File session handle. Needed to check disk space
TDriveUnit aMessageDrive the drive the message store is on. (needed for disk space check)
TBool aConvertParagraphSeparator = ETrue flag to tell if the function will search for all 0x2029 characters (Unicode paragraph separator) and replace them with 0x000a (line feed). aConvertParagraphSeparator == ETrue: convert aConvertParagraphSeparator == EFalse: do not convert

CreateUTF8TextAttachmentFromFileL(CMsvStore &, TMsvAttachmentId &, RFile &, RFs &, TDriveUnit)

IMPORT_C void CreateUTF8TextAttachmentFromFileL ( CMsvStore & aStore,
TMsvAttachmentId & aAttachmentId,
RFile & aFile,
RFs & aFs,
TDriveUnit aMessageDrive
) [static]

Create text/plain attachment. Creates a text attachment from descriptor. Has option to convert all unicode paragraph separator marks to line feeds. Converts text from unicode (ucs-2) to utf-8 before storing it.

Parameters

CMsvStore & aStore an open EditStore. Caller must commit store (several attachments can be added before committing store)
TMsvAttachmentId & aAttachmentId returned ID of the new attachment entry
RFile & aFile open file read handle to unicode plain text file
RFs & aFs File session handle. Needed to check disk space
TDriveUnit aMessageDrive the drive the message store is on. (needed for disk space check)

IsValidFilename(RFs &, const TPtrC &)

IMPORT_C TBool IsValidFilename ( RFs & aFs,
const TPtrC & aFileName
) [static]

Check if aFileName would be a valid filename. Cannot use path because absolute path is not known. Only filename is checked

Parameters

RFs & aFs open file system handle.
const TPtrC & aFileName suggestion of a filename.

NewL()

IMPORT_C CMmsAttachmentHandler * NewL ( ) [static]

Two-phased constructor.

RemoveAttachmentL(TMsvAttachmentId, CMsvStore &)

void RemoveAttachmentL ( TMsvAttachmentId aAttaId,
CMsvStore & aStore
) [private, static]

Remove an attachment by attaId. Symbian synchronous attachment manager can only remove by index.

Parameters

TMsvAttachmentId aAttaId id of the attachment to be removed
CMsvStore & aStore reference to open edit store