The main entry and exit point for XMPP stanzas between the network and the application. XmppClient actually manages several lower level objects, and is itself wrapped by XmppPump, which handles signing in to the server. Your application must create this object, or a wrapper object (XmppPump) explicitly. See Signing In to a Server.
Syntax
class XmppClient : public Task, public sigslot::has_slots<>
Methods
Name | Description |
---|---|
void AddXmppTask(XmppTask * task, XmppEngine::HandlerLevel level) | Adds a subtask to XmppClient. This happens under the hood in the XmppTask constructor, so if you extend XmppTask you should not need to call this method explicitly. |
XmppReturnStatus Connect(const XmppClientSettings &settings, AsyncSocket *socket, PreXmppAuth *preauth) | Handles signing in to a server. This method is called by XmppPump::DoLogin.
|
XmppReturnStatus Disconnect() | Signs off from the server. |
XmppEngine* engine() | Returns the internal XmppEngine class that handles many of the tasks. You should not need to call this. |
void EnsureClosed() | Internal helper function. You should not need to call this. |
std::string GetAuthCookie() | Internal helper function. You should not need to call this. |
CaptchaChallenge GetCaptchaChallenge() | Internal helper function. You should not need to call this. |
XmppEngine::Error GetError() | Retrieves the last error thrown by XmppClient. You can query this if SignalStateChange logs out unexpectedly. |
Task* GetParent(int code) | No description available.You should not need to call this. |
XmppEngine::State GetState() | No description available.You should not need to call this. |
Jid& jid() | Returns the full JID of the current user. Call this after signing in to a server. |
std::string NextId() | Internal helper function. You should not need to call this. |
void OnAuthDone() | Internal helper function. You should not need to call this. |
int Process(int state) | Internal helper function. You should not need to call this. |
int ProcessCookieLogin() | Internal helper function. You should not need to call this. |
int ProcessResponse() | Internal helper function. You should not need to call this. |
int ProcessStart() | Internal helper function. You should not need to call this. |
int ProcessStartXmppLogin() | Internal helper function. You should not need to call this. |
void RemoveXmppTask(XmppTask *task) | Removes a subtask added using AddXmppTask. |
XmppReturnStatus SendRaw(const std::string &text) | Sends a raw text string to the server (not wrapped in a stanza). |
XmppReturnStatus SendStanza(const XmlElement *stanza) | Sends a stanza to the network. |
XmppReturnStatus SendStanzaError(const XmlElement *pelOriginal, XmppStanzaError code, const std::string &text) | Sends an error description for a malformed stanza received by the server. |
XmppClient(Task *parent) | Constructor. parent is the managing object for the XMPP Messaging Component. |
~XmppClient | Destructor. |
std::string GetStateName(int state) const | Returns a string version of a Task object state, usually for logging purposes. You should not need to call this. |
Signals
- SignalStateChange< XmppEngine::State >
- Sends notifications about the progress of the sign in attempt to the server.
- SignalLogInput< const char *, int >
- Sent with a copy of an incoming XMPP stanza when it arrives from the network. See pcp_main.cc for an example of how to trap and display these stanzas.
- SignalLogOutput< const char *, int >
- Sent with a copy of an outgoing XMPP stanza when it is sent to the network. See pcp_main.cc for an example of how to trap and display these stanzas.
- SignalDisconnected
- Sent when XMPP signs off from the server.
Friends
Attributes: public
Declaration file: talk/xmpp/xmppclient.h