CImHeader Class Reference

class CImHeader : public CBase

Encapsulates an Internet Mail (RFC822) header.

Note that the class contains some obsolete functions that take a narrow descriptor: always use the equivalent wide descriptor function instead.

Inherits from

Public Member Functions
~CImHeader()
IMPORT_C voidAddEncodingInfoL(TImHeaderEncodingInfo &)
const CDesCArray &BccRecipients()
CDesCArray &BccRecipients()
IMPORT_C TMsgOutboxBodyEncodingBodyEncoding()
const CDesCArray &CcRecipients()
CDesCArray &CcRecipients()
IMPORT_C TUintCharset()
IMPORT_C TIntCreateForwardL(CImHeader &, TDesC &)
IMPORT_C voidCreateReceiptL(CImHeader &, TDesC &)
IMPORT_C TIntCreateReplyL(CImHeader &, TReplyTo, TDesC &)
IMPORT_C TIntDataSize()
CArrayFix< TImHeaderEncodingInfo > &EncodingInfo()
const CArrayFix< TImHeaderEncodingInfo > &EncodingInfo()
IMPORT_C const TPtrCFrom()
IMPORT_C const TPtrC8ImMsgId()
IMPORT_C const TPtrC8InReplyTo()
IMPORT_C voidInternalizeL(RMsvReadStream &)
IMPORT_C CImHeader *NewLC()
IMPORT_C voidReDecodeL(RFs &)
IMPORT_C const TPtrCReceiptAddress()
const TUintRemoteSize()
IMPORT_C const TPtrCReplyTo()
const CDesCArray &ResentBccRecipients()
CDesCArray &ResentBccRecipients()
const CDesCArray &ResentCcRecipients()
CDesCArray &ResentCcRecipients()
IMPORT_C const TPtrCResentFrom()
IMPORT_C const TPtrC8ResentMsgId()
const CDesCArray &ResentToRecipients()
CDesCArray &ResentToRecipients()
IMPORT_C voidReset()
IMPORT_C voidRestoreL(CMsvStore &)
IMPORT_C voidSaveEncodedHeadersL()
IMPORT_C voidSetBodyEncoding(TMsgOutboxBodyEncoding)
IMPORT_C voidSetCharset(const TUint)
IMPORT_C voidSetFromL(const TDesC8 &)
IMPORT_C voidSetFromL(const TDesC16 &)
IMPORT_C voidSetImMsgIdL(const TDesC8 &)
IMPORT_C voidSetInReplyToL(const TDesC8 &)
IMPORT_C voidSetOverrideCharset(TUint)
IMPORT_C voidSetReceiptAddressL(const TDesC8 &)
IMPORT_C voidSetReceiptAddressL(const TDesC16 &)
voidSetRemoteSize(TUint)
IMPORT_C voidSetReplyToL(const TDesC8 &)
IMPORT_C voidSetReplyToL(const TDesC16 &)
IMPORT_C voidSetResentFromL(const TDesC &)
IMPORT_C voidSetResentMsgIdL(const TDesC8 &)
IMPORT_C voidSetSubjectL(const TDesC8 &)
IMPORT_C voidSetSubjectL(const TDesC16 &)
voidSetVersion(TUint16)
IMPORT_C voidStoreL(CMsvStore &)
IMPORT_C voidStoreWithoutCommitL(CMsvStore &)
IMPORT_C const TPtrCSubject()
const CDesCArray &ToRecipients()
CDesCArray &ToRecipients()
const TUint16Version()
Private Member Functions
CImHeader()
voidConstructL()
voidFormatSubjectL(CImHeader &, TDesC &)
TBool IsRecipientPresent(CImHeader &, TPtrC16)
voidReadRecipientsL(RReadStream &, CDesCArray *)
voidWriteRecipientsL(RWriteStream &, const CDesCArray *)
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
enumTReplyTo { EOriginator, ESender, EAll, ERecipients }
Private Attributes
TUint i822HeaderCharset
CDesCArray *iBcc
TMsgOutboxBodyEncoding iBodyEncoding
CDesCArray *iCc
CImEncodedHeader *iEncodedHeader
CArrayFix< TImHeaderEncodingInfo > *iEncodingInfo
HBufC16 *iFrom
HBufC8 *iImMsgId
HBufC8 *iInReplyTo
HBufC16 *iReceipt
TUint iRemoteSize
HBufC16 *iReplyTo
CDesCArray *iResentBcc
CDesCArray *iResentCc
HBufC *iResentFrom
HBufC8 *iResentMsgId
CDesCArray *iResentTo
HBufC *iSubject
CDesCArray *iTo
TUint16 iVersion

