An abstraction of a message stanza. More...
#include <message.h>
Inherits gloox::Stanza.
Public Types | |
enum | MessageType { Chat = 1, Error = 2, Groupchat = 4, Headline = 8, Normal = 16, Invalid = 32 } |
Public Member Functions | |
Message (MessageType type, const JID &to, const std::string &body=EmptyString, const std::string &subject=EmptyString, const std::string &thread=EmptyString, const std::string &xmllang=EmptyString) | |
virtual | ~Message () |
MessageType | subtype () const |
const std::string | body (const std::string &lang="default") const |
const std::string | subject (const std::string &lang="default") const |
const std::string & | thread () const |
void | setThread (const std::string &thread) |
void | setID (const std::string &id) |
const DelayedDelivery * | when () const |
virtual Tag * | tag () const |
An abstraction of a message stanza.
Definition at line 33 of file message.h.
enum MessageType |
Message | ( | MessageType | type, | |
const JID & | to, | |||
const std::string & | body = EmptyString , |
|||
const std::string & | subject = EmptyString , |
|||
const std::string & | thread = EmptyString , |
|||
const std::string & | xmllang = EmptyString | |||
) |
Creates a Message.
type | The message type. | |
to | The intended receiver. | |
body | The message's body text. | |
subject | The message's optional subject. | |
thread | The message's optional thread ID. | |
xmllang | An optional xml:lang for the message body. |
Definition at line 54 of file message.cpp.
~Message | ( | ) | [virtual] |
Destructor.
Definition at line 63 of file message.cpp.
const std::string body | ( | const std::string & | lang = "default" |
) | const [inline] |
Returns the message body for the given language if available. If the requested language is not available, the default body (without a xml:lang attribute) will be returned.
lang | The language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default body will be returned, if any. |
void setID | ( | const std::string & | id | ) | [inline] |
void setThread | ( | const std::string & | thread | ) | [inline] |
const std::string subject | ( | const std::string & | lang = "default" |
) | const [inline] |
Returns the message subject for the given language if available. If the requested language is not available, the default subject (without a xml:lang attribute) will be returned.
lang | The language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default subject will be returned, if any. |
MessageType subtype | ( | ) | const [inline] |
Tag * tag | ( | ) | const [virtual] |
const std::string& thread | ( | ) | const [inline] |
const DelayedDelivery* when | ( | ) | const [inline] |
Convenience function that returns a pointer to a DelayedDelivery StanzaExtension, if the message contains one.