00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00281 #ifndef GLOOX_H__
00282 #define GLOOX_H__
00283
00284 #include "macros.h"
00285
00286 #include <string>
00287 #include <list>
00288 #include <map>
00289
00296 namespace gloox
00297 {
00298
00299 const std::string XMLNS_CLIENT = "jabber:client";
00300 const std::string XMLNS_COMPONENT_ACCEPT = "jabber:component:accept";
00301 const std::string XMLNS_COMPONENT_CONNECT = "jabber:component:connect";
00302
00303 const std::string XMLNS_DISCO_INFO = "http://jabber.org/protocol/disco#info";
00304 const std::string XMLNS_DISCO_ITEMS = "http://jabber.org/protocol/disco#items";
00305 const std::string XMLNS_ADHOC_COMMANDS = "http://jabber.org/protocol/commands";
00306 const std::string XMLNS_COMPRESSION = "http://jabber.org/protocol/compress";
00307 const std::string XMLNS_OFFLINE = "http://jabber.org/protocol/offline";
00308 const std::string XMLNS_CHAT_STATES = "http://jabber.org/protocol/chatstates";
00309 const std::string XMLNS_AMP = "http://jabber.org/protocol/amp";
00310 const std::string XMLNS_IBB = "http://jabber.org/protocol/ibb";
00311 const std::string XMLNS_CHATNEG = "http://jabber.org/protocol/chatneg";
00312 const std::string XMLNS_XHTML_IM = "http://jabber.org/protocol/xhtml-im";
00313 const std::string XMLNS_ROSTER = "jabber:iq:roster";
00314 const std::string XMLNS_VERSION = "jabber:iq:version";
00315 const std::string XMLNS_REGISTER = "jabber:iq:register";
00316 const std::string XMLNS_PRIVACY = "jabber:iq:privacy";
00317 const std::string XMLNS_AUTH = "jabber:iq:auth";
00318 const std::string XMLNS_PRIVATE_XML = "jabber:iq:private";
00319 const std::string XMLNS_LAST = "jabber:iq:last";
00320 const std::string XMLNS_SEARCH = "jabber:iq:search";
00321 const std::string XMLNS_X_DATA = "jabber:x:data";
00322 const std::string XMLNS_X_EVENT = "jabber:x:event";
00323 const std::string XMLNS_X_OOB = "jabber:x:oob";
00324 const std::string XMLNS_VCARD_TEMP = "vcard-temp";
00325 const std::string XMLNS_BOOKMARKS = "storage:bookmarks";
00326 const std::string XMLNS_ANNOTATIONS = "storage:rosternotes";
00327 const std::string XMLNS_ROSTER_DELIMITER = "roster:delimiter";
00328
00329 const std::string XMLNS_XMPP_STREAM = "urn:ietf:params:xml:ns:xmpp-streams";
00330 const std::string XMLNS_XMPP_STANZAS = "urn:ietf:params:xml:ns:xmpp-stanzas";
00331 const std::string XMLNS_STREAM_TLS = "urn:ietf:params:xml:ns:xmpp-tls";
00332 const std::string XMLNS_STREAM_SASL = "urn:ietf:params:xml:ns:xmpp-sasl";
00333 const std::string XMLNS_STREAM_BIND = "urn:ietf:params:xml:ns:xmpp-bind";
00334 const std::string XMLNS_STREAM_SESSION = "urn:ietf:params:xml:ns:xmpp-session";
00335 const std::string XMLNS_STREAM_IQAUTH = "http://jabber.org/features/iq-auth";
00336 const std::string XMLNS_STREAM_IQREGISTER = "http://jabber.org/features/iq-register";
00337 const std::string XMLNS_STREAM_ACK = "http://jabber.org/features/ack";
00338 const std::string XMLNS_STREAM_COMPRESS = "http://jabber.org/features/compress";
00339
00340 const int XMPP_STREAM_VERSION_MAJOR = 1;
00341 const int XMPP_STREAM_VERSION_MINOR = 0;
00342 const std::string GLOOX_VERSION = "0.8.8-sic";
00343
00347 enum ConnectionState
00348 {
00349 StateDisconnected,
00350 StateConnecting,
00351 StateConnected
00353 };
00354
00358 enum ConnectionError
00359 {
00360 ConnNoError,
00361 ConnStreamError,
00362 ConnStreamClosed,
00363 ConnIoError,
00364 ConnOutOfMemory,
00365 ConnNoSupportedAuth,
00367 ConnTlsFailed,
00368 ConnAuthenticationFailed,
00370 ConnUserDisconnected,
00371 ConnNotConnected
00372 };
00373
00377 enum StreamFeature
00378 {
00379 StreamFeatureBind = 1,
00380 StreamFeatureSession = 2,
00381 StreamFeatureSaslDigestMd5 = 4,
00382 StreamFeatureSaslPlain = 8,
00383 StreamFeatureSaslAnonymous = 16,
00384 StreamFeatureSaslExternal = 32,
00385 StreamFeatureStartTls = 64,
00386 StreamFeatureIqRegister = 128,
00388 StreamFeatureIqAuth = 256,
00390 StreamFeatureAck = 512,
00391 StreamFeatureCompressZlib = 1024,
00393 StreamFeatureCompressDclz = 2048
00395 };
00396
00400 enum StreamError
00401 {
00402 StreamErrorUndefined,
00405 StreamErrorBadFormat,
00411 StreamErrorBadNamespacePrefix,
00414 StreamErrorConflict,
00417 StreamErrorConnectionTimeout,
00419 StreamErrorHostGone,
00422 StreamErrorHostUnknown,
00425 StreamErrorImproperAddressing,
00427 StreamErrorInternalServerError,
00430 StreamErrorInvalidFrom,
00434 StreamErrorInvalidId,
00436 StreamErrorInvalidNamespace,
00440 StreamErrorInvalidXml,
00442 StreamErrorNotAuthorized,
00446 StreamErrorPolicyViolation,
00449 StreamErrorRemoteConnectionFailed,
00451 StreamErrorResourceConstraint,
00453 StreamErrorRestrictedXml,
00456 StreamErrorSeeOtherHost,
00461 StreamErrorSystemShutdown,
00463 StreamErrorUndefinedCondition,
00466 StreamErrorUnsupportedEncoding,
00468 StreamErrorUnsupportedStanzaType,
00470 StreamErrorUnsupportedVersion,
00474 StreamErrorXmlNotWellFormed
00476 };
00477
00481 enum StanzaType
00482 {
00483 StanzaUndefined,
00484 StanzaIq,
00485 StanzaMessage,
00486 StanzaS10n,
00487 StanzaPresence
00488 };
00489
00493 enum StanzaSubType
00494 {
00495 StanzaSubUndefined,
00496 StanzaIqGet,
00497 StanzaIqSet,
00501 StanzaIqResult,
00502 StanzaIqError,
00507 StanzaPresenceUnavailable,
00511 StanzaPresenceAvailable,
00515 StanzaPresenceProbe,
00519 StanzaPresenceError,
00523 StanzaS10nSubscribe,
00527 StanzaS10nSubscribed,
00531 StanzaS10nUnsubscribe,
00535 StanzaS10nUnsubscribed,
00539 StanzaMessageChat,
00545 StanzaMessageError,
00551 StanzaMessageGroupchat,
00559 StanzaMessageHeadline,
00568 StanzaMessageNormal
00575 };
00576
00580 enum StanzaErrorType
00581 {
00582 StanzaErrorTypeUndefined,
00583 StanzaErrorTypeCancel,
00584 StanzaErrorTypeContinue,
00585 StanzaErrorTypeModify,
00586 StanzaErrorTypeAuth,
00587 StanzaErrorTypeWait
00588 };
00589
00593 enum StanzaError
00594 {
00595 StanzaErrorUndefined = 0,
00596 StanzaErrorBadRequest,
00600 StanzaErrorConflict,
00603 StanzaErrorFeatureNotImplemented,
00606 StanzaErrorForbidden,
00608 StanzaErrorGone,
00612 StanzaErrorInternalServerError,
00615 StanzaErrorItemNotFound,
00617 StanzaErrorJidMalformed,
00622 StanzaErrorNotAcceptable,
00626 StanzaErrorNotAllowed,
00628 StanzaErrorNotAuthorized,
00631 StanzaErrorPaymentRequired,
00634 StanzaErrorRecipientUnavailable,
00639 StanzaErrorRedirect,
00644 StanzaErrorRegistrationRequired,
00647 StanzaErrorRemoteServerNotFound,
00650 StanzaErrorRemoteServerTimeout,
00654 StanzaErrorResourceConstraint,
00656 StanzaErrorServiceUnavailable,
00658 StanzaErrorSubscribtionRequired,
00661 StanzaErrorUndefinedCondition,
00665 StanzaErrorUnexpectedRequest
00668 };
00669
00673 enum Presence
00674 {
00675 PresenceUnknown,
00676 PresenceAvailable,
00677 PresenceChat,
00678 PresenceAway,
00679 PresenceDnd,
00680 PresenceXa,
00682 PresenceUnavailable
00683 };
00684
00688 enum CertStatus
00689 {
00690 CertOk = 0,
00691 CertInvalid = 1,
00692 CertSignerUnknown = 2,
00693 CertRevoked = 4,
00694 CertExpired = 8,
00695 CertNotActive = 16,
00696 CertWrongPeer = 32,
00698 CertSignerNotCa = 64
00699 };
00700
00704 struct CertInfo
00705 {
00706 int status;
00707 bool chain;
00708 std::string issuer;
00709 std::string server;
00710 int date_from;
00711 int date_to;
00712 std::string protocol;
00713 std::string cipher;
00714 std::string mac;
00715 std::string compression;
00716 };
00717
00721 enum AuthenticationError
00722 {
00723 AuthErrorUndefined,
00724 SaslAborted,
00727 SaslIncorrectEncoding,
00732 SaslInvalidAuthzid,
00737 SaslInvalidMechanism,
00740 SaslMechanismTooWeak,
00744 SaslNotAuthorized,
00748 SaslTemporaryAuthFailure,
00751 NonSaslConflict,
00752 NonSaslNotAcceptable,
00753 NonSaslNotAuthorized
00754 };
00755
00759 enum LogArea
00760 {
00761 LogAreaClassParser = 0x00001,
00762 LogAreaClassConnection = 0x00002,
00763 LogAreaClassClient = 0x00004,
00764 LogAreaClassClientbase = 0x00008,
00765 LogAreaClassComponent = 0x00010,
00766 LogAreaClassDns = 0x00020,
00767 LogAreaAllClasses = 0x01FFF,
00768 LogAreaXmlIncoming = 0x02000,
00769 LogAreaXmlOutgoing = 0x04000,
00770 LogAreaUser = 0x80000,
00771 LogAreaAll = 0xFFFFF
00772 };
00773
00777 enum LogLevel
00778 {
00779 LogLevelDebug,
00780 LogLevelWarning,
00781 LogLevelError
00782 };
00783
00787 enum MessageEventType
00788 {
00789 MessageEventCancel = 0,
00790 MessageEventOffline = 1,
00792 MessageEventDelivered = 2,
00794 MessageEventDisplayed = 4,
00795 MessageEventComposing = 8
00796 };
00797
00801 enum ChatStateType
00802 {
00803 ChatStateActive = 1,
00804 ChatStateComposing = 2,
00805 ChatStatePaused = 4,
00806 ChatStateInactive = 8,
00807 ChatStateGone = 16
00809 };
00810
00814 enum ResourceBindError
00815 {
00816 RbErrorUnknownError,
00817 RbErrorBadRequest,
00818 RbErrorNotAllowed,
00819 RbErrorConflict
00820 };
00821
00825 enum SessionCreateError
00826 {
00827 ScErrorUnknownError,
00828 ScErrorInternalServerError,
00829 ScErrorForbidden,
00830 ScErrorConflict
00832 };
00833
00837 enum MessageSessionFilter
00838 {
00839 FilterMessageEvents = 1,
00840 FilterChatStates = 2
00841 };
00842
00846 typedef std::list<std::string> StringList;
00847
00851 typedef std::map<std::string, std::string> StringMap;
00852
00853 }
00854
00855 extern "C"
00856 {
00857 const char* gloox_version();
00858 }
00859
00860 #endif // GLOOX_H__