glooxd  0.3-svn
featuresession.h
1 /*
2  Copyright (c) 2009 by Jakob Schroeter <js@camaya.net>
3  This file is part of the glooxd library. http://camaya.net/glooxd
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 FEATURESESSION_H__
15 #define FEATURESESSION_H__
16 
17 #include "glooxd.h"
18 #include "streamfeature.h"
19 
20 namespace glooxd
21 {
22 
31  class GLOOXD_API FeatureSession : public StreamFeature
32  {
33  public:
38 
42  virtual ~FeatureSession() {}
43 
44  // reimplemented from StreamFeature
45  virtual const std::string& filterString() const;
46 
47  // reimplemented from StreamFeature
48  virtual gloox::Tag* tag( int state, const std::string& domain );
49 
50  // reimplemented from StreamFeature
51  virtual StreamFeature* newInstance() const
52  {
53  return new FeatureSession();
54  }
55 
56  // reimplemented from StreamFeature
57  virtual void handleTag( gloox::Tag* tag );
58 
59  private:
60  enum State
61  {
62  SessionOffered,
63  SessionDone,
64  SessionCanceled
65  };
66 
67  State m_state;
68 
69  };
70 
71 }
72 
73 #endif // FEATURESESSION_H__