CFSMailMessagePart Class Reference

class CFSMailMessagePart : public CFSMailMessageBase

email parts handling class

FSFWCommonLib
Since
S60 v3.1

Inherits from

Public Member Functions
~CFSMailMessagePart ()
IMPORT_C CFSMailMessagePart * AddNewAttachmentL (const TDesC &, const TFSMailMsgId , const TDesC &)
IMPORT_C void AppendAttachmentsL ( RPointerArray < CFSMailMessagePart > &)
IMPORT_C TDesC & AttachmentNameL ()
IMPORT_C CFSMailMessagePart * ChildPartL (const TFSMailMsgId )
IMPORT_C void ChildPartsL ( RPointerArray < CFSMailMessagePart > &)
IMPORT_C const TDesC & ContentDescription ()
IMPORT_C const TDesC & ContentDisposition ()
IMPORT_C CDesCArray & ContentDispositionParameters ()
IMPORT_C const TDesC & ContentID ()
IMPORT_C TUint ContentSize ()
IMPORT_C TBool ContentTypeMatches (const TDesC &)
IMPORT_C CDesCArray & ContentTypeParameters ()
IMPORT_C void CopyContentFileL (const TDesC &)
IMPORT_C CFSMailMessagePart * CopyMessageAsChildPartL ( TFSMailMsgId , CFSMailMessage *)
IMPORT_C TFSPartFetchState FetchLoadState ()
IMPORT_C TInt FetchMessagePartL (const TFSMailMsgId , MFSMailRequestObserver &, const TUint )
IMPORT_C TInt FetchMessagesPartsL (const RArray < TFSMailMsgId > &, MFSMailRequestObserver &, const TUint )
IMPORT_C TUint FetchedContentSize ()
IMPORT_C CFSMailMessagePart * FindBodyPartL (const TDesC &)
IMPORT_C const TDesC & GetContentClass ()
IMPORT_C RFile GetContentFileL ()
IMPORT_C void GetContentToBufferL ( TDes16 &, TUint )
IMPORT_C const TDesC & GetContentType ()
IMPORT_C MMRInfoObject & GetMRInfo ()
IMPORT_C TFSMailMsgId GetPartId ()
IMPORT_C TBool IsMRInfoSet ()
IMPORT_C TBool IsMessageL ()
IMPORT_C CFSMailMessagePart * NewChildPartL (const TFSMailMsgId , const TDesC &)
IMPORT_C CFSMailMessagePart * NewL ( TFSMailMsgId , TFSMailMsgId )
IMPORT_C CFSMailMessagePart * NewLC ( TFSMailMsgId , TFSMailMsgId )
IMPORT_C TUint ReadOnlyPartSize ()
IMPORT_C void RemoveChildPartL ( TFSMailMsgId )
IMPORT_C void RemoveContentL ()
IMPORT_C void RemoveDownLoadedAttachmentsL ()
IMPORT_C void SaveL ()
IMPORT_C void SetAttachmentNameL (const TDesC &)
IMPORT_C void SetContent ( TDes16 &)
IMPORT_C void SetContentClass (const TDesC &)
IMPORT_C void SetContentDescription (const TDesC &)
IMPORT_C void SetContentDisposition (const TDesC &)
IMPORT_C void SetContentFromFileL (const TDesC &)
IMPORT_C void SetContentIDL (const TDesC &)
IMPORT_C void SetContentSize (const TUint )
IMPORT_C void SetContentType (const TDesC &)
IMPORT_C void SetFetchedContentSize ( TUint )
IMPORT_C void SetMRInfo ( MMRInfoObject *)
IMPORT_C void SetMessagePartsStatus ( TFSPartFetchState )
IMPORT_C void SetReadOnlyPartSize (const TUint )
Protected Member Functions
CFSMailMessagePart ()
void ClearPartsArray ( TBool )
void DoAttachmentListL ( RPointerArray < CFSMailMessagePart > &)
TFSMailMsgId FindBodyPartIdL (const TDesC &)
void ListMessagePartsL ( RPointerArray < CFSMailMessagePart > &)
Private Member Functions
void ConstructL ( TFSMailMsgId , TFSMailMsgId )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CFSMailMessageBase::AppendBCCRecipient(CFSMailAddress *)
CFSMailMessageBase::AppendCCRecipient(CFSMailAddress *)
CFSMailMessageBase::AppendToRecipient(CFSMailAddress *)
CFSMailMessageBase::CFSMailMessageBase()
CFSMailMessageBase::ClearBccRecipients()
CFSMailMessageBase::ClearCcRecipients()
CFSMailMessageBase::ClearToRecipients()
CFSMailMessageBase::ExtensionL(const TUid &)
CFSMailMessageBase::GetBCCRecipients()
CFSMailMessageBase::GetCCRecipients()
CFSMailMessageBase::GetDate()const
CFSMailMessageBase::GetFlags()const
CFSMailMessageBase::GetFolderId()const
CFSMailMessageBase::GetMailBoxId()const
CFSMailMessageBase::GetMessageId()const
CFSMailMessageBase::GetReplyToAddress()
CFSMailMessageBase::GetSender()const
CFSMailMessageBase::GetSubject()const
CFSMailMessageBase::GetToRecipients()
CFSMailMessageBase::IsFlagSet(const TInt)const
CFSMailMessageBase::IsRelatedTo()const
CFSMailMessageBase::NewL(const TFSMailMsgId)
CFSMailMessageBase::NewLC(const TFSMailMsgId)
CFSMailMessageBase::ReleaseExtension(CEmailExtension *)
CFSMailMessageBase::RequestHandler()
CFSMailMessageBase::ResetFlag(const TInt)
CFSMailMessageBase::SetDate(const TTime)
CFSMailMessageBase::SetFlag(const TInt)
CFSMailMessageBase::SetFolderId(const TFSMailMsgId)
CFSMailMessageBase::SetMailBoxId(const TFSMailMsgId)
CFSMailMessageBase::SetRelatedTo(const TFSMailMsgId)
CFSMailMessageBase::SetReplyToAddress(CFSMailAddress *)
CFSMailMessageBase::SetSender(CFSMailAddress *)
CFSMailMessageBase::SetSubject(const TDesC &)
CFSMailMessageBase::~CFSMailMessageBase()
Protected Attributes
HBufC * iContentType
RPointerArray < CFSMailMessagePart > iMessageParts
TFSPartFetchState iMessagePartsStatus
TBool iReadMessageParts
Private Attributes
HBufC * iAttachmentName
HBufC * iContentClass
HBufC * iContentDescription
HBufC * iContentDisposition
CDesCArray * iContentDispositionParams
HBufC * iContentID
TUint iContentSize
CDesCArray * iContentTypeParams
TInt iFetchedContentSize
RFile iFile
TBool iIsFetched
MMRInfoObject * iMeetingRequest
TFSMailMsgId iMessagePartId
TUint iReadOnlyPartSize
Inherited Attributes
CExtendableEmail::iExtensions
CFSMailMessageBase::iMessageId
CFSMailMessageBase::iRequestHandler

