gloox  1.0
messageeventfilter.h
1 /*
2  Copyright (c) 2005-2009 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 MESSAGEVENTFILTER_H__
15 #define MESSAGEVENTFILTER_H__
16 
17 #include "messagefilter.h"
18 #include "gloox.h"
19 
20 namespace gloox
21 {
22 
23  class Tag;
24  class Message;
25  class MessageEventHandler;
26  class MessageSession;
27 
38  class GLOOX_API MessageEventFilter : public MessageFilter
39  {
40  public:
46 
50  virtual ~MessageEventFilter();
51 
62  void raiseMessageEvent( MessageEventType event );
63 
69  void registerMessageEventHandler( MessageEventHandler* meh );
70 
76  void removeMessageEventHandler();
77 
78  // reimplemented from MessageFilter
79  virtual void decorate( Message& msg );
80 
81  // reimplemented from MessageFilter
82  virtual void filter( Message& msg );
83 
84  private:
85  MessageEventHandler* m_messageEventHandler;
86  std::string m_lastID;
87  int m_requestedEvents;
88  MessageEventType m_lastSent;
89  bool m_disable;
90 
91  };
92 
93 }
94 
95 #endif // MESSAGEVENTFILTER_H__