#include <message.h>
List of all members.
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 |
Detailed Description
An abstraction of a message stanza.
- Author:
- Vincent Thomasset
-
Jakob Schroeter <js@camaya.net>
- Since:
- 1.0
Definition at line 33 of file message.h.
Member Enumeration Documentation
Describes the different valid message types.
- Enumerator:
Chat |
A chat message.
|
Error |
An error message.
|
Groupchat |
A groupchat message.
|
Headline |
A headline message.
|
Normal |
A normal message.
|
Invalid |
The message stanza is invalid.
|
Definition at line 43 of file message.h.
Constructor & Destructor Documentation
Creates a Message.
- Parameters:
-
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.
Member Function Documentation
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.
- Parameters:
-
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. |
- Returns:
- The message body.
Definition at line 86 of file message.h.
void setID |
( |
const std::string & |
id | ) |
[inline] |
Sets the message's ID. Optional.
- Parameters:
-
Definition at line 121 of file message.h.
void setThread |
( |
const std::string & |
thread | ) |
[inline] |
Sets the thread ID.
- Parameters:
-
Definition at line 115 of file message.h.
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.
- Parameters:
-
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. |
- Returns:
- The message subject.
Definition at line 100 of file message.h.
Returns the message's type.
- Returns:
- The message's type.
Definition at line 75 of file message.h.
Creates a Tag representation of the Stanza. The Tag is completely independent of the Stanza and will not be updated when the Stanza is modified.
- Returns:
- A pointer to a Tag representation. It is the job of the caller to delete the Tag.
Implements Stanza.
Definition at line 69 of file message.cpp.
const std::string& thread |
( |
| ) |
const [inline] |
Returns the thread ID of a message stanza.
- Returns:
- The thread ID of a message stanza. Empty for non-message stanzas.
Definition at line 109 of file message.h.
The documentation for this class was generated from the following files: