CMsvMimeHeaders Class Reference

class CMsvMimeHeaders : public CBase

Utility class to represent commonly used Mime Headers. This object represents a number of common Mime Headers into a single class. It is intended that this class is used to represent the Mime Headers for an attachment represented by the CMsvAttachment class when using the Attachment API. The Mime header data can be associated with an attachment and stored and restored using the StoreL and RestoreL methods.

Inherits from

Public Member Functions
~CMsvMimeHeaders()
IMPORT_C TBoolContainsMimeHeaders(const CMsvAttachment &)
IMPORT_C const TDesC8 &ContentBase()
IMPORT_C const TDesC8 &ContentDescription()
IMPORT_C const TDesC8 &ContentDisposition()
IMPORT_C CDesC8Array &ContentDispositionParams()
IMPORT_C const CDesC8Array &ContentDispositionParams()
IMPORT_C const TDesC8 &ContentId()
IMPORT_C const TDesC16 &ContentLocation()
IMPORT_C const TDesC8 &ContentSubType()
IMPORT_C TMsvEncodingTypeContentTransferEncoding()
IMPORT_C TMsvEncodingTypeContentTransferEncoding(TPtrC8 &)
IMPORT_C const TDesC8 &ContentType()
IMPORT_C CDesC8Array &ContentTypeParams()
IMPORT_C const CDesC8Array &ContentTypeParams()
IMPORT_C const TPtrC8GetContentTypeValue(const TDesC8 &)
IMPORT_C TUintMimeCharset()
IMPORT_C CMsvMimeHeaders *NewL()
IMPORT_C CMsvMimeHeaders *NewLC()
IMPORT_C const TDesC8 &RelativePath()
IMPORT_C voidReset()
IMPORT_C voidRestoreL(CMsvAttachment &)
IMPORT_C voidSetContentBaseL(const TDesC8 &)
IMPORT_C voidSetContentDescriptionL(const TDesC8 &)
IMPORT_C voidSetContentDispositionL(const TDesC8 &)
IMPORT_C voidSetContentIdL(const TDesC8 &)
IMPORT_C voidSetContentLocationL(const TDesC16 &)
IMPORT_C voidSetContentSubTypeL(const TDesC8 &)
IMPORT_C voidSetContentTransferEncoding(const TDesC8 &)
IMPORT_C voidSetContentTypeL(const TDesC8 &)
IMPORT_C voidSetMimeCharset(TUint)
IMPORT_C voidSetRelativePathL(const TDesC8 &)
IMPORT_C voidSetSuggestedFilenameL(const TDesC16 &)
IMPORT_C TIntSize()
IMPORT_C voidStoreL(CMsvAttachment &)
IMPORT_C const TDesC16 &SuggestedFilename()
IMPORT_C CDesC8Array &XTypeParams()
IMPORT_C const CDesC8Array &XTypeParams()
Private Member Functions
CMsvMimeHeaders()
voidConstructL()
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()
Public Member Enumerations
enumTMsvEncodingType {
EEncodingTypeUnknown, EEncodingTypeNone, EEncodingType7Bit, EEncodingType8Bit, EEncodingTypeBinary, EEncodingTypeQP, EEncodingTypeBASE64, EEncodingTypeUU
}
Private Attributes
HBufC8 *iContentBase
HBufC8 *iContentDescription
HBufC8 *iContentDisposition
CDesC8ArrayFlat *iContentDispositionParams
HBufC8 *iContentId
HBufC16 *iContentLocation
HBufC8 *iContentSubType
TMsvEncodingType iContentTransferEncoding
HBufC8 *iContentType
CDesC8ArrayFlat *iContentTypeParams
TUint iMimeCharset
HBufC8 *iRelativePath
HBufC16 *iSuggestedFilename
CDesC8ArrayFlat *iXTypeParams

Constructor & Destructor Documentation

CMsvMimeHeaders()

CMsvMimeHeaders()[private]

~CMsvMimeHeaders()

IMPORT_C~CMsvMimeHeaders()

Standard destructor.

Member Functions Documentation

ConstructL()

voidConstructL()[private]

ContainsMimeHeaders(const CMsvAttachment &)

IMPORT_C TBoolContainsMimeHeaders(const CMsvAttachment &aAttachment)

Enquire whether a CMsvAttachment has MIME headers without restoring all the headers.

Parameters

const CMsvAttachment & aAttachmentThe attachment.

ContentBase()

IMPORT_C const TDesC8 &ContentBase()const

Gets the Content-Base mime header.

Returns a zero length descriptor if mime header not set.

ContentDescription()

IMPORT_C const TDesC8 &ContentDescription()const

Gets the Content-Description mime header.

Returns a zero length descriptor if mime header not set.

ContentDisposition()

IMPORT_C const TDesC8 &ContentDisposition()const

Gets the Content-Disposition mime header.