Constructor & Destructor Documentation

CImHeader()

CImHeader()[private]

~CImHeader()

IMPORT_C~CImHeader()

Destructor.

Member Functions Documentation

AddEncodingInfoL(TImHeaderEncodingInfo &)

IMPORT_C voidAddEncodingInfoL(TImHeaderEncodingInfo &aInfo)

Adds header field encoding information.

Parameters

TImHeaderEncodingInfo & aInfoHeader field encoding information

BccRecipients()

const CDesCArray &BccRecipients()const [inline]

BccRecipients()

CDesCArray &BccRecipients()[inline]

BodyEncoding()

IMPORT_C TMsgOutboxBodyEncodingBodyEncoding()const

Gets the method of encoding the body of the email message.

The default value (EMsgOutboxMIME) is set so that text parts of the message are sent as MIME multipart/alternative text/html parts, and are encoded using UTF-8.

TMsgOutboxBodyEncoding

CcRecipients()

const CDesCArray &CcRecipients()const [inline]

CcRecipients()

CDesCArray &CcRecipients()[inline]

Charset()

IMPORT_C TUintCharset()const

Gets the character set to use when sending the message header.

If set, this overrides the default system character set for sending the header.

Character set and encoding options can also be set on a per header field basis using TImHeaderEncodingInfo objects. See EncodingInfo().

SetCharset() EncodingInfo()

ConstructL()

voidConstructL()[private]

CreateForwardL(CImHeader &, TDesC &)

IMPORT_C TIntCreateForwardL(CImHeader &,
TDesC &
)

Populates a new forward header.

The subject line passed in is used to construct the forward subject field value. This is then stored in the new header.

Parameters

CImHeader & Header to populate
TDesC & Subject line

CreateReceiptL(CImHeader &, TDesC &)

IMPORT_C voidCreateReceiptL(CImHeader &,
TDesC &
)

Parameters

CImHeader &
TDesC &

CreateReplyL(CImHeader &, TReplyTo, TDesC &)

IMPORT_C TIntCreateReplyL(CImHeader &,
TReplyTo,
TDesC &
)

Populates a new Reply header.

The subject line passed in is used to construct the Reply subject field value. This is then stored in the new header.

Parameters

CImHeader & Header to populate
TReplyTo Reply-to address flag
TDesC & Subject line

DataSize()

IMPORT_C TIntDataSize()

Gets the combined length of all the field values stored.

EncodingInfo()

CArrayFix< TImHeaderEncodingInfo > &EncodingInfo()[inline]

Gets information relating to the encoding of header fields in received email.

This includes the charset. This information can be used when forwarding the email, to re-encode the header fields.

EncodingInfo()

const CArrayFix< TImHeaderEncodingInfo > &EncodingInfo()const [inline]

FormatSubjectL(CImHeader &, TDesC &)

voidFormatSubjectL(CImHeader &,
TDesC &
)[private]

Parameters

CImHeader &
TDesC &

From()

IMPORT_C const TPtrCFrom()const

Gets the "From" header field.

This consists of an address and (possibly) an alias.

ImMsgId()

IMPORT_C const TPtrC8ImMsgId()const

Gets the "MessageId" header field.

InReplyTo()

IMPORT_C const TPtrC8InReplyTo()const

Gets the "In Reply To" header field.

For reply messages, this field stores the ID of the message to which this is a reply. It is set by CImHeader::CreateReplyL().

InternalizeL(RMsvReadStream &)

IMPORT_C voidInternalizeL(RMsvReadStream &aReadStream)

Internalises the settings from a specified stream.

Parameters

RMsvReadStream & aReadStreamStream to read from

IsRecipientPresent(CImHeader &, TPtrC16)

TBool IsRecipientPresent(CImHeader &aCImHeader,
TPtrC16newRecipient
)[private]

checks if the recipient already exists in "Cc" or "To" list

Parameters

CImHeader & aCImHeaderContains "To" and "Cc" lists
TPtrC16 newRecipientRecipient to be checked for duplicate

NewLC()

IMPORT_C CImHeader *NewLC()[static]

Allocates and creates a new CImHeader object, leaving the object on the cleanup stack.

ReDecodeL(RFs &)