Constructor & Destructor Documentation

CFSMailMessagePart()

CFSMailMessagePart ( ) [protected]

constructor

~CFSMailMessagePart()

IMPORT_C ~CFSMailMessagePart ( ) [virtual]

destructor

Member Functions Documentation

AddNewAttachmentL(const TDesC &, const TFSMailMsgId, const TDesC &)

IMPORT_C CFSMailMessagePart * AddNewAttachmentL ( const TDesC & aFilePath,
const TFSMailMsgId aInsertBefore,
const TDesC & aContentType
)

Adds new attachment to this email (part).

Parameters

const TDesC & aFilePath full path of new attachment.
const TFSMailMsgId aInsertBefore defines position of new attachment, if NullId then new attachment is created as last part.
const TDesC & aContentType attachment content type

AppendAttachmentsL(RPointerArray< CFSMailMessagePart > &)

IMPORT_C void AppendAttachmentsL ( RPointerArray < CFSMailMessagePart > & aParts )

creates a list containing all email / email part subparts

Parameters

RPointerArray < CFSMailMessagePart > & aParts email part list given/owned by user

AttachmentNameL()

IMPORT_C TDesC & AttachmentNameL ( )

returns email part attachment name

ChildPartL(const TFSMailMsgId)

IMPORT_C CFSMailMessagePart * ChildPartL ( const TFSMailMsgId aPartId )

Returns child part of this part identified by part id.

Parameters

const TFSMailMsgId aPartId defines parent part id

ChildPartsL(RPointerArray< CFSMailMessagePart > &)

IMPORT_C void ChildPartsL ( RPointerArray < CFSMailMessagePart > & aParts )

lists all direct child parts of this email part

