gloox  1.0.9
chatstatefilter.h
1 /*
2  Copyright (c) 2005-2013 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 CHATSTATEFILTER_H__
15 #define CHATSTATEFILTER_H__
16 
17 #include "messagefilter.h"
18 #include "gloox.h"
19 
20 namespace gloox
21 {
22 
23  class Tag;
24  class ChatStateHandler;
25  class MessageSession;
26  class Message;
27 
43  class GLOOX_API ChatStateFilter : public MessageFilter
44  {
45  public:
51 
55  virtual ~ChatStateFilter();
56 
67  void setChatState( ChatStateType state );
68 
74  void registerChatStateHandler( ChatStateHandler* csh )
75  { m_chatStateHandler = csh; }
76 
82  void removeChatStateHandler()
83  { m_chatStateHandler = 0; }
84 
85  // reimplemented from MessageFilter
86  virtual void decorate( Message& msg );
87 
88  // reimplemented from MessageFilter
89  virtual void filter( Message& msg );
90 
91  protected:
94 
97 
100 
101  };
102 
103 }
104 
105 #endif // CHATSTATEFILTER_H__