Returns a zero length descriptor if mime header not set.

ContentDispositionParams()

IMPORT_C CDesC8Array &ContentDispositionParams()

Returns a modifiable descriptor array containing the Content-Disposition parameters.

ContentDispositionParams()

IMPORT_C const CDesC8Array &ContentDispositionParams()const

Returns a non-modifiable descriptor array containing the Content-Disposition parameters.

ContentId()

IMPORT_C const TDesC8 &ContentId()const

Gets the Content-Id mime header.

Returns a zero length descriptor if mime header not set.

ContentLocation()

IMPORT_C const TDesC16 &ContentLocation()const

Gets the Content-Location mime header.

Returns a zero length descriptor if mime header not set.

ContentSubType()

IMPORT_C const TDesC8 &ContentSubType()const

Gets the Content-SubType mime header.

Returns a zero length descriptor if mime header not set. This mime header contains the end part of the mime-type, eg. the 'plain' part of 'text/plain'.

ContentTransferEncoding()

IMPORT_C TMsvEncodingTypeContentTransferEncoding()const

Gets the Content-Transfer Encoding mime header.

TMsvEncodingType

ContentTransferEncoding(TPtrC8 &)

IMPORT_C TMsvEncodingTypeContentTransferEncoding(TPtrC8 &aEncodingType)const

Gets the Content-Transfer Encoding mime header.

Also provides a descriptor that contains a textual representation of the content-transfer encoding header.

TMsvEncodingType

Parameters

TPtrC8 & aEncodingTypeThis desriptor is set to a textual representation of the mime header. Returns a zero-length

ContentType()

IMPORT_C const TDesC8 &ContentType()const

Gets the Content-Type mime header.

Returns a zero length descriptor if mime header not set. This mime header contains the beginning part of the mime-type, eg. the 'text' part of 'text/plain'.

ContentTypeParams()

IMPORT_C CDesC8Array &ContentTypeParams()

Returns a modifiable descriptor array containing the Content-Type parameters.

ContentTypeParams()

IMPORT_C const CDesC8Array &ContentTypeParams()const

Returns a non-modifiable descriptor array containing the Content-Type parameters.

GetContentTypeValue(const TDesC8 &)

IMPORT_C const TPtrC8GetContentTypeValue(const TDesC8 &aContentTypeParameter)const

Gets the Content-Type mime header parameter value.

This method finds the specifed parameter and extracts the value for it.

Parameters

const TDesC8 & aContentTypeParameterThe Content-Type parameter to get the value for.

MimeCharset()

IMPORT_C TUintMimeCharset()const

Gets the mime charset header.

NewL()

IMPORT_C CMsvMimeHeaders *NewL()[static]

Standard 2-phase construction, creates the mime headers object.

Creates and initailises the mime headers with no data.

NewLC()

IMPORT_C CMsvMimeHeaders *NewLC()[static]

Standard 2-phase construction, creates the mime headers object.

Creates and initailises the mime headers with no data. Leaves a pointer on the cleanup stack.

RelativePath()

IMPORT_C const TDesC8 &RelativePath()const

Gets the relative path mime header.

Returns a zero length descriptor if header is not set.

Reset()

IMPORT_C voidReset()

Resets the mime headers.

Resets and removes all the mime headers and data that has been set.

RestoreL(CMsvAttachment &)

IMPORT_C voidRestoreL(CMsvAttachment &aAttachment)

Restores the mime header data.

Restores all the mime header data from an existing attachment object. This restores mime headers that was stored using the StoreL method. If the attachment does not contain any mime headers, this object is reset.

Parameters

CMsvAttachment & aAttachmentThe attachment object to restore the mime header data from.

SetContentBaseL(const TDesC8 &)

IMPORT_C voidSetContentBaseL(const TDesC8 &aContentBase)

Sets the Content-Base mime header.

Over-writes any existing data.

Parameters

const TDesC8 & aContentBaseDescriptor conatining the Content-Base mime header.

SetContentDescriptionL(const TDesC8 &)

IMPORT_C voidSetContentDescriptionL(const TDesC8 &aContentDescription)

Sets the Content-Description mime header.

Over-writes any existing data.

Parameters

const TDesC8 & aContentDescriptionDescriptor conatining the Content-Description mime header.

SetContentDispositionL(const TDesC8 &)

IMPORT_C voidSetContentDispositionL(const TDesC8 &aContentDisposition)

Sets the Content-Disposition mime header.

Over-writes any existing data.

Parameters

const TDesC8 & aContentDisposition

SetContentIdL(const TDesC8 &)

IMPORT_C voidSetContentIdL(const TDesC8 &aContentId)

Sets the Content-Id mime header.

Over-writes any existing data.

Parameters

const TDesC8 & aContentIdDescriptor conatining the Content-Id mime header.

SetContentLocationL(const TDesC16 &)

