gloox  0.9.9.12
chatstatefilter.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 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 Stanza;
27 
40  class GLOOX_API ChatStateFilter : public MessageFilter
41  {
42  public:
48 
52  virtual ~ChatStateFilter();
53 
64  void setChatState( ChatStateType state );
65 
71  void registerChatStateHandler( ChatStateHandler *csh );
72 
78  void removeChatStateHandler();
79 
80  // reimplemented from MessageFilter
81  virtual void decorate( Tag *tag );
82 
83  // reimplemented from MessageFilter
84  virtual void filter( Stanza *stanza );
85 
86  protected:
87  ChatStateHandler *m_chatStateHandler;
88  ChatStateType m_lastSent;
89  bool m_enableChatStates;
90 
91  };
92 
93 }
94 
95 #endif // CHATSTATEFILTER_H__