Parameters

RPointerArray < CFSMailMessagePart > & aParts table containing list of child parts owned by user

ClearPartsArray(TBool)

void ClearPartsArray ( TBool aClearAll ) [protected]

clears internal part array

Parameters

TBool aClearAll

ConstructL(TFSMailMsgId, TFSMailMsgId)

void ConstructL ( TFSMailMsgId aMessageId,
TFSMailMsgId aMessagePartId
) [private]

Two-phased constructor

Parameters

TFSMailMsgId aMessageId
TFSMailMsgId aMessagePartId

ContentDescription()

IMPORT_C const TDesC & ContentDescription ( )

Returns email Content-Description value, includes also parameters, if any.

ContentDisposition()

IMPORT_C const TDesC & ContentDisposition ( )

Returns email Content-Disposition value, includes also parameters, if any.

ContentDispositionParameters()

IMPORT_C CDesCArray & ContentDispositionParameters ( )

Returns email Content-Disposition Parameters and their associated values. Updating/setting values should be done by first getting the array and then modifying it's contents.

ContentID()

IMPORT_C const TDesC & ContentID ( )

email Content-Id accessor.

ContentSize()

IMPORT_C TUint ContentSize ( ) const

returns email part full content size (in bytes)

ContentTypeMatches(const TDesC &)

IMPORT_C TBool ContentTypeMatches ( const TDesC & aContentType )

Checks that content type matches given.

Parameters

const TDesC & aContentType body part content type to be checked

ContentTypeParameters()

IMPORT_C CDesCArray & ContentTypeParameters ( )

Returns content-type parameters and their associated values. Updating/setting values should be done by first getting the array and then modifying it's contents.

CopyContentFileL(const TDesC &)

IMPORT_C void CopyContentFileL ( const TDesC & aContentLocation )

copies contents of this message part to given file

Parameters

const TDesC & aContentLocation defines file location as a) directory, when plugin finds out corresponding file name related to this part id, in this case last character should be '/' b) directory & filename, when both directory and file name are given by user

CopyMessageAsChildPartL(TFSMailMsgId, CFSMailMessage *)

IMPORT_C CFSMailMessagePart * CopyMessageAsChildPartL ( TFSMailMsgId aInsertBefore,
CFSMailMessage * aMessage
)

Copies given email object as new child part of this email part or email.

Parameters

TFSMailMsgId aInsertBefore defines place of where new child part is created, if aInsertBefore is NULL id then new part is added as last.
CFSMailMessage * aMessage message to be copied as child part

DoAttachmentListL(RPointerArray< CFSMailMessagePart > &)

void DoAttachmentListL ( RPointerArray < CFSMailMessagePart > & aParts ) [protected, virtual]

Returns a flat list of message parts that can be handled as attachments. Excludes message parts that are multipart and parts that are considered plain text or html body.

Parameters

RPointerArray < CFSMailMessagePart > & aParts contains flat list of attachments

FetchLoadState()

IMPORT_C TFSPartFetchState FetchLoadState ( ) const

returns email part content current fetch state Intended as utility function for UI. If (0 == FetchedContentSize() ) return EFSNone; else if ( FetchedContentSize() < ContentSize() ) then return EFSPartial else return EFSFull

FetchMessagePartL(const TFSMailMsgId, MFSMailRequestObserver &, const TUint)

IMPORT_C TInt FetchMessagePartL ( const TFSMailMsgId aMessagePartId,
MFSMailRequestObserver & aOperationObserver,
const TUint aPreferredByteCount
)

starts email part fetching from email server

Parameters

const TFSMailMsgId aMessagePartId message part id of email part to be fetched
MFSMailRequestObserver & aOperationObserver observer to forward fetching progress events to user
const TUint aPreferredByteCount indicates how much more content for part(s) user wants to fetch. Default value zero indicates that all content should be fetched. Actual amount of data fetched may differ from requested (possibly all fetched in any case).

FetchMessagesPartsL(const RArray< TFSMailMsgId > &, MFSMailRequestObserver &, const TUint)

IMPORT_C TInt FetchMessagesPartsL ( const RArray < TFSMailMsgId > & aMessagePartIds,
MFSMailRequestObserver & aOperationObserver,
const TUint aPreferredByteCount
)

starts email parts fetching from email server

Parameters

