CMmsAttachmentHandler Class Reference
class CMmsAttachmentHandler : public CBase |
Attachment handling functions that can be called from both client and server side
Public Member Functions |
---|
| ~CMmsAttachmentHandler() |
IMPORT_C TInt | AttachmentsSizeL(CMsvStore &) |
IMPORT_C void | CreateAttachmentL(CMsvStore &, RFile &, RFs &, TDriveUnit, TDesC8 &, CMsvMimeHeaders &, CMsvAttachment *, TMsvAttachmentId &) |
IMPORT_C void | CreateTextAttachmentL(CMsvStore &, TMsvAttachmentId &, const TDesC &, const TDesC &, RFs &, TDriveUnit, TBool) |
IMPORT_C void | CreateUTF8TextAttachmentFromFileL(CMsvStore &, TMsvAttachmentId &, RFile &, RFs &, TDriveUnit) |
IMPORT_C TBool | IsValidFilename(RFs &, const TPtrC &) |
IMPORT_C CMmsAttachmentHandler * | NewL() |
Constructor & Destructor Documentation
CMmsAttachmentHandler()
CMmsAttachmentHandler | ( | ) | [private] |
~CMmsAttachmentHandler()
~CMmsAttachmentHandler | ( | ) | [virtual] |
Member Functions Documentation
AttachmentsSizeL(CMsvStore &)
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] |
CreateAttachmentL(CMsvStore &, RFile &, RFs &, TDriveUnit, TDesC8 &, CMsvMimeHeaders &, CMsvAttachment *, TMsvAttachmentId &)
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)
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)
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. |
RemoveAttachmentL(TMsvAttachmentId, CMsvStore &)
Remove an attachment by attaId. Symbian synchronous attachment manager can only remove by index.
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.