IMPORT_C voidReDecodeL(RFs &aFS)

Decodes the original message data into the CImHeader fields using the override character set.

8 bit data MUST be decoded using the normal method initially before this method is called.

leave
KErrNotSupported Encoded header information has not been saved.

Parameters

RFs & aFSA file server session handle.

ReadRecipientsL(RReadStream &, CDesCArray *)

voidReadRecipientsL(RReadStream &,
CDesCArray *
)[private]

Parameters

RReadStream &
CDesCArray *

ReceiptAddress()

IMPORT_C const TPtrCReceiptAddress()const

Gets the "Receipt" header field.

RemoteSize()

const TUintRemoteSize()const [inline]

ReplyTo()

IMPORT_C const TPtrCReplyTo()const

Gets the "ReplyTo" header field.

ResentBccRecipients()

const CDesCArray &ResentBccRecipients()const [inline]

ResentBccRecipients()

CDesCArray &ResentBccRecipients()[inline]

ResentCcRecipients()

const CDesCArray &ResentCcRecipients()const [inline]

ResentCcRecipients()

CDesCArray &ResentCcRecipients()[inline]

ResentFrom()

IMPORT_C const TPtrCResentFrom()const

ResentMsgId()

IMPORT_C const TPtrC8ResentMsgId()const

ResentToRecipients()

const CDesCArray &ResentToRecipients()const [inline]

ResentToRecipients()

CDesCArray &ResentToRecipients()[inline]

Reset()

IMPORT_C voidReset()

RestoreL(CMsvStore &)

IMPORT_C voidRestoreL(CMsvStore &aMessageStore)

Restores settings from a specified message store.

Parameters

CMsvStore & aMessageStoreMessage store to read from

SaveEncodedHeadersL()

IMPORT_C voidSaveEncodedHeadersL()

SetBodyEncoding(TMsgOutboxBodyEncoding)

IMPORT_C voidSetBodyEncoding(TMsgOutboxBodyEncodingaMessageBodyEncoding)

Sets the method of encoding the body of the email message.

The default value (EMsgOutboxMIME) is set so that text parts of the message are sent as MIME multipart/alternative text/html parts, and are encoded using UTF-8.

TMsgOutboxBodyEncoding

Parameters

TMsgOutboxBodyEncoding aMessageBodyEncodingMethod of encoding

SetCharset(const TUint)

IMPORT_C voidSetCharset(const TUintaCharset)

Sets the character set to use when sending the message header.

This setting overrides the default system character set for sending the header.

Character set and encoding options can also be set on a per header field basis using TImHeaderEncodingInfo objects. See AddEncodingInfoL().

Charset() AddEncodingInfoL()

Parameters

const TUint aCharsetIdentifier for the character set. Character sets idenitifiers are defined by the character conversion API in charconv.h.

SetFromL(const TDesC8 &)

IMPORT_C voidSetFromL(const TDesC8 &aFrom)

Sets the "From" header field.

Parameters

const TDesC8 & aFromField value

SetFromL(const TDesC16 &)

IMPORT_C voidSetFromL(const TDesC16 &aFrom)

Sets the "From" header field.

Parameters

const TDesC16 & aFromField value

SetImMsgIdL(const TDesC8 &)

IMPORT_C voidSetImMsgIdL(const TDesC8 &aImMsgIdL)

Sets the "MessageId" header field.

Sets the "MessageId" header field.

Parameters

const TDesC8 & aImMsgIdLField value

SetInReplyToL(const TDesC8 &)

IMPORT_C voidSetInReplyToL(const TDesC8 &)

Sets the "In Reply To" header field.

For reply messages, this field stores the ID of the message to which this is a reply.

Parameters

const TDesC8 & "In Reply To" header field

SetOverrideCharset(TUint)

IMPORT_C voidSetOverrideCharset(TUintaCharset)

Sets the character set to be used when calling ReDecodeL.

Parameters

TUint aCharsetThe new character set.

SetReceiptAddressL(const TDesC8 &)

IMPORT_C voidSetReceiptAddressL(const TDesC8 &aReceiptAddress)

Sets the "Receipt" header field.

Sets the "Receipt" header field.

Parameters

const TDesC8 & aReceiptAddressField value

SetReceiptAddressL(const TDesC16 &)

IMPORT_C voidSetReceiptAddressL(const TDesC16 &aReceiptAddress)

Sets the "Receipt" header field.

