Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: CMsvMimeHeaders.h
Link against: msgs.lib
Link against: msgs_autoshutdown.lib

Class CMsvMimeHeaders

class CMsvMimeHeaders : public CBase;

Description

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.

Derivation

Members

Defined in CMsvMimeHeaders:
ContainsMimeHeaders(), ContentBase(), ContentDescription(), ContentDisposition(), ContentDispositionParams(), ContentDispositionParams(), ContentId(), ContentLocation(), ContentSubType(), ContentTransferEncoding(), ContentTransferEncoding(), ContentType(), ContentTypeParams(), ContentTypeParams(), EEncodingType7Bit, EEncodingType8Bit, EEncodingTypeBASE64, EEncodingTypeBinary, EEncodingTypeNone, EEncodingTypeQP, EEncodingTypeUU, EEncodingTypeUnknown, GetContentTypeValue(), MimeCharset(), NewL(), NewLC(), RelativePath(), Reset(), RestoreL(), SetContentBaseL(), SetContentDescriptionL(), SetContentDispositionL(), SetContentIdL(), SetContentLocationL(), SetContentSubTypeL(), SetContentTransferEncoding(), SetContentTypeL(), SetMimeCharset(), SetRelativePathL(), SetSuggestedFilenameL(), Size(), StoreL(), SuggestedFilename(), TMsvEncodingType, XTypeParams(), XTypeParams(), ~CMsvMimeHeaders()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CMsvMimeHeaders *NewL();

Description

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

Creates and initailises the mime headers with no data.

Return value

CMsvMimeHeaders *

Pointer to the created mime headers object.


NewLC()

static IMPORT_C CMsvMimeHeaders *NewLC();

Description

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.

Return value

CMsvMimeHeaders *

Pointer to the created mime headers object.


~CMsvMimeHeaders()

IMPORT_C ~CMsvMimeHeaders();

Description

Standard destructor.

[Top]


Member functions


StoreL()

IMPORT_C void StoreL(CMsvAttachment &aAttachment) const;

Description

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 &aAttachment

The attachment object to store the mime header data to.


RestoreL()

IMPORT_C void RestoreL(CMsvAttachment &aAttachment);

Description

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 &aAttachment

The attachment object to restore the mime header data from.


SetContentDescriptionL()

IMPORT_C void SetContentDescriptionL(const TDesC8 &aContentDescription);

Description

Sets the Content-Description mime header.

Over-writes any existing data.

Parameters

const TDesC8 &aContentDescription

Descriptor conatining the Content-Description mime header.


ContentDescription()

IMPORT_C const TDesC8 &ContentDescription() const;

Description

Gets the Content-Description mime header.

Returns a zero length descriptor if mime header not set.

Return value

const TDesC8 &

Descriptor containing the Content-Description mime header. Zero length if the mime header not set.


SetContentBaseL()

IMPORT_C void SetContentBaseL(const TDesC8 &aContentBase);

Description

Sets the Content-Base mime header.

Over-writes any existing data.

Parameters

const TDesC8 &aContentBase

Descriptor conatining the Content-Base mime header.


ContentBase()

IMPORT_C const TDesC8 &ContentBase() const;

Description

Gets the Content-Base mime header.

Returns a zero length descriptor if mime header not set.

Return value

const TDesC8 &

Descriptor containing the Content-Base mime header. Zero length if the mime header not set.


SetContentLocationL()

IMPORT_C void SetContentLocationL(const TDesC16 &aContentLocation);

Description

Sets the Content-Location mime header.

Over-writes any existing data.

Parameters

const TDesC16 &aContentLocation

Descriptor conatining the Content-Base mime header.


ContentLocation()

IMPORT_C const TDesC16 &ContentLocation() const;

Description

Gets the Content-Location mime header.

Returns a zero length descriptor if mime header not set.

Return value

const TDesC16 &

Descriptor containing the Content-Location mime header. Zero length if the mime header not set.


SetContentIdL()

IMPORT_C void SetContentIdL(const TDesC8 &aContentId);

Description

Sets the Content-Id mime header.

Over-writes any existing data.

Parameters

const TDesC8 &aContentId

Descriptor conatining the Content-Id mime header.


ContentId()

IMPORT_C const TDesC8 &ContentId() const;

Description

Gets the Content-Id mime header.

Returns a zero length descriptor if mime header not set.

Return value

const TDesC8 &

Descriptor containing the Content-Id mime header. Zero length if the mime header not set.


SetContentTypeL()

IMPORT_C void SetContentTypeL(const TDesC8 &aContentType);

Description

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 &aContentType

Descriptor conatining the Content-Type mime header.


ContentType()

IMPORT_C const TDesC8 &ContentType() const;

Description

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'.

Return value

const TDesC8 &

Descriptor containing the Content-Type mime header. Zero length if the mime header not set.


SetContentSubTypeL()

IMPORT_C void SetContentSubTypeL(const TDesC8 &aSubContentType);

Description

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 &aSubContentType

Descriptor conatining the Content-SubType mime header.


ContentSubType()

IMPORT_C const TDesC8 &ContentSubType() const;

Description

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'.

Return value

const TDesC8 &

Descriptor containing the Content-SubType mime header. Zero length if the mime header not set.


SetContentDispositionL()

