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 void AddEncodingInfoL ( TImHeaderEncodingInfo &)
const CDesCArray & BccRecipients ()
CDesCArray & BccRecipients ()
IMPORT_C TMsgOutboxBodyEncoding BodyEncoding ()
const CDesCArray & CcRecipients ()
CDesCArray & CcRecipients ()
IMPORT_C TUint Charset ()
IMPORT_C TInt CreateForwardL ( CImHeader &, TDesC &)
IMPORT_C void CreateReceiptL ( CImHeader &, TDesC &)
IMPORT_C TInt CreateReplyL ( CImHeader &, TReplyTo , TDesC &)
IMPORT_C TInt DataSize ()
CArrayFix < TImHeaderEncodingInfo > & EncodingInfo ()
const CArrayFix < TImHeaderEncodingInfo > & EncodingInfo ()
IMPORT_C const TPtrC From ()
IMPORT_C const TPtrC8 ImMsgId ()
IMPORT_C const TPtrC8 InReplyTo ()
IMPORT_C void InternalizeL ( RMsvReadStream &)
IMPORT_C CImHeader * NewLC ()
IMPORT_C void ReDecodeL ( RFs &)
IMPORT_C const TPtrC ReceiptAddress ()
const TUint RemoteSize ()
IMPORT_C const TPtrC ReplyTo ()
const CDesCArray & ResentBccRecipients ()
CDesCArray & ResentBccRecipients ()
const CDesCArray & ResentCcRecipients ()
CDesCArray & ResentCcRecipients ()
IMPORT_C const TPtrC ResentFrom ()
IMPORT_C const TPtrC8 ResentMsgId ()
const CDesCArray & ResentToRecipients ()
CDesCArray & ResentToRecipients ()
IMPORT_C void Reset ()
IMPORT_C void RestoreL ( CMsvStore &)
IMPORT_C void SaveEncodedHeadersL ()
IMPORT_C void SetBodyEncoding ( TMsgOutboxBodyEncoding )
IMPORT_C void SetCharset (const TUint )
IMPORT_C void SetFromL (const TDesC8 &)
IMPORT_C void SetFromL (const TDesC16 &)
IMPORT_C void SetImMsgIdL (const TDesC8 &)
IMPORT_C void SetInReplyToL (const TDesC8 &)
IMPORT_C void SetOverrideCharset ( TUint )
IMPORT_C void SetReceiptAddressL (const TDesC8 &)
IMPORT_C void SetReceiptAddressL (const TDesC16 &)
void SetRemoteSize ( TUint )
IMPORT_C void SetReplyToL (const TDesC8 &)
IMPORT_C void SetReplyToL (const TDesC16 &)
IMPORT_C void SetResentFromL (const TDesC &)
IMPORT_C void SetResentMsgIdL (const TDesC8 &)
IMPORT_C void SetSubjectL (const TDesC8 &)
IMPORT_C void SetSubjectL (const TDesC16 &)
void SetVersion ( TUint16 )
IMPORT_C void StoreL ( CMsvStore &)
IMPORT_C void StoreWithoutCommitL ( CMsvStore &)
IMPORT_C const TPtrC Subject ()
const CDesCArray & ToRecipients ()
CDesCArray & ToRecipients ()
const TUint16 Version ()
Private Member Functions
CImHeader ()
void ConstructL ()
void FormatSubjectL ( CImHeader &, TDesC &)
TBool IsRecipientPresent ( CImHeader &, TPtrC16 )
void ReadRecipientsL ( RReadStream &, CDesCArray *)
void WriteRecipientsL ( 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
enum TReplyTo { 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 void AddEncodingInfoL ( TImHeaderEncodingInfo & aInfo )

Adds header field encoding information.

Parameters

TImHeaderEncodingInfo & aInfo Header field encoding information

BccRecipients()

const CDesCArray & BccRecipients ( ) const [inline]

BccRecipients()

CDesCArray & BccRecipients ( ) [inline]

BodyEncoding()

IMPORT_C TMsgOutboxBodyEncoding BodyEncoding ( ) 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 TUint Charset ( ) 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()

void ConstructL ( ) [private]

CreateForwardL(CImHeader &, TDesC &)

IMPORT_C TInt CreateForwardL ( 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 void CreateReceiptL ( CImHeader & ,
TDesC &
)

Parameters

CImHeader &
TDesC &

CreateReplyL(CImHeader &, TReplyTo, TDesC &)

IMPORT_C TInt CreateReplyL ( 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 TInt DataSize ( )

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

void FormatSubjectL ( CImHeader & ,
TDesC &
) [private]

Parameters

CImHeader &
TDesC &

From()

IMPORT_C const TPtrC From ( ) const

Gets the "From" header field.

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

ImMsgId()

IMPORT_C const TPtrC8 ImMsgId ( ) const

Gets the "MessageId" header field.

InReplyTo()

IMPORT_C const TPtrC8 InReplyTo ( ) 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 void InternalizeL ( RMsvReadStream & aReadStream )

Internalises the settings from a specified stream.

Parameters

RMsvReadStream & aReadStream Stream to read from

IsRecipientPresent(CImHeader &, TPtrC16)

TBool IsRecipientPresent ( CImHeader & aCImHeader,
TPtrC16 newRecipient
) [private]

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

Parameters

CImHeader & aCImHeader Contains "To" and "Cc" lists
TPtrC16 newRecipient Recipient 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 void ReDecodeL ( 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 & aFS A file server session handle.

ReadRecipientsL(RReadStream &, CDesCArray *)

void ReadRecipientsL ( RReadStream & ,
CDesCArray *
) [private]

ReceiptAddress()

IMPORT_C const TPtrC ReceiptAddress ( ) const

Gets the "Receipt" header field.

RemoteSize()

const TUint RemoteSize ( ) const [inline]

ReplyTo()

IMPORT_C const TPtrC ReplyTo ( ) 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 TPtrC ResentFrom ( ) const

ResentMsgId()

IMPORT_C const TPtrC8 ResentMsgId ( ) const

ResentToRecipients()

const CDesCArray & ResentToRecipients ( ) const [inline]

ResentToRecipients()

CDesCArray & ResentToRecipients ( ) [inline]

Reset()

IMPORT_C void Reset ( )

RestoreL(CMsvStore &)

IMPORT_C void RestoreL ( CMsvStore & aMessageStore )

Restores settings from a specified message store.

Parameters

CMsvStore & aMessageStore Message store to read from

SaveEncodedHeadersL()

IMPORT_C void SaveEncodedHeadersL ( )

SetBodyEncoding(TMsgOutboxBodyEncoding)

IMPORT_C void SetBodyEncoding ( TMsgOutboxBodyEncoding aMessageBodyEncoding )

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 aMessageBodyEncoding Method of encoding

SetCharset(const TUint)

IMPORT_C void SetCharset ( const TUint aCharset )

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 aCharset Identifier for the character set. Character sets idenitifiers are defined by the character conversion API in charconv.h.

SetFromL(const TDesC8 &)

IMPORT_C void SetFromL ( const TDesC8 & aFrom )

Sets the "From" header field.

Parameters

const TDesC8 & aFrom Field value

SetFromL(const TDesC16 &)

IMPORT_C void SetFromL ( const TDesC16 & aFrom )

Sets the "From" header field.

Parameters

const TDesC16 & aFrom Field value

SetImMsgIdL(const TDesC8 &)

IMPORT_C void SetImMsgIdL ( const TDesC8 & aImMsgIdL )

Sets the "MessageId" header field.

Sets the "MessageId" header field.

Parameters

const TDesC8 & aImMsgIdL Field value

SetInReplyToL(const TDesC8 &)

IMPORT_C void SetInReplyToL ( 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 void SetOverrideCharset ( TUint aCharset )

Sets the character set to be used when calling ReDecodeL.

Parameters

TUint aCharset The new character set.

SetReceiptAddressL(const TDesC8 &)

IMPORT_C void SetReceiptAddressL ( const TDesC8 & aReceiptAddress )

Sets the "Receipt" header field.

Sets the "Receipt" header field.

Parameters

const TDesC8 & aReceiptAddress Field value

SetReceiptAddressL(const TDesC16 &)

IMPORT_C void SetReceiptAddressL ( const TDesC16 & aReceiptAddress )

Sets the "Receipt" header field.

Sets the "Receipt" header field.

Parameters

const TDesC16 & aReceiptAddress Field value

SetRemoteSize(TUint)

void SetRemoteSize ( TUint aSize ) [inline]

Parameters

TUint aSize

SetReplyToL(const TDesC8 &)

IMPORT_C void SetReplyToL ( const TDesC8 & aReplyTo )

Sets the "ReplyTo" header field.

Parameters

const TDesC8 & aReplyTo Field value

SetReplyToL(const TDesC16 &)

IMPORT_C void SetReplyToL ( const TDesC16 & aReplyTo )

Sets the "ReplyTo" header field.

Parameters

const TDesC16 & aReplyTo Field value

SetResentFromL(const TDesC &)

IMPORT_C void SetResentFromL ( const TDesC & )

Parameters

const TDesC &

SetResentMsgIdL(const TDesC8 &)

IMPORT_C void SetResentMsgIdL ( const TDesC8 & )

Parameters

const TDesC8 &

SetSubjectL(const TDesC8 &)

IMPORT_C void SetSubjectL ( const TDesC8 & aSubject )

Parameters

const TDesC8 & aSubject

SetSubjectL(const TDesC16 &)

IMPORT_C void SetSubjectL ( const TDesC16 & aSubject )

Sets the "Subject" header field.

Parameters

const TDesC16 & aSubject Field value

SetVersion(TUint16)

void SetVersion ( TUint16 aVersion ) [inline]

Parameters

TUint16 aVersion

StoreL(CMsvStore &)

IMPORT_C void StoreL ( CMsvStore & aMessageStore ) const

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

Parameters

CMsvStore & aMessageStore Message store to write to

StoreWithoutCommitL(CMsvStore &)

IMPORT_C void StoreWithoutCommitL ( CMsvStore & aMessageStore ) const

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

Parameters

CMsvStore & aMessageStore Message store to write to

Subject()

IMPORT_C const TPtrC Subject ( ) 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 TUint16 Version ( ) const [inline]

WriteRecipientsL(RWriteStream &, const CDesCArray *)

void WriteRecipientsL ( 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]