const RArray < TFSMailMsgId > & aMessagePartIds message part ids of email parts to be fetched
MFSMailRequestObserver & aOperationObserver observer to forward fetching progress events to user
const TUint aPreferredByteCount indicates how much more content for part(s) user wants to fetch. Default value zero indicates that all content should be fetched. Actual amount of data fetched may differ from requested (possibly all fetched in any case).

FetchedContentSize()

IMPORT_C TUint FetchedContentSize ( ) const

returns email part currently fetched (local) content size (in bytes).

FindBodyPartIdL(const TDesC &)

TFSMailMsgId FindBodyPartIdL ( const TDesC & aContentType ) [protected]

finds id of body part

Parameters

const TDesC & aContentType

FindBodyPartL(const TDesC &)

IMPORT_C CFSMailMessagePart * FindBodyPartL ( const TDesC & aContentType )

finds email body part based on given content type (plain text or html body part of email message)

Parameters

const TDesC & aContentType body part content type to be searched

GetContentClass()

IMPORT_C const TDesC & GetContentClass ( )

email Content-Class accessor

GetContentFileL()

IMPORT_C RFile GetContentFileL ( )

Retrieves a read-only file handle for the content file of this message part. The caller must close the file handle.

GetContentToBufferL(TDes16 &, TUint)

IMPORT_C void GetContentToBufferL ( TDes16 & aBuffer,
TUint aStartOffset
)

copies email part contents to buffer given by user

Parameters

TDes16 & aBuffer buffer owned by user
TUint aStartOffset offset from content begin

GetContentType()

IMPORT_C const TDesC & GetContentType ( )

email part content-type accessor (e.g. "text/plain")

GetMRInfo()

IMPORT_C MMRInfoObject & GetMRInfo ( )

meeting request accessor if email part is a meeting request

GetPartId()

IMPORT_C TFSMailMsgId GetPartId ( ) const

email part id accessor

IsMRInfoSet()

IMPORT_C TBool IsMRInfoSet ( )

method checks if MRInfo exists

IsMessageL()

IMPORT_C TBool IsMessageL ( ) const [virtual]

Returns ETrue if this email part is actually an email, so it's safe to cast this part to CFSMailMessage

ListMessagePartsL(RPointerArray< CFSMailMessagePart > &)

void ListMessagePartsL ( RPointerArray < CFSMailMessagePart > & aParts ) [protected]

lists subparts

NewChildPartL(const TFSMailMsgId, const TDesC &)

IMPORT_C CFSMailMessagePart * NewChildPartL ( const TFSMailMsgId aInsertBefore,
const TDesC & aContentType
)

Creates and adds a new child part to this email part

Parameters

const TFSMailMsgId aInsertBefore defines place where new child part is created, if aInsertBefore is NULL id then new part is added as last.
const TDesC & aContentType content type of the new child part

NewL(TFSMailMsgId, TFSMailMsgId)

IMPORT_C CFSMailMessagePart * NewL ( TFSMailMsgId aMessageId,
TFSMailMsgId aMessagePartId
) [static]

Two-phased constructor.

Parameters

TFSMailMsgId aMessageId message id in plugin containing email
TFSMailMsgId aMessagePartId message part id in plugin containing email

NewLC(TFSMailMsgId, TFSMailMsgId)

IMPORT_C CFSMailMessagePart * NewLC ( TFSMailMsgId aMessageId,
TFSMailMsgId aMessagePartId
) [static]

Two-phased constructor.

Parameters

TFSMailMsgId aMessageId message id in plugin containing email
TFSMailMsgId aMessagePartId message part id in plugin containing email

ReadOnlyPartSize()

IMPORT_C TUint ReadOnlyPartSize ( ) const

read only part size accessor (character or byte count)

RemoveChildPartL(TFSMailMsgId)

IMPORT_C void RemoveChildPartL ( TFSMailMsgId aPartId )