IMPORT_C void SetContentDispositionL(const TDesC8 &aContentDisposition);

Description

Sets the Content-Disposition mime header.

Over-writes any existing data.

Parameters

const TDesC8 &aContentDisposition


ContentDisposition()

IMPORT_C const TDesC8 &ContentDisposition() const;

Description

Gets the Content-Disposition mime header.

Returns a zero length descriptor if mime header not set.

Return value

const TDesC8 &

Descriptor containing the Content-Disposition mime header. Zero length if the mime header not set.


ContentTypeParams()

IMPORT_C CDesC8Array &ContentTypeParams();

Description

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

Return value

CDesC8Array &

A modifiable descriptor array.


ContentDispositionParams()

IMPORT_C CDesC8Array &ContentDispositionParams();

Description

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

Return value

CDesC8Array &

A modifiable descriptor array.


XTypeParams()

IMPORT_C CDesC8Array &XTypeParams();

Description

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

Return value

CDesC8Array &

A non-modifiable descriptor array.


ContentTypeParams()

IMPORT_C const CDesC8Array &ContentTypeParams() const;

Description

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

Return value

const CDesC8Array &

A non-modifiable descriptor array.


ContentDispositionParams()

IMPORT_C const CDesC8Array &ContentDispositionParams() const;

Description

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

Return value

const CDesC8Array &

A non-modifiable descriptor array.


XTypeParams()

IMPORT_C const CDesC8Array &XTypeParams() const;

Description

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

Return value

const CDesC8Array &

A modifiable descriptor array.


SetMimeCharset()

IMPORT_C void SetMimeCharset(TUint aMimeCharset);

Description

Sets the mime charset header.

Over-writes any existing data.

Parameters

TUint aMimeCharset


MimeCharset()

IMPORT_C TUint MimeCharset() const;

Description

Gets the mime charset header.

Return value

TUint

An integer representing the mime charset.


SetSuggestedFilenameL()

IMPORT_C void SetSuggestedFilenameL(const TDesC16 &aSuggestedFilename);

Description

Sets the suggested filename mime header.

Over-writes any existing data.

Parameters

const TDesC16 &aSuggestedFilename

Descriptor containing the suggested filename mime header data.


SuggestedFilename()

IMPORT_C const TDesC16 &SuggestedFilename() const;

Description

Gets the suggested filename mime header.

Returns a zero length descriptor if header is not set.

Return value

const TDesC16 &

Descriptor containing the suggested filename mime header. Zero length if the header not set.


SetRelativePathL()

IMPORT_C void SetRelativePathL(const TDesC8 &aRelativePath);

Description

Sets the relative path header.

Over-writes any existing data.

Parameters

const TDesC8 &aRelativePath


RelativePath()

IMPORT_C const TDesC8 &RelativePath() const;

Description

Gets the relative path mime header.

Returns a zero length descriptor if header is not set.

Return value

const TDesC8 &

Descriptor containing the relative path mime header. Zero length if the header not set.


SetContentTransferEncoding()

IMPORT_C void SetContentTransferEncoding(const TDesC8 &aEncodingType);

Description

Sets the Content-Transfer Encoding mime header.

Over-writes any existing data.

Parameters

const TDesC8 &aEncodingType

Descriptor conatining the Content-Transfer Encoding mime header.


ContentTransferEncoding()

IMPORT_C TMsvEncodingType ContentTransferEncoding() const;

Description

Gets the Content-Transfer Encoding mime header.

Return value

TMsvEncodingType

An enumeration of the Content-Transfer Encoding header. Returns EEncodingTypeUnknown if not set.

See also:


ContentTransferEncoding()

IMPORT_C TMsvEncodingType ContentTransferEncoding(TPtrC8 &aEncodingType) const;

Description

Gets the Content-Transfer Encoding mime header.

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

Parameters

TPtrC8 &aEncodingType

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

Return value

TMsvEncodingType

An enumeration of the Content-Transfer Encoding header. Returns EEncodingTypeUnknown if not set.

See also:


GetContentTypeValue()

IMPORT_C const TPtrC8 GetContentTypeValue(const TDesC8 &aContentTypeParameter) const;

Description

Gets the Content-Type mime header parameter value.

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

Parameters

const TDesC8 &aContentTypeParameter

The Content-Type parameter to get the value for.

Return value

const TPtrC8

The Content-Type parameter value requested. Returns a zero-length if the paramter cannot be found.


Reset()

IMPORT_C void Reset();

Description

Resets the mime headers.

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


Size()

IMPORT_C TInt Size() const;

Description

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.

Return value

TInt

The size in bytes of all the mime header data.


ContainsMimeHeaders()

IMPORT_C TBool ContainsMimeHeaders(const CMsvAttachment &aAttachment);

Description

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

Parameters

const CMsvAttachment &aAttachment

The attachment.

Return value

TBool

True if there is an MIME headers

[Top]


Member enumerations


Enum TMsvEncodingType

TMsvEncodingType

Description

Messaging encoding types.

EEncodingTypeUnknown

Unknown.

EEncodingTypeNone

None.

EEncodingType7Bit

7-bit.

EEncodingType8Bit

8-bit.

EEncodingTypeBinary

Binary.

EEncodingTypeQP

QP.

EEncodingTypeBASE64

Base64.

EEncodingTypeUU

UU.