glooxd  0.3-svn
featurecompression.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 FEATURECOMPRESSION_H__
15 #define FEATURECOMPRESSION_H__
16 
17 #include "glooxd.h"
18 #include "streamfeature.h"
19 
20 namespace glooxd
21 {
22 
29  class GLOOXD_API FeatureCompression : public StreamFeature
30  {
31  public:
36 
40  virtual ~FeatureCompression() {}
41 
42  // reimplemented from StreamFeature
43  virtual const std::string& filterString() const;
44 
45  // reimplemented from StreamFeature
46  virtual gloox::Tag* tag( int state, const std::string& domain );
47 
48  // reimplemented from StreamFeature
49  virtual StreamFeature* newInstance() const
50  {
51  return new FeatureCompression();
52  }
53 
54  // reimplemented from StreamFeature
55  virtual void handleTag( gloox::Tag* tag );
56 
57  private:
58  enum State
59  {
60  ZlibOffered,
61  ZlibEnabled,
62  ZlibCanceled
63  };
64 
65  State m_state;
66 
67  };
68 
69 }
70 
71 #endif // FEATURECOMPRESSION_H__