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

  • CMmsAttachmentHandler

Constructor & Destructor Documentation

CMmsAttachmentHandler()

CMmsAttachmentHandler()[private]

C++ constructor.

~CMmsAttachmentHandler()

~CMmsAttachmentHandler()[virtual]

Destructor.

Member Functions Documentation

AttachmentsSizeL(CMsvStore &)

IMPORT_C TIntAttachmentsSizeL(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 & aStoreRead store for the message entry

ConstructL()

voidConstructL()[private]

Constructor.

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

IMPORT_C voidCreateAttachmentL(CMsvStore &aStore,
RFile &aFile,
RFs &aFs,
TDriveUnitaMessageDrive,
TDesC8 &aMimeType,
CMsvMimeHeaders &aMimeHeaders,
CMsvAttachment *aAttachmentInfo,
TMsvAttachmentId &aAttaId
)[static]

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

Parameters

CMsvStore & aStorean open EditStore. Caller must commit store (several attachments can be added before committing store)
RFile & aFileopened file handle, source of the attachment. File must be in public location to be accessible. Caller must close the file afterwards.
RFs & aFsFile session handle. Needed to check disk space
TDriveUnit aMessageDrivethe drive the message store is on. (needed for disk space check)
TDesC8 & aMimeTypemime type of the attachmet.
CMsvMimeHeaders & aMimeHeadersmime 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 * aAttachmentInfomust 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 & aAttaIdattachment id of the newly created attachment

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

IMPORT_C voidCreateTextAttachmentL(CMsvStore &aStore,
TMsvAttachmentId &aAttachmentId,
const TDesC &aText,
const TDesC &aFile,
RFs &aFs,
TDriveUnitaMessageDrive,
TBoolaConvertParagraphSeparator = 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 & aStorean open EditStore. Caller must commit store (several attachments can be added before committing store)
TMsvAttachmentId & aAttachmentIdreturned ID of the new attachment entry
const TDesC & aTextUNICODE text to be added as a text/plain attachment.
const TDesC & aFilesuggested filename for the attachment
RFs & aFsFile session handle. Needed to check disk space
TDriveUnit aMessageDrivethe drive the message store is on. (needed for disk space check)
TBool aConvertParagraphSeparator = ETrueflag 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 voidCreateUTF8TextAttachmentFromFileL(CMsvStore &aStore,
TMsvAttachmentId &aAttachmentId,
RFile &aFile,
RFs &aFs,
TDriveUnitaMessageDrive
)[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 & aStorean open EditStore. Caller must commit store (several attachments can be added before committing store)
TMsvAttachmentId & aAttachmentIdreturned ID of the new attachment entry
RFile & aFileopen file read handle to unicode plain text file
RFs & aFsFile session handle. Needed to check disk space
TDriveUnit aMessageDrivethe drive the message store is on. (needed for disk space check)

IsValidFilename(RFs &, const TPtrC &)

IMPORT_C TBoolIsValidFilename(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 & aFsopen file system handle.
const TPtrC & aFileNamesuggestion of a filename.

NewL()

IMPORT_C CMmsAttachmentHandler *NewL()[static]

Two-phased constructor.

RemoveAttachmentL(TMsvAttachmentId, CMsvStore &)

voidRemoveAttachmentL(TMsvAttachmentIdaAttaId,
CMsvStore &aStore
)[private, static]

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

Parameters

TMsvAttachmentId aAttaIdid of the attachment to be removed
CMsvStore & aStorereference to open edit store