gloox  0.9.9.12
messageeventfilter.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 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 Stanza;
25  class MessageEventHandler;
26  class MessageSession;
27 
38  class GLOOX_API MessageEventFilter : public MessageFilter
39  {
40  public:
48  int defaultEvents = MessageEventOffline | MessageEventDelivered
50 
54  virtual ~MessageEventFilter();
55 
66  void raiseMessageEvent( MessageEventType event );
67 
73  void registerMessageEventHandler( MessageEventHandler *meh );
74 
80  void removeMessageEventHandler();
81 
82  // reimplemented from MessageFilter
83  virtual void decorate( Tag *tag );
84 
85  // reimplemented from MessageFilter
86  virtual void filter( Stanza *stanza );
87 
88  private:
89  MessageEventHandler *m_messageEventHandler;
90  std::string m_lastID;
91  int m_requestedEvents;
92  int m_defaultEvents;
93  MessageEventType m_lastSent;
94  bool m_disable;
95 
96  };
97 
98 }
99 
100 #endif // MESSAGEVENTFILTER_H__