IMPORT_C voidSetContentLocationL(const TDesC16 &aContentLocation)

Sets the Content-Location mime header.

Over-writes any existing data.

Parameters

const TDesC16 & aContentLocationDescriptor conatining the Content-Base mime header.

SetContentSubTypeL(const TDesC8 &)

IMPORT_C voidSetContentSubTypeL(const TDesC8 &aSubContentType)

Sets the Content-SubType mime header.

Over-writes any existing data. This mime header contains the end part of the mime-type, eg. the 'plain' part of 'text/plain'.

Parameters

const TDesC8 & aSubContentTypeDescriptor conatining the Content-SubType mime header.

SetContentTransferEncoding(const TDesC8 &)

IMPORT_C voidSetContentTransferEncoding(const TDesC8 &aEncodingType)

Sets the Content-Transfer Encoding mime header.

Over-writes any existing data.

Parameters

const TDesC8 & aEncodingTypeDescriptor conatining the Content-Transfer Encoding mime header.

SetContentTypeL(const TDesC8 &)

IMPORT_C voidSetContentTypeL(const TDesC8 &aContentType)

Sets the Content-Type mime header.

Over-writes any existing data. This mime header contains the beginning part of the mime-type, eg. the 'text' part of 'text/plain'.

Parameters

const TDesC8 & aContentTypeDescriptor conatining the Content-Type mime header.

SetMimeCharset(TUint)

IMPORT_C voidSetMimeCharset(TUintaMimeCharset)

Sets the mime charset header.

Over-writes any existing data.

Parameters

TUint aMimeCharset

SetRelativePathL(const TDesC8 &)

IMPORT_C voidSetRelativePathL(const TDesC8 &aRelativePath)

Sets the relative path header.

Over-writes any existing data.

Parameters

const TDesC8 & aRelativePath

SetSuggestedFilenameL(const TDesC16 &)

IMPORT_C voidSetSuggestedFilenameL(const TDesC16 &aSuggestedFilename)

Sets the suggested filename mime header.

Over-writes any existing data.

Parameters

const TDesC16 & aSuggestedFilenameDescriptor containing the suggested filename mime header data.

Size()

IMPORT_C TIntSize()const

Returns the size of all the mime header data.

Returns the approximate size in bytes of all the mime header data stored by this object. The returned value is a sum of the lengths of all the string data and the size of an integer for each integer type data.

StoreL(CMsvAttachment &)

IMPORT_C voidStoreL(CMsvAttachment &aAttachment)const

Stores the mime header data.

Associated and stores all the mime header data stored in this object as an attribute of an attachment object. The RestoreL method should be used to restore the data from the attachment.

Parameters

CMsvAttachment & aAttachmentThe attachment object to store the mime header data to.

SuggestedFilename()

IMPORT_C const TDesC16 &SuggestedFilename()const

Gets the suggested filename mime header.

Returns a zero length descriptor if header is not set.

XTypeParams()

IMPORT_C CDesC8Array &XTypeParams()

Returns a non-modifiable descriptor array containing the X-Type parameters.

XTypeParams()

IMPORT_C const CDesC8Array &XTypeParams()const

Returns a modifiable descriptor array containing the X-Type parameters.

Member Enumerations Documentation

Enum TMsvEncodingType

Messaging encoding types.

Enumerators

EEncodingTypeUnknown

Unknown.

EEncodingTypeNone

None.

EEncodingType7Bit

7-bit.

EEncodingType8Bit

8-bit.

EEncodingTypeBinary

Binary.

EEncodingTypeQP

QP.

EEncodingTypeBASE64

Base64.

EEncodingTypeUU

UU.

Member Data Documentation

HBufC8 * iContentBase

HBufC8 *iContentBase[private]

HBufC8 * iContentDescription

HBufC8 *iContentDescription[private]

HBufC8 * iContentDisposition

HBufC8 *iContentDisposition[private]

CDesC8ArrayFlat * iContentDispositionParams

CDesC8ArrayFlat *iContentDispositionParams[private]

HBufC8 * iContentId

HBufC8 *iContentId[private]

HBufC16 * iContentLocation

HBufC16 *iContentLocation[private]

HBufC8 * iContentSubType

HBufC8 *iContentSubType[private]

TMsvEncodingType iContentTransferEncoding

TMsvEncodingType iContentTransferEncoding[private]

HBufC8 * iContentType

HBufC8 *iContentType[private]

CDesC8ArrayFlat * iContentTypeParams

CDesC8ArrayFlat *iContentTypeParams[private]

TUint iMimeCharset

TUint iMimeCharset[private]

HBufC8 * iRelativePath

HBufC8 *iRelativePath[private]

HBufC16 * iSuggestedFilename

HBufC16 *iSuggestedFilename[private]

CDesC8ArrayFlat * iXTypeParams

CDesC8ArrayFlat *iXTypeParams[private]