00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00334 #ifndef GLOOX_H__
00335 #define GLOOX_H__
00336
00337 #include "macros.h"
00338
00339 #include <string>
00340 #include <list>
00341 #include <map>
00342
00349 namespace gloox
00350 {
00352 GLOOX_API extern const std::string XMLNS_CLIENT;
00353
00355 GLOOX_API extern const std::string XMLNS_COMPONENT_ACCEPT;
00356
00358 GLOOX_API extern const std::string XMLNS_COMPONENT_CONNECT;
00359
00361 GLOOX_API extern const std::string XMLNS_DISCO_INFO;
00362
00364 GLOOX_API extern const std::string XMLNS_DISCO_ITEMS;
00365
00367 GLOOX_API extern const std::string XMLNS_DISCO_PUBLISH;
00368
00370 GLOOX_API extern const std::string XMLNS_ADHOC_COMMANDS;
00371
00373 GLOOX_API extern const std::string XMLNS_COMPRESSION;
00374
00376 GLOOX_API extern const std::string XMLNS_OFFLINE;
00377
00379 GLOOX_API extern const std::string XMLNS_CHAT_STATES;
00380
00382 GLOOX_API extern const std::string XMLNS_AMP;
00383
00385 GLOOX_API extern const std::string XMLNS_IBB;
00386
00388 GLOOX_API extern const std::string XMLNS_FEATURE_NEG;
00389
00391 GLOOX_API extern const std::string XMLNS_CHATNEG;
00392
00394 GLOOX_API extern const std::string XMLNS_XHTML_IM;
00395
00397 GLOOX_API extern const std::string XMLNS_DELAY;
00398
00400 GLOOX_API extern const std::string XMLNS_ROSTER;
00401
00403 GLOOX_API extern const std::string XMLNS_VERSION;
00404
00406 GLOOX_API extern const std::string XMLNS_REGISTER;
00407
00409 GLOOX_API extern const std::string XMLNS_PRIVACY;
00410
00412 GLOOX_API extern const std::string XMLNS_AUTH;
00413
00415 GLOOX_API extern const std::string XMLNS_PRIVATE_XML;
00416
00418 GLOOX_API extern const std::string XMLNS_LAST;
00419
00421 GLOOX_API extern const std::string XMLNS_SEARCH;
00422
00424 GLOOX_API extern const std::string XMLNS_IQ_OOB;
00425
00427 GLOOX_API extern const std::string XMLNS_X_DATA;
00428
00430 GLOOX_API extern const std::string XMLNS_X_EVENT;
00431
00433 GLOOX_API extern const std::string XMLNS_X_OOB;
00434
00436 GLOOX_API extern const std::string XMLNS_X_DELAY;
00437
00439 GLOOX_API extern const std::string XMLNS_X_GPGSIGNED;
00440
00442 GLOOX_API extern const std::string XMLNS_X_GPGENCRYPTED;
00443
00445 GLOOX_API extern const std::string XMLNS_VCARD_TEMP;
00446
00448 GLOOX_API extern const std::string XMLNS_X_VCARD_UPDATE;
00449
00451 GLOOX_API extern const std::string XMLNS_BOOKMARKS;
00452
00454 GLOOX_API extern const std::string XMLNS_ANNOTATIONS;
00455
00457 GLOOX_API extern const std::string XMLNS_ROSTER_DELIMITER;
00458
00460 GLOOX_API extern const std::string XMLNS_XMPP_PING;
00461
00463 GLOOX_API extern const std::string XMLNS_SI;
00464
00466 GLOOX_API extern const std::string XMLNS_SI_FT;
00467
00469 GLOOX_API extern const std::string XMLNS_BYTESTREAMS;
00470
00472 GLOOX_API extern const std::string XMLNS_MUC;
00473
00475 GLOOX_API extern const std::string XMLNS_MUC_USER;
00476
00478 GLOOX_API extern const std::string XMLNS_MUC_ADMIN;
00479
00481 GLOOX_API extern const std::string XMLNS_MUC_UNIQUE;
00482
00484 GLOOX_API extern const std::string XMLNS_MUC_OWNER;
00485
00487 GLOOX_API extern const std::string XMLNS_MUC_ROOMINFO;
00488
00490 GLOOX_API extern const std::string XMLNS_MUC_ROOMS;
00491
00493 GLOOX_API extern const std::string XMLNS_MUC_REQUEST;
00494
00496 GLOOX_API extern const std::string XMLNS_PUBSUB;
00497
00499 GLOOX_API extern const std::string XMLNS_PUBSUB_ERRORS;
00500
00502 GLOOX_API extern const std::string XMLNS_PUBSUB_EVENT;
00503
00505 GLOOX_API extern const std::string XMLNS_PUBSUB_OWNER;
00506
00508 GLOOX_API extern const std::string XMLNS_CAPS;
00509
00511 GLOOX_API extern const std::string XMLNS_FT_FASTMODE;
00512
00514 GLOOX_API extern const std::string XMLNS_STREAM;
00515
00517 GLOOX_API extern const std::string XMLNS_XMPP_STREAM;
00518
00520 GLOOX_API extern const std::string XMLNS_XMPP_STANZAS;
00521
00523 GLOOX_API extern const std::string XMLNS_STREAM_TLS;
00524
00526 GLOOX_API extern const std::string XMLNS_STREAM_SASL;
00527
00529 GLOOX_API extern const std::string XMLNS_STREAM_BIND;
00530
00532 GLOOX_API extern const std::string XMLNS_STREAM_SESSION;
00533
00535 GLOOX_API extern const std::string XMLNS_STREAM_IQAUTH;
00536
00538 GLOOX_API extern const std::string XMLNS_STREAM_IQREGISTER;
00539
00541 GLOOX_API extern const std::string XMLNS_STREAM_COMPRESS;
00542
00544 GLOOX_API extern const std::string XMLNS_HTTPBIND;
00545
00547 GLOOX_API extern const std::string XMLNS_XMPP_BOSH;
00548
00550 GLOOX_API extern const std::string XMLNS_RECEIPTS;
00551
00553 GLOOX_API extern const std::string XMLNS_NICKNAME;
00554
00556 GLOOX_API extern const std::string XMLNS_JINGLE;
00557
00559 GLOOX_API extern const std::string XMLNS_JINGLE_AUDIO_RTP;
00560
00562 GLOOX_API extern const std::string XMLNS_JINGLE_ICE_UDP;
00563
00565 GLOOX_API extern const std::string XMLNS_JINGLE_RAW_UDP;
00566
00568 GLOOX_API extern const std::string XMLNS_JINGLE_VIDEO_RTP;
00569
00570
00572 GLOOX_API extern const std::string XMPP_STREAM_VERSION_MAJOR;
00573
00575 GLOOX_API extern const std::string XMPP_STREAM_VERSION_MINOR;
00576
00578 GLOOX_API extern const std::string GLOOX_VERSION;
00579
00581 GLOOX_API extern const std::string GLOOX_CAPS_NODE;
00582
00584 extern const std::string XMLNS;
00585
00587 extern const std::string TYPE;
00588
00590 GLOOX_API extern const std::string EmptyString;
00591
00595 enum ConnectionState
00596 {
00597 StateDisconnected,
00598 StateConnecting,
00599 StateConnected
00601 };
00602
00607 enum StreamEvent
00608 {
00609 StreamEventConnecting,
00610 StreamEventEncryption,
00611 StreamEventCompression,
00612 StreamEventAuthentication,
00613 StreamEventSessionInit,
00614 StreamEventResourceBinding,
00615 StreamEventSessionCreation,
00617 StreamEventRoster,
00618 StreamEventFinished
00619 };
00620
00624 enum ConnectionError
00625 {
00626 ConnNoError,
00627 ConnStreamError,
00629 ConnStreamVersionError,
00630 ConnStreamClosed,
00631 ConnProxyAuthRequired,
00633 ConnProxyAuthFailed,
00635 ConnProxyNoSupportedAuth,
00637 ConnIoError,
00638 ConnParseError,
00639 ConnConnectionRefused,
00641 ConnDnsError,
00643 ConnOutOfMemory,
00644 ConnNoSupportedAuth,
00646 ConnTlsFailed,
00648 ConnTlsNotAvailable,
00651 ConnCompressionFailed,
00653 ConnAuthenticationFailed,
00655 ConnUserDisconnected,
00656 ConnNotConnected
00657 };
00658
00662 enum TLSPolicy
00663 {
00664 TLSDisabled,
00665 TLSOptional,
00666 TLSRequired
00669 };
00670
00674 enum StreamFeature
00675 {
00676 StreamFeatureBind = 1,
00677 StreamFeatureUnbind = 2,
00678 StreamFeatureSession = 4,
00679 StreamFeatureStartTls = 8,
00680 StreamFeatureIqRegister = 16,
00682 StreamFeatureIqAuth = 32,
00684 StreamFeatureCompressZlib = 64,
00686 StreamFeatureCompressDclz = 128
00688
00689 };
00690
00694
00695 enum SaslMechanism
00696 {
00697 SaslMechNone = 0,
00698 SaslMechDigestMd5 = 256,
00699 SaslMechPlain = 512,
00700 SaslMechAnonymous = 1024,
00702 SaslMechExternal = 2048,
00703 SaslMechGssapi = 4096,
00704 SaslMechAll = 65535
00705 };
00706
00710 enum StreamError
00711 {
00712 StreamErrorUndefined,
00715 StreamErrorBadFormat,
00721 StreamErrorBadNamespacePrefix,
00724 StreamErrorConflict,
00727 StreamErrorConnectionTimeout,
00729 StreamErrorHostGone,
00732 StreamErrorHostUnknown,
00735 StreamErrorImproperAddressing,
00737 StreamErrorInternalServerError,
00740 StreamErrorInvalidFrom,
00744 StreamErrorInvalidId,
00746 StreamErrorInvalidNamespace,
00750 StreamErrorInvalidXml,
00752 StreamErrorNotAuthorized,
00756 StreamErrorPolicyViolation,
00759 StreamErrorRemoteConnectionFailed,
00761 StreamErrorResourceConstraint,
00763 StreamErrorRestrictedXml,
00766 StreamErrorSeeOtherHost,
00771 StreamErrorSystemShutdown,
00773 StreamErrorUndefinedCondition,
00776 StreamErrorUnsupportedEncoding,
00779 StreamErrorUnsupportedStanzaType,
00781 StreamErrorUnsupportedVersion,
00785 StreamErrorXmlNotWellFormed
00787 };
00788
00792 enum StanzaErrorType
00793 {
00794 StanzaErrorTypeAuth,
00795 StanzaErrorTypeCancel,
00796 StanzaErrorTypeContinue,
00797 StanzaErrorTypeModify,
00799 StanzaErrorTypeWait,
00800 StanzaErrorTypeUndefined
00801 };
00802
00807 enum StanzaError
00808 {
00809
00810 StanzaErrorBadRequest,
00814 StanzaErrorConflict,
00817 StanzaErrorFeatureNotImplemented,
00820 StanzaErrorForbidden,
00822 StanzaErrorGone,
00826 StanzaErrorInternalServerError,
00829 StanzaErrorItemNotFound,
00831 StanzaErrorJidMalformed,
00836 StanzaErrorNotAcceptable,
00840 StanzaErrorNotAllowed,
00842 StanzaErrorNotAuthorized,
00845 StanzaErrorNotModified,
00847 StanzaErrorPaymentRequired,
00850 StanzaErrorRecipientUnavailable,
00855 StanzaErrorRedirect,
00860 StanzaErrorRegistrationRequired,
00863 StanzaErrorRemoteServerNotFound,
00866 StanzaErrorRemoteServerTimeout,
00870 StanzaErrorResourceConstraint,
00872 StanzaErrorServiceUnavailable,
00874 StanzaErrorSubscribtionRequired,
00877 StanzaErrorUndefinedCondition,
00881 StanzaErrorUnexpectedRequest,
00884 StanzaErrorUnknownSender,
00888 StanzaErrorUndefined
00889 };
00890
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00909 enum CertStatus
00910 {
00911 CertOk = 0,
00912 CertInvalid = 1,
00913 CertSignerUnknown = 2,
00914 CertRevoked = 4,
00915 CertExpired = 8,
00916 CertNotActive = 16,
00917 CertWrongPeer = 32,
00919 CertSignerNotCa = 64
00920 };
00921
00925 struct CertInfo
00926 {
00927 int status;
00928 bool chain;
00929 std::string issuer;
00930 std::string server;
00931 int date_from;
00933 int date_to;
00935 std::string protocol;
00936 std::string cipher;
00937 std::string mac;
00938 std::string compression;
00939 };
00940
00944 enum AuthenticationError
00945 {
00946 AuthErrorUndefined,
00947 SaslAborted,
00950 SaslIncorrectEncoding,
00955 SaslInvalidAuthzid,
00960 SaslInvalidMechanism,
00963 SaslMalformedRequest,
00967 SaslMechanismTooWeak,
00971 SaslNotAuthorized,
00975 SaslTemporaryAuthFailure,
00978 NonSaslConflict,
00979 NonSaslNotAcceptable,
00980 NonSaslNotAuthorized
00981 };
00982
00986 enum LogArea
00987 {
00988 LogAreaClassParser = 0x000001,
00989 LogAreaClassConnectionTCPBase = 0x000002,
00990 LogAreaClassClient = 0x000004,
00991 LogAreaClassClientbase = 0x000008,
00992 LogAreaClassComponent = 0x000010,
00993 LogAreaClassDns = 0x000020,
00994 LogAreaClassConnectionHTTPProxy = 0x000040,
00995 LogAreaClassConnectionSOCKS5Proxy = 0x000080,
00996 LogAreaClassConnectionTCPClient = 0x000100,
00997 LogAreaClassConnectionTCPServer = 0x000200,
00998 LogAreaClassS5BManager = 0x000400,
00999 LogAreaClassSOCKS5Bytestream = 0x000800,
01000 LogAreaClassConnectionBOSH = 0x001000,
01001 LogAreaClassConnectionTLS = 0x002000,
01002 LogAreaAllClasses = 0x01FFFF,
01003 LogAreaXmlIncoming = 0x020000,
01004 LogAreaXmlOutgoing = 0x040000,
01005 LogAreaUser = 0x800000,
01006 LogAreaAll = 0xFFFFFF
01007 };
01008
01012 enum LogLevel
01013 {
01014 LogLevelDebug,
01015 LogLevelWarning,
01016 LogLevelError
01017 };
01018
01022 enum MessageEventType
01023 {
01024 MessageEventOffline = 1,
01026 MessageEventDelivered = 2,
01028 MessageEventDisplayed = 4,
01029 MessageEventComposing = 8,
01030 MessageEventInvalid = 16,
01031 MessageEventCancel = 32
01032 };
01033
01037 enum ChatStateType
01038 {
01039 ChatStateActive = 1,
01040 ChatStateComposing = 2,
01041 ChatStatePaused = 4,
01042 ChatStateInactive = 8,
01043 ChatStateGone = 16,
01045 ChatStateInvalid = 32
01046 };
01047
01051 enum ResourceBindError
01052 {
01053 RbErrorUnknownError,
01054 RbErrorBadRequest,
01055 RbErrorNotAllowed,
01056 RbErrorConflict
01057 };
01058
01062 enum SessionCreateError
01063 {
01064 ScErrorUnknownError,
01065 ScErrorInternalServerError,
01066 ScErrorForbidden,
01067 ScErrorConflict
01069 };
01070
01074 enum MessageSessionFilter
01075 {
01076 FilterMessageEvents = 1,
01077 FilterChatStates = 2
01078 };
01079
01083 enum MUCRoomAffiliation
01084 {
01085 AffiliationNone,
01086 AffiliationOutcast,
01087 AffiliationMember,
01088 AffiliationOwner,
01089 AffiliationAdmin,
01090 AffiliationInvalid
01091 };
01092
01096 enum MUCRoomRole
01097 {
01098 RoleNone,
01099 RoleVisitor,
01100 RoleParticipant,
01101 RoleModerator,
01102 RoleInvalid
01103 };
01104
01108 enum MUCRoomFlag
01109 {
01110 FlagPasswordProtected = 1<< 1,
01111 FlagPublicLogging = 1<< 2,
01112 FlagPublicLoggingOff = 1<< 3,
01113 FlagHidden = 1<< 4,
01114 FlagMembersOnly = 1<< 5,
01115 FlagModerated = 1<< 6,
01116 FlagNonAnonymous = 1<< 7,
01117 FlagOpen = 1<< 8,
01118 FlagPersistent = 1<< 9,
01119 FlagPublic = 1<<10,
01120 FlagSemiAnonymous = 1<<11,
01121 FlagTemporary = 1<<12,
01122 FlagUnmoderated = 1<<13,
01123 FlagUnsecured = 1<<14,
01124 FlagFullyAnonymous = 1<<15
01125
01126 };
01127
01131
01132 enum MUCUserFlag
01133 {
01134 UserSelf = 1<<16,
01135 UserNickChanged = 1<<17,
01136 UserKicked = 1<<18,
01137 UserBanned = 1<<19,
01138 UserAffiliationChanged = 1<<20,
01140 UserRoomDestroyed = 1<<21,
01141 UserNickAssigned = 1<<22,
01143 UserNewRoom = 1<<23,
01144 UserMembershipRequired = 1<<24,
01147 UserRoomShutdown = 1<<25,
01149 UserAffiliationChangedWNR = 1<<26
01151 };
01152
01156 enum SubscriptionType
01157 {
01158 S10nNone,
01160 S10nNoneOut,
01163 S10nNoneIn,
01168 S10nNoneOutIn,
01172 S10nTo,
01173 S10nToIn,
01175 S10nFrom,
01176 S10nFromOut,
01178 S10nBoth
01179 };
01180
01184 typedef std::list<std::string> StringList;
01185
01189 typedef std::map<std::string, std::string> StringMap;
01190
01191 class StanzaExtension;
01195 typedef std::list<const StanzaExtension*> StanzaExtensionList;
01196 }
01197
01198 extern "C"
01199 {
01200 GLOOX_API const char* gloox_version();
01201 }
01202
01203 #endif // GLOOX_H__