Sets the "Receipt" header field.

Parameters

const TDesC16 & aReceiptAddressField value

SetRemoteSize(TUint)

voidSetRemoteSize(TUintaSize)[inline]

Parameters

TUint aSize

SetReplyToL(const TDesC8 &)

IMPORT_C voidSetReplyToL(const TDesC8 &aReplyTo)

Sets the "ReplyTo" header field.

Parameters

const TDesC8 & aReplyToField value

SetReplyToL(const TDesC16 &)

IMPORT_C voidSetReplyToL(const TDesC16 &aReplyTo)

Sets the "ReplyTo" header field.

Parameters

const TDesC16 & aReplyToField value

SetResentFromL(const TDesC &)

IMPORT_C voidSetResentFromL(const TDesC &)

Parameters

const TDesC &

SetResentMsgIdL(const TDesC8 &)

IMPORT_C voidSetResentMsgIdL(const TDesC8 &)

Parameters

const TDesC8 &

SetSubjectL(const TDesC8 &)

IMPORT_C voidSetSubjectL(const TDesC8 &aSubject)

Parameters

const TDesC8 & aSubject

SetSubjectL(const TDesC16 &)

IMPORT_C voidSetSubjectL(const TDesC16 &aSubject)

Sets the "Subject" header field.

Parameters

const TDesC16 & aSubjectField value

SetVersion(TUint16)

voidSetVersion(TUint16aVersion)[inline]

Parameters

TUint16 aVersion

StoreL(CMsvStore &)

IMPORT_C voidStoreL(CMsvStore &aMessageStore)const

Stores, but does not commit, settings to a specified message store.

Parameters

CMsvStore & aMessageStoreMessage store to write to

StoreWithoutCommitL(CMsvStore &)

IMPORT_C voidStoreWithoutCommitL(CMsvStore &aMessageStore)const

Stores, but does not commit, settings to a specified message store.

Parameters

CMsvStore & aMessageStoreMessage store to write to

Subject()

IMPORT_C const TPtrCSubject()const

Gets the "Subject" header field.

ToRecipients()

const CDesCArray &ToRecipients()const [inline]

Gets a const list of "To" recipients.

ToRecipients()

CDesCArray &ToRecipients()[inline]

Gets a list of "To" recipients.

Version()

const TUint16Version()const [inline]

WriteRecipientsL(RWriteStream &, const CDesCArray *)

voidWriteRecipientsL(RWriteStream &,
const CDesCArray *
)const [private]

Parameters

RWriteStream &
const CDesCArray *

Member Enumerations Documentation

Enum TReplyTo

Flags used to determine where to obtain the ReplyTo address for the header field of that name.

Enumerators

EOriginator

Get address from originator.

ESender

Get address from sender.

EAll

Get address from all sources.

ERecipients

Get address from recipients.

Member Data Documentation

TUint i822HeaderCharset

TUint i822HeaderCharset[private]

CDesCArray * iBcc

CDesCArray *iBcc[private]

TMsgOutboxBodyEncoding iBodyEncoding

TMsgOutboxBodyEncoding iBodyEncoding[private]

CDesCArray * iCc

CDesCArray *iCc[private]

CImEncodedHeader * iEncodedHeader

CImEncodedHeader *iEncodedHeader[private]

CArrayFix< TImHeaderEncodingInfo > * iEncodingInfo

CArrayFix< TImHeaderEncodingInfo > *iEncodingInfo[private]

HBufC16 * iFrom

HBufC16 *iFrom[private]

HBufC8 * iImMsgId

HBufC8 *iImMsgId[private]

HBufC8 * iInReplyTo

HBufC8 *iInReplyTo[private]

HBufC16 * iReceipt

HBufC16 *iReceipt[private]

TUint iRemoteSize

TUint iRemoteSize[private]

HBufC16 * iReplyTo

HBufC16 *iReplyTo[private]

CDesCArray * iResentBcc

CDesCArray *iResentBcc[private]

CDesCArray * iResentCc

CDesCArray *iResentCc[private]

HBufC * iResentFrom

HBufC *iResentFrom[private]

HBufC8 * iResentMsgId

HBufC8 *iResentMsgId[private]

CDesCArray * iResentTo

CDesCArray *iResentTo[private]

HBufC * iSubject

HBufC *iSubject[private]

CDesCArray * iTo

CDesCArray *iTo[private]

TUint16 iVersion

TUint16 iVersion[private]