# XMPP::Message Class Reference

`#include <xmpp.h>`

Inheritance diagram for XMPP::Message:

List of all members.

## Public Types

| Normal
| Chat
| Error
| GroupChat
| HeadLine
| Unknown = 999
enum | MessageType { Normal, Chat, Error, GroupChat, HeadLine, Unknown = 999 }

## Public Member Functions

| Message ()
| Construct a new empty message.
| Message (PXML &pdu)
| Construct a message from a (received) xml PDU.
| Message (PXML *pdu)
virtual PBoolean | IsValid () const
virtual MessageType | GetType (PString *typeName=0) const
virtual PString | GetLanguage () const
virtual PString | GetSubject (const PString &lang=PString::Empty())
| Get the subject for the specified language.
virtual PString | GetBody (const PString &lang=PString::Empty())
virtual PString | GetThread ()
virtual PXMLElement * | GetSubjectElement (const PString &lang=PString::Empty())
virtual PXMLElement * | GetBodyElement (const PString &lang=PString::Empty())
virtual void | SetType (MessageType type)
virtual void | SetType (const PString &type)
virtual void | SetLanguage (const PString &lang)
virtual void | SetSubject (const PString &subj, const PString &lang=PString::Empty())
virtual void | SetBody (const PString &body, const PString &lang=PString::Empty())
virtual void | SetThread (const PString &thrd)

## Static Public Member Functions

static const PCaselessString & | TypeTag ()
| Various constant strings.
static const PCaselessString & | SubjectTag ()
static const PCaselessString & | BodyTag ()
static const PCaselessString & | ThreadTag ()
static PBoolean | IsValid (const PXML *pdu)

## Member Enumeration Documentation

enum XMPP::Message::MessageType

Enumerator:

  Normal |
  Chat |
  Error |
  GroupChat |
  HeadLine |
  Unknown |

## Constructor & Destructor Documentation

XMPP::Message::Message | ( |  | ) |

Construct a new empty message.

XMPP::Message::Message | ( | PXML & | pdu | ) |

Construct a message from a (received) xml PDU.

The root of the pdu MUST be a message stanza. NOTE: the root of the pdu is cloned.

XMPP::Message::Message | ( | PXML * | pdu | ) |

## Member Function Documentation

static const PCaselessString& XMPP::Message::BodyTag | ( |  | ) | `[static]`

virtual PString XMPP::Message::GetBody | ( | const PString & | lang = `PString::Empty()` | ) | `[virtual]`

virtual PXMLElement* XMPP::Message::GetBodyElement | ( | const PString & | lang = `PString::Empty()` | ) | `[virtual]`

virtual PString XMPP::Message::GetLanguage | ( |  | ) | const`[virtual]`

virtual PString XMPP::Message::GetSubject | ( | const PString & | lang = `PString::Empty()` | ) | `[virtual]`

Get the subject for the specified language.

The default subject (if any) is returned in case no language is specified or a matching one cannot be found

virtual PXMLElement* XMPP::Message::GetSubjectElement | ( | const PString & | lang = `PString::Empty()` | ) | `[virtual]`

virtual PString XMPP::Message::GetThread | ( |  | ) | `[virtual]`

virtual MessageType XMPP::Message::GetType | ( | PString * | typeName = `0` | ) | const`[virtual]`

static PBoolean XMPP::Message::IsValid | ( | const PXML * | pdu | ) | `[static]`

virtual PBoolean XMPP::Message::IsValid | ( |  | ) | const`[virtual]`

Implements XMPP::Stanza.

virtual void XMPP::Message::SetBody | ( | const PString & | body,
|  | const PString & | lang = `PString::Empty()` |
| ) |  |  | `[virtual]`

virtual void XMPP::Message::SetLanguage | ( | const PString & | lang | ) | `[virtual]`

virtual void XMPP::Message::SetSubject | ( | const PString & | subj,
|  | const PString & | lang = `PString::Empty()` |
| ) |  |  | `[virtual]`

virtual void XMPP::Message::SetThread | ( | const PString & | thrd | ) | `[virtual]`

virtual void XMPP::Message::SetType | ( | const PString & | type | ) | `[virtual]`

virtual void XMPP::Message::SetType | ( | MessageType | type | ) | `[virtual]`

static const PCaselessString& XMPP::Message::SubjectTag | ( |  | ) | `[static]`

static const PCaselessString& XMPP::Message::ThreadTag | ( |  | ) | `[static]`

static const PCaselessString& XMPP::Message::TypeTag | ( |  | ) | `[static]`

Various constant strings.

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

- xmpp.h