📄 gloox.h
字号:
* @li XEP-0066 @link gloox::OOB Out of Band Data @endlink * @li XEP-0077 @link gloox::Registration In-Band Registration @endlink * @li XEP-0078 Non-SASL Authentication (automatically used if the server does not support SASL) * @li XEP-0083 Nested Roster Groups (automatically used if supported by the server. see * @link gloox::RosterManager::delimiter() RosterManager @endlink) * @li XEP-0085 Chat State Notifications (see @link gloox::MessageSession MessageSession @endlink for * examples) * @li XEP-0091 @link gloox::XDelayedDelivery Delayed Delivery @endlink (old spec) * @li XEP-0092 Software Version (integrated into @link gloox::Disco Service Discovery @endlink) * @li XEP-0095 @link gloox::SIManager Stream Initiation @endlink, used with @ref filetransfer_sec * @li XEP-0096 @ref filetransfer_sec * @li XEP-0114 @link gloox::Component Jabber Component Protocol @endlink * @li XEP-0138 Stream Compression (used automatically if gloox is compiled with zlib and if the server * supports it) * @li XEP-0145 @link gloox::Annotations Annotations @endlink * @li XEP-0153 @link gloox::VCardUpdate vCard-based Avatars @endlink * @li XEP-0203 @link gloox::DelayedDelivery Delayed Delivery @endlink (new spec) * @section filetransfer_sec File Transfer * * For file transfer, gloox implements XEP-0095 (Stream Initiation) as well XEP-0096 (File Transfer) * for the signalling, and XEP-0065 (SOCKS5 Bytestreams) for the transport. See * @link gloox::SIProfileFT SIProfileFT @endlink. * * Additionally, there is an implementation of XEP-0047 (In-Band Bytestreams) which is currently not * integrated into the signalling of XEPs 0095 and 0096. Therefore, this protocol is probably not * suited for offering file transfer to end-users. * See @link gloox::InBandBytestreamManager InBandBytestreamManager @endlink. * * @section proxy_sec HTTP and SOCKS5 Proxy support * * gloox is capable of traversing HTTP as well as SOCKS5 proxies, even chained. See * @link gloox::ConnectionHTTPProxy ConnectionHTTPProxy @endlink and * @link gloox::ConnectionSOCKS5Proxy ConnectionSOCKS5Proxy @endlink. */#ifndef GLOOX_H__#define GLOOX_H__#include "macros.h"#include <string>#include <list>#include <map>/** * @brief The namespace for the gloox library. * * @author Jakob Schroeter <js@camaya.net> * @since 0.3 */namespace gloox{ /** Client namespace (RFC 3920)*/ GLOOX_API extern const std::string XMLNS_CLIENT; /** Component Accept namespace (XEP-0114) */ GLOOX_API extern const std::string XMLNS_COMPONENT_ACCEPT; /** Component Connect namespace (XEP-0114) */ GLOOX_API extern const std::string XMLNS_COMPONENT_CONNECT; /** Service Discovery Info namespace (XEP-0030) */ GLOOX_API extern const std::string XMLNS_DISCO_INFO; /** Service Discovery Items namespace (XEP-0030) */ GLOOX_API extern const std::string XMLNS_DISCO_ITEMS; /** Adhoc Commands namespace (XEP-0050) */ GLOOX_API extern const std::string XMLNS_ADHOC_COMMANDS; /** Stream Compression namespace (XEP-0138) */ GLOOX_API extern const std::string XMLNS_COMPRESSION; /** Flexible Offline Message Retrieval (XEP-0013) */ GLOOX_API extern const std::string XMLNS_OFFLINE; /** Chat State Notifications namespace (XEP-0085) */ GLOOX_API extern const std::string XMLNS_CHAT_STATES; /** Advanced Message Processing (XEP-0079) */ GLOOX_API extern const std::string XMLNS_AMP; /** In-Band Bytestreams namespace (XEP-0047) */ GLOOX_API extern const std::string XMLNS_IBB; /** Feature Negotiation namespace (XEP-0020) */ GLOOX_API extern const std::string XMLNS_FEATURE_NEG; /** Chat Session Negotiation namespace (XEP-0155) */ GLOOX_API extern const std::string XMLNS_CHATNEG; /** XHTML-IM namespace (XEP-0071) */ GLOOX_API extern const std::string XMLNS_XHTML_IM; /** Delayed Delivery namespace (XEP-0203) */ GLOOX_API extern const std::string XMLNS_DELAY; /** Roster namespace (RFC 3921) */ GLOOX_API extern const std::string XMLNS_ROSTER; /** Software Version namespace (XEP-0092) */ GLOOX_API extern const std::string XMLNS_VERSION; /** In-Band Registration namespace (XEP-0077) */ GLOOX_API extern const std::string XMLNS_REGISTER; /** Privacy lists namespace (RFC 3921) */ GLOOX_API extern const std::string XMLNS_PRIVACY; /** Non-SASL Authentication namespace (XEP-0078) */ GLOOX_API extern const std::string XMLNS_AUTH; /** Private XML Storage namespace (XEP-0049) */ GLOOX_API extern const std::string XMLNS_PRIVATE_XML; /** Last Activity namespace (XEP-0012) */ GLOOX_API extern const std::string XMLNS_LAST; /** Jabber Search namespace (XEP-0055) */ GLOOX_API extern const std::string XMLNS_SEARCH; /** Out of Band Data (IQ) namespace (XEP-0066) */ GLOOX_API extern const std::string XMLNS_IQ_OOB; /** Data Forms namespace (XEP-0004) */ GLOOX_API extern const std::string XMLNS_X_DATA; /** Message Events (XEP-0022) */ GLOOX_API extern const std::string XMLNS_X_EVENT; /** Out of Band Data (X) namespace (XEP-0066) */ GLOOX_API extern const std::string XMLNS_X_OOB; /** Delayed Delivery namespace (XEP-0091) */ GLOOX_API extern const std::string XMLNS_X_DELAY; /** Current Jabber OpenPGP Usage (Sign.) (XEP-0027) */ GLOOX_API extern const std::string XMLNS_X_GPGSIGNED; /** Current Jabber OpenPGP Usage (Enc.) (XEP-0027) */ GLOOX_API extern const std::string XMLNS_X_GPGENCRYPTED; /** vcard-temp namespace (XEP-0054) */ GLOOX_API extern const std::string XMLNS_VCARD_TEMP; /** vCard-Based Avatars namespace (XEP-0153) */ GLOOX_API extern const std::string XMLNS_X_VCARD_UPDATE; /** Bookmark Storage namespace (XEP-0048) */ GLOOX_API extern const std::string XMLNS_BOOKMARKS; /** Annotations namespace (XEP-0145) */ GLOOX_API extern const std::string XMLNS_ANNOTATIONS; /** Nested Roster Groups namespace (XEP-0083) */ GLOOX_API extern const std::string XMLNS_ROSTER_DELIMITER; /** XMPP Ping namespace (XEP-0199) */ GLOOX_API extern const std::string XMLNS_XMPP_PING; /** Stream Initiation namespace (XEP-0095) */ GLOOX_API extern const std::string XMLNS_SI; /** File transfer profile of Stream Initiation (XEP-0096) */ GLOOX_API extern const std::string XMLNS_SI_FT; /** SOCKS5 Bytestreams namespace (XEP-0065) */ GLOOX_API extern const std::string XMLNS_BYTESTREAMS; /** Multi-User Chat namespace (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC; /** Multi-User Chat namespace (user) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_USER; /** Multi-User Chat namespace (admin) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_ADMIN; /** Multi-User Chat namespace (unique) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_UNIQUE; /** Multi-User Chat namespace (owner) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_OWNER; /** Multi-User Chat namespace (roominfo) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_ROOMINFO; /** Multi-User Chat namespace (rooms) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_ROOMS; /** Multi-User Chat namespace (request) (XEP-0045) */ GLOOX_API extern const std::string XMLNS_MUC_REQUEST; /** XMPP stream namespace (RFC 3920) */ GLOOX_API extern const std::string XMLNS_XMPP_STREAM; /** XMPP stanzas namespace (RFC 3920) */ GLOOX_API extern const std::string XMLNS_XMPP_STANZAS; /** TLS Stream Feature namespace (RFC 3920) */ GLOOX_API extern const std::string XMLNS_STREAM_TLS; /** SASL Stream Feature namespace (RFC 3920) */ GLOOX_API extern const std::string XMLNS_STREAM_SASL; /** Resource Bind Stream Feature (RFC 3921) */ GLOOX_API extern const std::string XMLNS_STREAM_BIND; /** Session Create Stream Feature (RFC 3921) */ GLOOX_API extern const std::string XMLNS_STREAM_SESSION; /** Non-SASL Auth. Stream Feature (XEP-0078) */ GLOOX_API extern const std::string XMLNS_STREAM_IQAUTH; /** In-Band Registration namespace (XEP-0077) */ GLOOX_API extern const std::string XMLNS_STREAM_IQREGISTER; /** Stream Compression Feature namespace (XEP-0138) */ GLOOX_API extern const std::string XMLNS_STREAM_COMPRESS; /** Supported stream version (major). */ GLOOX_API extern const std::string XMPP_STREAM_VERSION_MAJOR; /** Supported stream version (minor). */ GLOOX_API extern const std::string XMPP_STREAM_VERSION_MINOR; /** gloox version */ GLOOX_API extern const std::string GLOOX_VERSION; /** * This describes the possible states of a stream. */ enum ConnectionState { StateDisconnected, /**< The client is in disconnected state. */ StateConnecting, /**< The client is currently trying to establish a connection. */ StateConnected /**< The client is connected to the server but authentication is not * (yet) done. */ }; /** * Describes stream events that get emitted by means of ConnectionListener::onStreamEvent(). * @since 0.9 */ enum StreamEvent { StreamEventConnecting, /**< The Client is about to initaite the connection. */ StreamEventEncryption, /**< The Client is about to negotiate encryption. */ StreamEventCompression, /**< The Client is about to negotiate compression. */ StreamEventAuthentication, /**< The Client is about to authenticate. */ StreamEventSessionInit, /**< The Client is about to create a session. */ StreamEventResourceBinding, /**< The Client is about to bind a resource to the stream. */ StreamEventSessionCreation, /**< The Client is about to create a session. * @since 0.9.1 */ StreamEventRoster, /**< The Client is about to request the roster. */ StreamEventFinished /**< The log-in phase is completed. */ }; /** * This describes connection error conditions. */ enum ConnectionError { ConnNoError, /**< Not really an error. Everything went just fine. */ ConnStreamError, /**< A stream error occured. The stream has been closed. * Use ClientBase::streamError() to find the reason. */ ConnStreamVersionError, /**< The incoming stream's version is not supported */ ConnStreamClosed, /**< The stream has been closed (by the server). */ ConnProxyAuthRequired, /**< The HTTP/SOCKS5 proxy requires authentication. * @since 0.9 */ ConnProxyAuthFailed, /**< HTTP/SOCKS5 proxy authentication failed. * @since 0.9 */ ConnProxyNoSupportedAuth, /**< The HTTP/SOCKS5 proxy requires an unsupported auth mechanism. * @since 0.9 */ ConnIoError, /**< An I/O error occured. */ ConnParseError, /**< An XML parse error occurred. */ ConnConnectionRefused, /**< The connection was refused by the server (on the socket level). * @since 0.9 */ ConnDnsError, /**< Resolving the server's hostname failed. * @since 0.9 */ ConnOutOfMemory, /**< Out of memory. Uhoh. */ ConnNoSupportedAuth, /**< The auth mechanisms the server offers are not supported * or the server offered no auth mechanisms at all. */ ConnTlsFailed, /**< The server's certificate could not be verified or the TLS * handshake did not complete successfully. */ ConnTlsNotAvailable, /**< The server didn't offer TLS while it was set to be required * or TLS was not compiled in. * @since 0.9.4 */ ConnCompressionFailed, /**< Negotiating/initializing compression failed. * @since 0.9 */ ConnAuthenticationFailed, /**< Authentication failed. Username/password wrong or account does
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -