Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

nonsaslauth.h

00001 /*
00002   Copyright (c) 2005-2008 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 
00013 
00014 #ifndef NONSASLAUTH_H__
00015 #define NONSASLAUTH_H__
00016 
00017 #include "iqhandler.h"
00018 
00019 #include <string>
00020 
00021 namespace gloox
00022 {
00023 
00024   class Client;
00025   class Stanza;
00026   class Tag;
00027 
00039   class GLOOX_API NonSaslAuth : public IqHandler
00040   {
00041     public:
00046       NonSaslAuth( Client* parent );
00047 
00051       virtual ~NonSaslAuth();
00052 
00058       void doAuth( const std::string& sid );
00059 
00060       // reimplemented from IqHandler
00061       virtual bool handleIq( const IQ& iq ) { (void)iq; return false; }
00062 
00063       // reimplemented from IqHandler
00064       virtual void handleIqID( const IQ& iq, int context );
00065 
00066     private:
00067 #ifdef NONSASLAUTH_TEST
00068     public:
00069 #endif
00070 
00076       class Query : public StanzaExtension
00077       {
00078         public:
00084           Query( const std::string& user );
00085 
00090           Query( const Tag* tag = 0 );
00091 
00100           Query* newInstance( const std::string& user, const std::string& sid,
00101                               const std::string& pwd, const std::string& resource ) const;
00102 
00106           virtual ~Query() {}
00107 
00108           // reimplemented from StanzaExtension
00109           virtual const std::string& filterString() const;
00110 
00111           // reimplemented from StanzaExtension
00112           virtual StanzaExtension* newInstance( const Tag* tag ) const
00113           {
00114             return new Query( tag );
00115           }
00116 
00117           // reimplemented from StanzaExtension
00118           virtual Tag* tag() const;
00119 
00120         private:
00121           std::string m_user;
00122           std::string m_pwd;
00123           std::string m_resource;
00124           bool m_digest;
00125 
00126       };
00127 
00128       enum NonSaslAuthTrack
00129       {
00130         TrackRequestAuthFields,
00131         TrackSendAuth
00132       };
00133 
00134       Client* m_parent;
00135       std::string m_sid;
00136 
00137   };
00138 
00139 }
00140 
00141 #endif // NONSASLAUTH_H__

Generated on Mon Oct 13 10:45:11 2008 for gloox by  doxygen 1.4.1