Removes child part (and it's children, if any) from this email part

Parameters

TFSMailMsgId aPartId part id of the email part to be removed

RemoveContentL()

IMPORT_C void RemoveContentL ( )

Removes from message store fetched contents of this part and possible child parts

RemoveDownLoadedAttachmentsL()

IMPORT_C void RemoveDownLoadedAttachmentsL ( )

removes attachment downloaded contents from local/terminal memory

SaveL()

IMPORT_C void SaveL ( )

saves this message part

SetAttachmentNameL(const TDesC &)

IMPORT_C void SetAttachmentNameL ( const TDesC & aFilePath )

Sets attachment name for email part. Full path can be given as input even though only filename is saved.

Parameters

const TDesC & aFilePath attachment name

SetContent(TDes16 &)

IMPORT_C void SetContent ( TDes16 & aBuffer )

copies email part contents from buffer given by user

Parameters

TDes16 & aBuffer buffer given by user

SetContentClass(const TDesC &)

IMPORT_C void SetContentClass ( const TDesC & aContentClass )

email Content-Class mutator

Parameters

const TDesC & aContentClass new email Content-Class value

SetContentDescription(const TDesC &)

IMPORT_C void SetContentDescription ( const TDesC & aContentDesctiption )

Stores email Content-Description value, parameters can be included, if any.

Parameters

const TDesC & aContentDesctiption

SetContentDisposition(const TDesC &)

IMPORT_C void SetContentDisposition ( const TDesC & aContentDesctiption )

Stores email Content-Disposition value, parameters can be included, if any.

Parameters

const TDesC & aContentDesctiption

SetContentFromFileL(const TDesC &)

IMPORT_C void SetContentFromFileL ( const TDesC & aFilePath )

Sets email part contents from given file, possible old contents are replaced.

Parameters

const TDesC & aFilePath defines the target file

SetContentIDL(const TDesC &)

IMPORT_C void SetContentIDL ( const TDesC & aContentID )

email Content-Id mutator

Parameters

const TDesC & aContentID new email Content-Id value

SetContentSize(const TUint)

IMPORT_C void SetContentSize ( const TUint aContentSize )

Sets email part full content size (in bytes)

Parameters

const TUint aContentSize content size to be set

SetContentType(const TDesC &)

IMPORT_C void SetContentType ( const TDesC & aContentType )

email part content-type mutator

Parameters

const TDesC & aContentType new content type value

SetFetchedContentSize(TUint)

IMPORT_C void SetFetchedContentSize ( TUint aContentSize )

Sets email part currently fetched (local) content size (in bytes).

Parameters

TUint aContentSize content size to be set

SetMRInfo(MMRInfoObject *)

IMPORT_C void SetMRInfo ( MMRInfoObject * aMeetingRequest )

stores given meeting request object as email part

Parameters

MMRInfoObject * aMeetingRequest meeting request object

SetMessagePartsStatus(TFSPartFetchState)

IMPORT_C void SetMessagePartsStatus ( TFSPartFetchState aMessagePartStatus )

sets email part fetch status

Parameters

TFSPartFetchState aMessagePartStatus (EFSMessagePartsKnown)

SetReadOnlyPartSize(const TUint)

IMPORT_C void SetReadOnlyPartSize ( const TUint aReadOnlyPartSize )

read only part size mutator

Parameters

const TUint aReadOnlyPartSize read only size to be set (character or byte count)

Member Data Documentation

HBufC * iAttachmentName

HBufC * iAttachmentName [private]

attachment name

HBufC * iContentClass

HBufC * iContentClass [private]

email content class

HBufC * iContentDescription

HBufC * iContentDescription [private]

email content decription

HBufC * iContentDisposition

HBufC * iContentDisposition [private]

email content disposition

CDesCArray * iContentDispositionParams

CDesCArray * iContentDispositionParams [private]

content disposition parameters

HBufC * iContentID

HBufC * iContentID [private]

email content id

TUint iContentSize

TUint iContentSize [private]

email part content size

HBufC * iContentType

HBufC * iContentType [protected]

message part MIME type

CDesCArray * iContentTypeParams

CDesCArray * iContentTypeParams [private]

content type parameters

TInt iFetchedContentSize

TInt iFetchedContentSize [private]

email part fetched content size

RFile iFile

RFile iFile [private]

TBool iIsFetched

TBool iIsFetched [private]

fetched from email server indication

MMRInfoObject * iMeetingRequest

MMRInfoObject * iMeetingRequest [private]

meeting request object

TFSMailMsgId iMessagePartId

TFSMailMsgId iMessagePartId [private]

message part id

RPointerArray< CFSMailMessagePart > iMessageParts

RPointerArray < CFSMailMessagePart > iMessageParts [protected]

message parts array

TFSPartFetchState iMessagePartsStatus

TFSPartFetchState iMessagePartsStatus [protected]

email fetch from email server status

TBool iReadMessageParts

TBool iReadMessageParts [protected]

TUint iReadOnlyPartSize

TUint iReadOnlyPartSize [private]

read only part size