gloox.h

00001 /*
00002   Copyright (c) 2005-2006 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
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_X_DATA            = "jabber:x:data";
00321   const std::string XMLNS_X_EVENT           = "jabber:x:event";
00322   const std::string XMLNS_X_OOB             = "jabber:x:oob";
00323   const std::string XMLNS_VCARD_TEMP        = "vcard-temp";
00324   const std::string XMLNS_BOOKMARKS         = "storage:bookmarks";
00325   const std::string XMLNS_ANNOTATIONS       = "storage:rosternotes";
00326   const std::string XMLNS_ROSTER_DELIMITER  = "roster:delimiter";
00327 
00328   const std::string XMLNS_XMPP_STREAM       = "urn:ietf:params:xml:ns:xmpp-streams";
00329   const std::string XMLNS_XMPP_STANZAS      = "urn:ietf:params:xml:ns:xmpp-stanzas";
00330   const std::string XMLNS_STREAM_TLS        = "urn:ietf:params:xml:ns:xmpp-tls";
00331   const std::string XMLNS_STREAM_SASL       = "urn:ietf:params:xml:ns:xmpp-sasl";
00332   const std::string XMLNS_STREAM_BIND       = "urn:ietf:params:xml:ns:xmpp-bind";
00333   const std::string XMLNS_STREAM_SESSION    = "urn:ietf:params:xml:ns:xmpp-session";
00334   const std::string XMLNS_STREAM_IQAUTH     = "http://jabber.org/features/iq-auth";
00335   const std::string XMLNS_STREAM_IQREGISTER = "http://jabber.org/features/iq-register";
00336   const std::string XMLNS_STREAM_ACK        = "http://jabber.org/features/ack";
00337   const std::string XMLNS_STREAM_COMPRESS   = "http://jabber.org/features/compress";
00338 
00339   const int XMPP_STREAM_VERSION_MAJOR       = 1;
00340   const int XMPP_STREAM_VERSION_MINOR       = 0;
00341   const std::string GLOOX_VERSION           = "0.8.4-sic";
00342 
00346   enum ConnectionState
00347   {
00348     StateDisconnected,              
00349     StateConnecting,                
00350     StateConnected                  
00352   };
00353 
00357   enum ConnectionError
00358   {
00359     ConnNoError,                    
00360     ConnStreamError,                
00361     ConnStreamClosed,               
00362     ConnIoError,                    
00363     ConnOutOfMemory,                
00364     ConnNoSupportedAuth,            
00366     ConnTlsFailed,                  
00367     ConnAuthenticationFailed,       
00369     ConnUserDisconnected,           
00370     ConnNotConnected                
00371   };
00372 
00376   enum StreamFeature
00377   {
00378     StreamFeatureBind             =    1, 
00379     StreamFeatureSession          =    2, 
00380     StreamFeatureSaslDigestMd5    =    4, 
00381     StreamFeatureSaslPlain        =    8, 
00382     StreamFeatureSaslAnonymous    =   16, 
00383     StreamFeatureSaslExternal     =   32, 
00384     StreamFeatureStartTls         =   64, 
00385     StreamFeatureIqRegister       =  128, 
00387     StreamFeatureIqAuth           =  256, 
00389     StreamFeatureAck              =  512, 
00390     StreamFeatureCompressZlib     = 1024, 
00392     StreamFeatureCompressDclz     = 2048  
00394   };
00395 
00399   enum StreamError
00400   {
00401     StreamErrorUndefined,           
00404     StreamErrorBadFormat,           
00410     StreamErrorBadNamespacePrefix,  
00413     StreamErrorConflict,            
00416     StreamErrorConnectionTimeout,   
00418     StreamErrorHostGone,            
00421     StreamErrorHostUnknown,         
00424     StreamErrorImproperAddressing,  
00426     StreamErrorInternalServerError, 
00429     StreamErrorInvalidFrom,         
00433     StreamErrorInvalidId,           
00435     StreamErrorInvalidNamespace,    
00439     StreamErrorInvalidXml,          
00441     StreamErrorNotAuthorized,       
00445     StreamErrorPolicyViolation,     
00448     StreamErrorRemoteConnectionFailed,
00450     StreamErrorResourceConstraint,  
00452     StreamErrorRestrictedXml,       
00455     StreamErrorSeeOtherHost,        
00460     StreamErrorSystemShutdown,      
00462     StreamErrorUndefinedCondition,  
00465     StreamErrorUnsupportedEncoding, 
00467     StreamErrorUnsupportedStanzaType,
00469     StreamErrorUnsupportedVersion,  
00473     StreamErrorXmlNotWellFormed     
00475   };
00476 
00480   enum StanzaType
00481   {
00482     StanzaUndefined,                
00483     StanzaIq,                       
00484     StanzaMessage,                  
00485     StanzaS10n,                     
00486     StanzaPresence                  
00487   };
00488 
00492   enum StanzaSubType
00493   {
00494     StanzaSubUndefined,             
00495     StanzaIqGet,                    
00496     StanzaIqSet,                    
00500     StanzaIqResult,                 
00501     StanzaIqError,                  
00506     StanzaPresenceUnavailable,      
00510     StanzaPresenceAvailable,        
00514     StanzaPresenceProbe,            
00518     StanzaPresenceError,            
00522     StanzaS10nSubscribe,            
00526     StanzaS10nSubscribed,           
00530     StanzaS10nUnsubscribe,          
00534     StanzaS10nUnsubscribed,         
00538     StanzaMessageChat,              
00544     StanzaMessageError,             
00550     StanzaMessageGroupchat,         
00558     StanzaMessageHeadline,          
00567     StanzaMessageNormal             
00574   };
00575 
00579   enum StanzaErrorType
00580   {
00581     StanzaErrorTypeUndefined,       
00582     StanzaErrorTypeCancel,          
00583     StanzaErrorTypeContinue,        
00584     StanzaErrorTypeModify,          
00585     StanzaErrorTypeAuth,            
00586     StanzaErrorTypeWait             
00587   };
00588 
00592   enum StanzaError
00593   {
00594     StanzaErrorUndefined = 0,       
00595     StanzaErrorBadRequest,          
00599     StanzaErrorConflict,            
00602     StanzaErrorFeatureNotImplemented,
00605     StanzaErrorForbidden,           
00607     StanzaErrorGone,                
00611     StanzaErrorInternalServerError, 
00614     StanzaErrorItemNotFound,        
00616     StanzaErrorJidMalformed,        
00621     StanzaErrorNotAcceptable,       
00625     StanzaErrorNotAllowed,          
00627     StanzaErrorNotAuthorized,       
00630     StanzaErrorPaymentRequired,     
00633     StanzaErrorRecipientUnavailable,
00638     StanzaErrorRedirect,            
00643     StanzaErrorRegistrationRequired,
00646     StanzaErrorRemoteServerNotFound,
00649     StanzaErrorRemoteServerTimeout, 
00653     StanzaErrorResourceConstraint,  
00655     StanzaErrorServiceUnavailable,  
00657     StanzaErrorSubscribtionRequired,
00660     StanzaErrorUndefinedCondition,  
00664     StanzaErrorUnexpectedRequest    
00667   };
00668 
00672   enum Presence
00673   {
00674     PresenceUnknown,                
00675     PresenceAvailable,              
00676     PresenceChat,                   
00677     PresenceAway,                   
00678     PresenceDnd,                    
00679     PresenceXa,                     
00681     PresenceUnavailable             
00682   };
00683 
00687   enum CertStatus
00688   {
00689     CertOk               =  0,      
00690     CertInvalid          =  1,      
00691     CertSignerUnknown    =  2,      
00692     CertRevoked          =  4,      
00693     CertExpired          =  8,      
00694     CertNotActive        = 16,      
00695     CertWrongPeer        = 32,      
00697     CertSignerNotCa      = 64       
00698   };
00699 
00703   struct CertInfo
00704   {
00705     int status;                     
00706     bool chain;                     
00707     std::string issuer;             
00708     std::string server;             
00709     int date_from;                  
00710     int date_to;                    
00711     std::string protocol;           
00712     std::string cipher;             
00713     std::string mac;                
00714     std::string compression;        
00715   };
00716 
00720   enum AuthenticationError
00721   {
00722     AuthErrorUndefined,             
00723     SaslAborted,                    
00726     SaslIncorrectEncoding,          
00731     SaslInvalidAuthzid,             
00736     SaslInvalidMechanism,           
00739     SaslMechanismTooWeak,           
00743     SaslNotAuthorized,              
00747     SaslTemporaryAuthFailure,       
00750     NonSaslConflict,                
00751     NonSaslNotAcceptable,           
00752     NonSaslNotAuthorized            
00753   };
00754 
00758   enum LogArea
00759   {
00760     LogAreaClassParser     = 0x00001, 
00761     LogAreaClassConnection = 0x00002, 
00762     LogAreaClassClient     = 0x00004, 
00763     LogAreaClassClientbase = 0x00008, 
00764     LogAreaClassComponent  = 0x00010, 
00765     LogAreaClassDns        = 0x00020, 
00766     LogAreaAllClasses      = 0x01FFF, 
00767     LogAreaXmlIncoming     = 0x02000, 
00768     LogAreaXmlOutgoing     = 0x04000, 
00769     LogAreaUser            = 0x80000, 
00770     LogAreaAll             = 0xFFFFF  
00771   };
00772 
00776   enum LogLevel
00777   {
00778     LogLevelDebug,                  
00779     LogLevelWarning,                
00780     LogLevelError                   
00781   };
00782 
00786   enum MessageEventType
00787   {
00788     MessageEventCancel    = 0,      
00789     MessageEventOffline   = 1,      
00791     MessageEventDelivered = 2,      
00793     MessageEventDisplayed = 4,      
00794     MessageEventComposing = 8       
00795   };
00796 
00800   enum ChatStateType
00801   {
00802     ChatStateActive       =  1,     
00803     ChatStateComposing    =  2,     
00804     ChatStatePaused       =  4,     
00805     ChatStateInactive     =  8,     
00806     ChatStateGone         = 16      
00808   };
00809 
00813   enum ResourceBindError
00814   {
00815     RbErrorUnknownError,            
00816     RbErrorBadRequest,              
00817     RbErrorNotAllowed,              
00818     RbErrorConflict                 
00819   };
00820 
00824   enum SessionCreateError
00825   {
00826     ScErrorUnknownError,            
00827     ScErrorInternalServerError,     
00828     ScErrorForbidden,               
00829     ScErrorConflict                 
00831   };
00832 
00836   enum MessageSessionFilter
00837   {
00838     FilterMessageEvents    = 1,     
00839     FilterChatStates       = 2      
00840   };
00841 
00845   typedef std::list<std::string> StringList;
00846 
00850   typedef std::map<std::string, std::string> StringMap;
00851 
00852 }
00853 
00854 extern "C"
00855 {
00856   const char* gloox_version();
00857 }
00858 
00859 #endif // GLOOX_H__

Generated on Sun Sep 24 21:57:31 2006 for gloox by  doxygen 1.4.7