Dacons LLP Mailit for C/C++ Version 1.0.8

Emai::Message Class Reference

EmaiMessage wrapper class.
EmaiMessage represents message object in RFC822 format. More...

#include <EmaiMessage.hpp>

Inheritance diagram for Emai::Message:

Emai::Object< EmaiMessage > List of all members.

Public Member Functions

 ~Message ()
 Message (MessagePart &inRootPart, EmaiOptions inOptions=EmaiNullOptions)
 Constructor.
 Message (const void *inData, EmaiUint32 inDataSize, EmaiOptions inOptions=EmaiNullOptions)
 Constructor.
 Message (EmaiMessage inMessage, bool inAddRef)
 Constructor.
 Message (const Message &inCopy)
 Constructor.
Messageoperator= (const Message &inCopy)
void SetContactList (const Emai::ContactList &inContactList, EmaiOptions inOptions)
void SetField (EmaiConstUniCharPtr inFieldName, EmaiConstUniCharPtr inFieldValue, EmaiOptions inOptions=EmaiNullOptions)
 Adds/replaces field to/at the message header.
ContactList CopyContactList (EmaiOptions inOptions)
EmaiConstUniCharPtr GetField (EmaiConstUniCharPtr inFieldName, EmaiOptions inOptions=EmaiNullOptions)
 Retrieves field content.
MessagePart GetRootPart (EmaiOptions inOptions=EmaiNullOptions)
 Retrieves the root message part from message object.
void GetData (const void **outData, EmaiUint32 *outHeaderSize, EmaiUint32 *outDataSize, EmaiOptions inOptions=EmaiNullOptions)
void GetReceivedDateTime (tm *outDateTime, EmaiOptions inOptions=EmaiNullOptions)
 Retrieves message received date and time.

Detailed Description

EmaiMessage wrapper class.
EmaiMessage represents message object in RFC822 format.

See also:
Emai::EmaiMessage

Definition at line 387 of file EmaiMessage.hpp.


Member Function Documentation

void Emai::Message::SetField ( EmaiConstUniCharPtr  inFieldName,
EmaiConstUniCharPtr  inFieldValue,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Adds/replaces field to/at the message header.

Parameters:
inFieldName - field name; if inFieldName is non-NULL, then inOptions parameter should be EmaiNullOptions; / if inFieldName is NULL, then inOptions parameter should specify one of the contact fields (EmaiFrom, EmaiTo, etc)
inFieldValue - field value, if NULL - the field is removed from the message header
inOptions - EmaiNullOptions, or EmaiFrom, EmaiTo, etc
See also:
EmaiMessageSetField

Definition at line 922 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiMessageSetField(), and Emai::Object< EmaiMessage >::mObject.

00927 {
00928     CheckErrorCode(EmaiMessageSetField(mObject,
00929                     inFieldName, inFieldValue, inOptions));
00930 }

EmaiConstUniCharPtr Emai::Message::GetField ( EmaiConstUniCharPtr  inFieldName,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Retrieves field content.

Parameters:
inFieldName - field name which content should be retrieved
inOptions - EmaiFailOnUnknownCharset or EmaiNullOptions
Returns:
Zero-terminated unicode string which contains field value. The function returns NULL if invalid parameters are specified (i.e. inFieldName is not valid object or parameter with the specified name is not found in the field)
See also:
EmaiMessageGetFieldByName

Definition at line 948 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiErrNoSuchField, EmaiMessageGetFieldByName(), and Emai::Object< EmaiMessage >::mObject.

Referenced by Emai::MessagePartEnumerator::ProcessContacts(), and Emai::MessagePartEnumerator::ProcessHeaderFields().

00952 {
00953     EmaiConstUniCharPtr fieldValue = NULL;
00954     EmaiError error = EmaiMessageGetFieldByName(mObject,
00955                     inFieldName, &fieldValue, inOptions);
00956     if (error == EmaiErrNoSuchField)
00957         fieldValue = NULL;
00958     else
00959         CheckErrorCode(error);
00960 
00961     return fieldValue;
00962 }

MessagePart Emai::Message::GetRootPart ( EmaiOptions  inOptions = EmaiNullOptions  )  [inline]

Retrieves the root message part from message object.

Parameters:
inOptions - not used in current version, use EmaiNullOptions
Returns:
On successful exit contains root message part object
See also:
EmaiMessageGetRootPart

Definition at line 965 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiMessageGetRootPart(), and Emai::Object< EmaiMessage >::mObject.

Referenced by Emai::MessagePartEnumerator::ProcessMessageParts().

00968 {
00969     EmaiMessagePart rootPart = NULL;
00970     CheckErrorCode(EmaiMessageGetRootPart(mObject, &rootPart, inOptions));
00971     return MessagePart(rootPart, true);
00972 }

void Emai::Message::GetData ( const void **  outData,
EmaiUint32 *  outHeaderSize,
EmaiUint32 *  outDataSize,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Parameters:
outData  can be NULL
outHeaderSize  can be NULL
outDataSize  can be NULL

Definition at line 975 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiMessageGetData(), and Emai::Object< EmaiMessage >::mObject.

00981 {
00982     CheckErrorCode(EmaiMessageGetData(mObject, outData, outHeaderSize,
00983                 outDataSize, inOptions));
00984 }

void Emai::Message::GetReceivedDateTime ( tm *  outDateTime,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Retrieves message received date and time.

Parameters:
inOptions - not used in current version, use EmaiNullOptions
inFormatString - printf-like format string
Returns:
On successful exit contains received date and time
See also:
EmaiMessageGetReceivedDateTime

Definition at line 987 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), and Emai::Object< EmaiMessage >::mObject.

00991 {
00992     CheckErrorCode(EmaiMessageGetReceivedDateTime(mObject, outDateTime, inOptions));
00993 }


The documentation for this class was generated from the following file: