gloox  0.9.9.12
nonsaslauth.h
1 /*
2  Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef NONSASLAUTH_H__
15 #define NONSASLAUTH_H__
16 
17 #include "iqhandler.h"
18 
19 #include <string>
20 
21 namespace gloox
22 {
23 
24  class Client;
25  class Stanza;
26  class Tag;
27 
37  class GLOOX_API NonSaslAuth : public IqHandler
38  {
39  public:
44  NonSaslAuth( Client *parent );
45 
49  virtual ~NonSaslAuth();
50 
56  void doAuth( const std::string& sid );
57 
58  // reimplemented from IqHandler
59  virtual bool handleIq( Stanza *stanza );
60 
61  // reimplemented from IqHandler
62  virtual bool handleIqID( Stanza *stanza, int context );
63 
64  private:
65  enum NonSaslAuthTrack
66  {
67  TRACK_REQUEST_AUTH_FIELDS,
68  TRACK_SEND_AUTH
69  };
70 
71  Client *m_parent;
72  std::string m_sid;
73 
74  };
75 
76 }
77 
78 #endif // NONSASLAUTH_H__