00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00345 #ifndef GLOOX_H__
00346 #define GLOOX_H__
00347
00348 #include "macros.h"
00349
00350 #include <string>
00351 #include <list>
00352 #include <map>
00353
00360 namespace gloox
00361 {
00363 GLOOX_API extern const std::string XMLNS_CLIENT;
00364
00366 GLOOX_API extern const std::string XMLNS_COMPONENT_ACCEPT;
00367
00369 GLOOX_API extern const std::string XMLNS_COMPONENT_CONNECT;
00370
00372 GLOOX_API extern const std::string XMLNS_DISCO_INFO;
00373
00375 GLOOX_API extern const std::string XMLNS_DISCO_ITEMS;
00376
00378 GLOOX_API extern const std::string XMLNS_DISCO_PUBLISH;
00379
00381 GLOOX_API extern const std::string XMLNS_ADHOC_COMMANDS;
00382
00384 GLOOX_API extern const std::string XMLNS_COMPRESSION;
00385
00387 GLOOX_API extern const std::string XMLNS_OFFLINE;
00388
00390 GLOOX_API extern const std::string XMLNS_CHAT_STATES;
00391
00393 GLOOX_API extern const std::string XMLNS_AMP;
00394
00396 GLOOX_API extern const std::string XMLNS_IBB;
00397
00399 GLOOX_API extern const std::string XMLNS_FEATURE_NEG;
00400
00402 GLOOX_API extern const std::string XMLNS_CHATNEG;
00403
00405 GLOOX_API extern const std::string XMLNS_XHTML_IM;
00406
00408 GLOOX_API extern const std::string XMLNS_DELAY;
00409
00411 GLOOX_API extern const std::string XMLNS_ROSTER;
00412
00414 GLOOX_API extern const std::string XMLNS_VERSION;
00415
00417 GLOOX_API extern const std::string XMLNS_REGISTER;
00418
00420 GLOOX_API extern const std::string XMLNS_PRIVACY;
00421
00423 GLOOX_API extern const std::string XMLNS_AUTH;
00424
00426 GLOOX_API extern const std::string XMLNS_PRIVATE_XML;
00427
00429 GLOOX_API extern const std::string XMLNS_LAST;
00430
00432 GLOOX_API extern const std::string XMLNS_SEARCH;
00433
00435 GLOOX_API extern const std::string XMLNS_IQ_OOB;
00436
00438 GLOOX_API extern const std::string XMLNS_X_DATA;
00439
00441 GLOOX_API extern const std::string XMLNS_X_EVENT;
00442
00444 GLOOX_API extern const std::string XMLNS_X_OOB;
00445
00447 GLOOX_API extern const std::string XMLNS_X_DELAY;
00448
00450 GLOOX_API extern const std::string XMLNS_X_GPGSIGNED;
00451
00453 GLOOX_API extern const std::string XMLNS_X_GPGENCRYPTED;
00454
00456 GLOOX_API extern const std::string XMLNS_VCARD_TEMP;
00457
00459 GLOOX_API extern const std::string XMLNS_X_VCARD_UPDATE;
00460
00462 GLOOX_API extern const std::string XMLNS_BOOKMARKS;
00463
00465 GLOOX_API extern const std::string XMLNS_ANNOTATIONS;
00466
00468 GLOOX_API extern const std::string XMLNS_ROSTER_DELIMITER;
00469
00471 GLOOX_API extern const std::string XMLNS_XMPP_PING;
00472
00474 GLOOX_API extern const std::string XMLNS_SI;
00475
00477 GLOOX_API extern const std::string XMLNS_SI_FT;
00478
00480 GLOOX_API extern const std::string XMLNS_BYTESTREAMS;
00481
00483 GLOOX_API extern const std::string XMLNS_MUC;
00484
00486 GLOOX_API extern const std::string XMLNS_MUC_USER;
00487
00489 GLOOX_API extern const std::string XMLNS_MUC_ADMIN;
00490
00492 GLOOX_API extern const std::string XMLNS_MUC_UNIQUE;
00493
00495 GLOOX_API extern const std::string XMLNS_MUC_OWNER;
00496
00498 GLOOX_API extern const std::string XMLNS_MUC_ROOMINFO;
00499
00501 GLOOX_API extern const std::string XMLNS_MUC_ROOMS;
00502
00504 GLOOX_API extern const std::string XMLNS_MUC_REQUEST;
00505
00507 GLOOX_API extern const std::string XMLNS_PUBSUB;
00508
00510 GLOOX_API extern const std::string XMLNS_PUBSUB_ERRORS;
00511
00513 GLOOX_API extern const std::string XMLNS_PUBSUB_EVENT;
00514
00516 GLOOX_API extern const std::string XMLNS_PUBSUB_OWNER;
00517
00519 GLOOX_API extern const std::string XMLNS_CAPS;
00520
00522 GLOOX_API extern const std::string XMLNS_FT_FASTMODE;
00523
00525 GLOOX_API extern const std::string XMLNS_STREAM;
00526
00528 GLOOX_API extern const std::string XMLNS_XMPP_STREAM;
00529
00531 GLOOX_API extern const std::string XMLNS_XMPP_STANZAS;
00532
00534 GLOOX_API extern const std::string XMLNS_STREAM_TLS;
00535
00537 GLOOX_API extern const std::string XMLNS_STREAM_SASL;
00538
00540 GLOOX_API extern const std::string XMLNS_STREAM_BIND;
00541
00543 GLOOX_API extern const std::string XMLNS_STREAM_SESSION;
00544
00546 GLOOX_API extern const std::string XMLNS_STREAM_IQAUTH;
00547
00549 GLOOX_API extern const std::string XMLNS_STREAM_IQREGISTER;
00550
00552 GLOOX_API extern const std::string XMLNS_STREAM_COMPRESS;
00553
00555 GLOOX_API extern const std::string XMLNS_HTTPBIND;
00556
00558 GLOOX_API extern const std::string XMLNS_XMPP_BOSH;
00559
00561 GLOOX_API extern const std::string XMLNS_RECEIPTS;
00562
00564 GLOOX_API extern const std::string XMLNS_NICKNAME;
00565
00567 GLOOX_API extern const std::string XMLNS_JINGLE;
00568
00570 GLOOX_API extern const std::string XMLNS_JINGLE_AUDIO_RTP;
00571
00573 GLOOX_API extern const std::string XMLNS_JINGLE_ICE_UDP;
00574
00576 GLOOX_API extern const std::string XMLNS_JINGLE_RAW_UDP;
00577
00579 GLOOX_API extern const std::string XMLNS_JINGLE_VIDEO_RTP;
00580
00582 GLOOX_API extern const std::string XMLNS_SHIM;
00583
00585 GLOOX_API extern const std::string XMLNS_ATTENTION;
00586
00587
00589 GLOOX_API extern const std::string XMPP_STREAM_VERSION_MAJOR;
00590
00592 GLOOX_API extern const std::string XMPP_STREAM_VERSION_MINOR;
00593
00595 GLOOX_API extern const std::string GLOOX_VERSION;
00596
00598 GLOOX_API extern const std::string GLOOX_CAPS_NODE;
00599
00601 GLOOX_API extern const std::string XMLNS;
00602
00604 GLOOX_API extern const std::string TYPE;
00605
00607 GLOOX_API extern const std::string EmptyString;
00608
00612 enum ConnectionState
00613 {
00614 StateDisconnected,
00615 StateConnecting,
00616 StateConnected
00618 };
00619
00624 enum StreamEvent
00625 {
00626 StreamEventConnecting,
00627 StreamEventEncryption,
00628 StreamEventCompression,
00629 StreamEventAuthentication,
00630 StreamEventSessionInit,
00631 StreamEventResourceBinding,
00632 StreamEventSessionCreation,
00634 StreamEventRoster,
00635 StreamEventFinished
00636 };
00637
00641 enum ConnectionError
00642 {
00643 ConnNoError,
00644 ConnStreamError,
00646 ConnStreamVersionError,
00647 ConnStreamClosed,
00648 ConnProxyAuthRequired,
00650 ConnProxyAuthFailed,
00652 ConnProxyNoSupportedAuth,
00654 ConnIoError,
00655 ConnParseError,
00656 ConnConnectionRefused,
00658 ConnDnsError,
00660 ConnOutOfMemory,
00661 ConnNoSupportedAuth,
00663 ConnTlsFailed,
00665 ConnTlsNotAvailable,
00668 ConnCompressionFailed,
00670 ConnAuthenticationFailed,
00672 ConnUserDisconnected,
00673 ConnNotConnected
00674 };
00675
00679 enum TLSPolicy
00680 {
00681 TLSDisabled,
00682 TLSOptional,
00683 TLSRequired
00686 };
00687
00691 enum StreamFeature
00692 {
00693 StreamFeatureBind = 1,
00694 StreamFeatureUnbind = 2,
00695 StreamFeatureSession = 4,
00696 StreamFeatureStartTls = 8,
00697 StreamFeatureIqRegister = 16,
00699 StreamFeatureIqAuth = 32,
00701 StreamFeatureCompressZlib = 64,
00703 StreamFeatureCompressDclz = 128
00705
00706 };
00707
00711
00712 enum SaslMechanism
00713 {
00714 SaslMechNone = 0,
00715 SaslMechDigestMd5 = 256,
00716 SaslMechPlain = 512,
00717 SaslMechAnonymous = 1024,
00719 SaslMechExternal = 2048,
00720 SaslMechGssapi = 4096,
00721 SaslMechNTLM = 8192,
00722 SaslMechAll = 65535
00723 };
00724
00728 enum StreamError
00729 {
00730 StreamErrorBadFormat,
00736 StreamErrorBadNamespacePrefix,
00739 StreamErrorConflict,
00742 StreamErrorConnectionTimeout,
00744 StreamErrorHostGone,
00747 StreamErrorHostUnknown,
00750 StreamErrorImproperAddressing,
00752 StreamErrorInternalServerError,
00755 StreamErrorInvalidFrom,
00759 StreamErrorInvalidId,
00761 StreamErrorInvalidNamespace,
00765 StreamErrorInvalidXml,
00767 StreamErrorNotAuthorized,
00771 StreamErrorPolicyViolation,
00774 StreamErrorRemoteConnectionFailed,
00776 StreamErrorResourceConstraint,
00778 StreamErrorRestrictedXml,
00781 StreamErrorSeeOtherHost,
00786 StreamErrorSystemShutdown,
00788 StreamErrorUndefinedCondition,
00791 StreamErrorUnsupportedEncoding,
00794 StreamErrorUnsupportedStanzaType,
00796 StreamErrorUnsupportedVersion,
00800 StreamErrorXmlNotWellFormed,
00802 StreamErrorUndefined
00805 };
00806
00810 enum StanzaErrorType
00811 {
00812 StanzaErrorTypeAuth,
00813 StanzaErrorTypeCancel,
00814 StanzaErrorTypeContinue,
00815 StanzaErrorTypeModify,
00817 StanzaErrorTypeWait,
00818 StanzaErrorTypeUndefined
00819 };
00820
00825 enum StanzaError
00826 {
00827
00828 StanzaErrorBadRequest,
00832 StanzaErrorConflict,
00835 StanzaErrorFeatureNotImplemented,
00838 StanzaErrorForbidden,
00840 StanzaErrorGone,
00844 StanzaErrorInternalServerError,
00847 StanzaErrorItemNotFound,
00849 StanzaErrorJidMalformed,
00854 StanzaErrorNotAcceptable,
00858 StanzaErrorNotAllowed,
00860 StanzaErrorNotAuthorized,
00863 StanzaErrorNotModified,
00865 StanzaErrorPaymentRequired,
00868 StanzaErrorRecipientUnavailable,
00873 StanzaErrorRedirect,
00878 StanzaErrorRegistrationRequired,
00881 StanzaErrorRemoteServerNotFound,
00884 StanzaErrorRemoteServerTimeout,
00888 StanzaErrorResourceConstraint,
00890 StanzaErrorServiceUnavailable,
00892 StanzaErrorSubscribtionRequired,
00895 StanzaErrorUndefinedCondition,
00899 StanzaErrorUnexpectedRequest,
00902 StanzaErrorUnknownSender,
00906 StanzaErrorUndefined
00907 };
00908
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00927 enum CertStatus
00928 {
00929 CertOk = 0,
00930 CertInvalid = 1,
00931 CertSignerUnknown = 2,
00932 CertRevoked = 4,
00933 CertExpired = 8,
00934 CertNotActive = 16,
00935 CertWrongPeer = 32,
00937 CertSignerNotCa = 64
00938 };
00939
00943 struct CertInfo
00944 {
00945 int status;
00946 bool chain;
00947 std::string issuer;
00948 std::string server;
00949 int date_from;
00951 int date_to;
00953 std::string protocol;
00954 std::string cipher;
00955 std::string mac;
00956 std::string compression;
00957 };
00958
00962 enum AuthenticationError
00963 {
00964 AuthErrorUndefined,
00965 SaslAborted,
00968 SaslIncorrectEncoding,
00973 SaslInvalidAuthzid,
00978 SaslInvalidMechanism,
00981 SaslMalformedRequest,
00985 SaslMechanismTooWeak,
00989 SaslNotAuthorized,
00993 SaslTemporaryAuthFailure,
00996 NonSaslConflict,
00997 NonSaslNotAcceptable,
00998 NonSaslNotAuthorized
00999 };
01000
01004 enum LogArea
01005 {
01006 LogAreaClassParser = 0x000001,
01007 LogAreaClassConnectionTCPBase = 0x000002,
01008 LogAreaClassClient = 0x000004,
01009 LogAreaClassClientbase = 0x000008,
01010 LogAreaClassComponent = 0x000010,
01011 LogAreaClassDns = 0x000020,
01012 LogAreaClassConnectionHTTPProxy = 0x000040,
01013 LogAreaClassConnectionSOCKS5Proxy = 0x000080,
01014 LogAreaClassConnectionTCPClient = 0x000100,
01015 LogAreaClassConnectionTCPServer = 0x000200,
01016 LogAreaClassS5BManager = 0x000400,
01017 LogAreaClassSOCKS5Bytestream = 0x000800,
01018 LogAreaClassConnectionBOSH = 0x001000,
01019 LogAreaClassConnectionTLS = 0x002000,
01020 LogAreaAllClasses = 0x01FFFF,
01021 LogAreaXmlIncoming = 0x020000,
01022 LogAreaXmlOutgoing = 0x040000,
01023 LogAreaUser = 0x800000,
01024 LogAreaAll = 0xFFFFFF
01025 };
01026
01030 enum LogLevel
01031 {
01032 LogLevelDebug,
01033 LogLevelWarning,
01034 LogLevelError
01035 };
01036
01040 enum MessageEventType
01041 {
01042 MessageEventOffline = 1,
01044 MessageEventDelivered = 2,
01046 MessageEventDisplayed = 4,
01047 MessageEventComposing = 8,
01048 MessageEventInvalid = 16,
01049 MessageEventCancel = 32
01050 };
01051
01055 enum ChatStateType
01056 {
01057 ChatStateActive = 1,
01058 ChatStateComposing = 2,
01059 ChatStatePaused = 4,
01060 ChatStateInactive = 8,
01061 ChatStateGone = 16,
01063 ChatStateInvalid = 32
01064 };
01065
01069 enum ResourceBindError
01070 {
01071 RbErrorUnknownError,
01072 RbErrorBadRequest,
01073 RbErrorNotAllowed,
01074 RbErrorConflict
01075 };
01076
01080 enum SessionCreateError
01081 {
01082 ScErrorUnknownError,
01083 ScErrorInternalServerError,
01084 ScErrorForbidden,
01085 ScErrorConflict
01087 };
01088
01092 enum MessageSessionFilter
01093 {
01094 FilterMessageEvents = 1,
01095 FilterChatStates = 2
01096 };
01097
01101 enum MUCRoomAffiliation
01102 {
01103 AffiliationNone,
01104 AffiliationOutcast,
01105 AffiliationMember,
01106 AffiliationOwner,
01107 AffiliationAdmin,
01108 AffiliationInvalid
01109 };
01110
01114 enum MUCRoomRole
01115 {
01116 RoleNone,
01117 RoleVisitor,
01118 RoleParticipant,
01119 RoleModerator,
01120 RoleInvalid
01121 };
01122
01126 enum MUCRoomFlag
01127 {
01128 FlagPasswordProtected = 1<< 1,
01129 FlagPublicLogging = 1<< 2,
01130 FlagPublicLoggingOff = 1<< 3,
01131 FlagHidden = 1<< 4,
01132 FlagMembersOnly = 1<< 5,
01133 FlagModerated = 1<< 6,
01134 FlagNonAnonymous = 1<< 7,
01135 FlagOpen = 1<< 8,
01136 FlagPersistent = 1<< 9,
01137 FlagPublic = 1<<10,
01138 FlagSemiAnonymous = 1<<11,
01139 FlagTemporary = 1<<12,
01140 FlagUnmoderated = 1<<13,
01141 FlagUnsecured = 1<<14,
01142 FlagFullyAnonymous = 1<<15
01143
01144 };
01145
01149
01150 enum MUCUserFlag
01151 {
01152 UserSelf = 1<<16,
01153 UserNickChanged = 1<<17,
01154 UserKicked = 1<<18,
01155 UserBanned = 1<<19,
01156 UserAffiliationChanged = 1<<20,
01158 UserRoomDestroyed = 1<<21,
01159 UserNickAssigned = 1<<22,
01161 UserNewRoom = 1<<23,
01162 UserMembershipRequired = 1<<24,
01165 UserRoomShutdown = 1<<25,
01167 UserAffiliationChangedWNR = 1<<26
01169 };
01170
01174 enum SubscriptionType
01175 {
01176 S10nNone,
01178 S10nNoneOut,
01181 S10nNoneIn,
01186 S10nNoneOutIn,
01190 S10nTo,
01191 S10nToIn,
01193 S10nFrom,
01194 S10nFromOut,
01196 S10nBoth
01197 };
01198
01202 typedef std::list<std::string> StringList;
01203
01207 typedef std::list<std::string*> StringPList;
01208
01212 typedef std::map<std::string, std::string> StringMap;
01213
01217 typedef std::multimap<std::string, std::string> StringMultiMap;
01218
01219 class StanzaExtension;
01223 typedef std::list<const StanzaExtension*> StanzaExtensionList;
01224 }
01225
01226 extern "C"
01227 {
01228 GLOOX_API const char* gloox_version();
01229 }
01230
01231 #endif // GLOOX_H__