#include <stanza.h>
Inherits Tag.
Inheritance diagram for Stanza:
Public Member Functions | |
Stanza (Tag *tag) | |
Stanza (const std::string &name, const std::string &cdata="", const std::string &xmllang="default") | |
virtual | ~Stanza () |
virtual StanzaSubType | subtype () const |
virtual const JID & | from () const |
virtual const JID & | to () const |
virtual const std::string | id () const |
virtual const std::string & | xmlns () const |
virtual PresenceStatus | show () const |
virtual const std::string | status (const std::string &lang="default") const |
virtual const std::string | body (const std::string &lang="default") const |
virtual const std::string | subject (const std::string &lang="default") const |
virtual const std::string | errorText (const std::string &lang="default") const |
virtual StanzaError | error () const |
Tag * | errorAppCondition () |
virtual const std::string | thread () const |
const std::string & | xmlLang () const |
void | finalize () |
virtual Stanza * | clone (bool=true) |
Static Public Member Functions | |
static Stanza * | createIqStanza (const JID &to, const std::string &id, StanzaSubType subtype=STANZA_IQ_GET, const std::string &xmlns="", Tag *tag=0) |
static Stanza * | createPresenceStanza (const JID &to, const std::string &msg="", PresenceStatus status=PRESENCE_AVAILABLE, const std::string &xmllang="") |
static Stanza * | createMessageStanza (const JID &to, const std::string &body, StanzaSubType subtype=STANZA_MESSAGE_CHAT, const std::string &subject="", const std::string &thread="", const std::string &xmllang="") |
static Stanza * | createSubscriptionStanza (const JID &to, const std::string &msg="", StanzaSubType subtype=STANZA_S10N_SUBSCRIBE, const std::string &xmllang="") |
Protected Member Functions | |
void | init () |
Protected Attributes | |
StanzaSubType | m_subtype |
PresenceStatus | m_show |
StanzaError | m_stanzaError |
StanzaErrorType | m_stanzaErrorType |
Tag * | m_stanzaErrorAppCondition |
StringMap | m_errorText |
StringMap | m_body |
StringMap | m_subject |
StringMap | m_status |
JID | m_from |
JID | m_to |
std::string | m_xmlns |
std::string | m_id |
std::string | m_thread |
std::string | m_xmllang |
int | m_priority |
You can create a new Stanza from an existing Tag (or another stanza).
Definition at line 31 of file stanza.h.
|
Creates a new Stanza from a deep copy of the given Tag.
Definition at line 27 of file stanza.cpp. References Tag::addChild(), Tag::attributes(), Tag::children(), and Tag::m_attribs. Referenced by Stanza::clone(), Stanza::createIqStanza(), Stanza::createMessageStanza(), Stanza::createPresenceStanza(), and Stanza::createSubscriptionStanza(). |
|
Creates a new Stanza with given name and optional CData.
Definition at line 20 of file stanza.cpp. |
|
Virtual destructor. |
|
Returns the body of a message stanza for the given language if available. If the requested language is not available, the default body (without a xml:lang attribute) will be returned.
Definition at line 295 of file stanza.cpp. References Stanza::m_body. |
|
This function creates a deep copy of this Stanza.
Definition at line 331 of file stanza.cpp. References Stanza::Stanza(). |
|
Creates a new IQ stanza.
Definition at line 337 of file stanza.cpp. References Tag::addAttrib(), Stanza::Stanza(), gloox::STANZA_IQ_ERROR, gloox::STANZA_IQ_GET, gloox::STANZA_IQ_RESULT, gloox::STANZA_IQ_SET, and Tag::Tag(). |
|
Creates a new message stanza.
Definition at line 411 of file stanza.cpp. References Tag::addAttrib(), JID::full(), Stanza::Stanza(), gloox::STANZA_MESSAGE_CHAT, gloox::STANZA_MESSAGE_ERROR, gloox::STANZA_MESSAGE_GROUPCHAT, gloox::STANZA_MESSAGE_HEADLINE, gloox::STANZA_MESSAGE_NORMAL, Tag::Tag(), and Stanza::to(). |
|
Creates a new presence stanza.
Definition at line 373 of file stanza.cpp. References Tag::addAttrib(), Tag::addChild(), JID::empty(), JID::full(), gloox::PRESENCE_AWAY, gloox::PRESENCE_CHAT, gloox::PRESENCE_DND, gloox::PRESENCE_UNAVAILABLE, gloox::PRESENCE_XA, Stanza::Stanza(), Tag::Tag(), and Stanza::to(). |
|
Creates a new subscription stanza.
Definition at line 456 of file stanza.cpp. References Tag::addAttrib(), JID::full(), Stanza::Stanza(), gloox::STANZA_S10N_SUBSCRIBE, gloox::STANZA_S10N_SUBSCRIBED, gloox::STANZA_S10N_UNSUBSCRIBE, gloox::STANZA_S10N_UNSUBSCRIBED, Tag::Tag(), and Stanza::to(). |
|
Returnes the stanza error condition, if any.
Definition at line 143 of file stanza.h. Referenced by LastActivity::handleIqID(), and FlexibleOffline::handleIqID(). |
|
This function can be used to retrieve the application-specific error condition of a stanza error.
|
|
Returns the text of a error stanza for the given language if available. If the requested language is not available, the default text (without a xml:lang attribute) will be returned.
Definition at line 322 of file stanza.cpp. References Stanza::m_errorText. |
|
Use this function to parse the content of the Tag and determine type, etc. of the Stanza. This feels kind of hackish... You only need to call this if you are constructing a bare Stanza from scratch. Stanzas provided by gloox are fully parsed. |
|
Returns the JID the stanza comes from.
Definition at line 69 of file stanza.h. Referenced by LastActivity::handleIq(), Disco::handleIq(), LastActivity::handleIqID(), RosterManager::handlePresence(), and RosterManager::handleSubscription(). |
|
Returns the id of the stanza, if set.
Definition at line 81 of file stanza.h. Referenced by PrivacyManager::handleIq(), LastActivity::handleIq(), Disco::handleIq(), PrivateXML::handleIqID(), PrivacyManager::handleIqID(), and Disco::handleIqID(). |
|
Returns the presence 'show' type of a presence stanza.
Definition at line 93 of file stanza.h. Referenced by RosterManager::handlePresence(). |
|
Returns the status text of a presence stanza for the given language if available. If the requested language is not available, the default status text (without a xml:lang attribute) will be returned.
Definition at line 313 of file stanza.cpp. References Stanza::m_status. Referenced by RosterManager::handlePresence(), and RosterManager::handleSubscription(). |
|
Returns the subject of a message stanza for the given language if available. If the requested language is not available, the default subject (without a xml:lang attribute) will be returned.
Definition at line 304 of file stanza.cpp. References Stanza::m_subject. |
|
Returns the sub-type of the stanza.
Definition at line 63 of file stanza.h. Referenced by RosterManager::handleIq(), Registration::handleIq(), PrivacyManager::handleIq(), LastActivity::handleIq(), Disco::handleIq(), Registration::handleIqID(), PrivateXML::handleIqID(), PrivacyManager::handleIqID(), NonSaslAuth::handleIqID(), LastActivity::handleIqID(), FlexibleOffline::handleIqID(), Disco::handleIqID(), and RosterManager::handleSubscription(). |
|
Returns the thread ID of a message stanza.
|
|
Returns the receiver of the stanza.
Definition at line 75 of file stanza.h. Referenced by Stanza::createMessageStanza(), Stanza::createPresenceStanza(), and Stanza::createSubscriptionStanza(). |
|
Retrieves the value of the xml:lang attribute of this stanza. Default is 'en'. |
|
Returns the value of the xmlns attribute of the first child node.
Definition at line 87 of file stanza.h. Referenced by Disco::handleIq(). |