messageeventfilter.h

00001 /*
00002   Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 
00014 #ifndef MESSAGEVENTFILTER_H__
00015 #define MESSAGEVENTFILTER_H__
00016 
00017 #include "messagefilter.h"
00018 #include "gloox.h"
00019 
00020 namespace gloox
00021 {
00022 
00023   class Tag;
00024   class Stanza;
00025   class MessageEventHandler;
00026   class MessageSession;
00027 
00038   class GLOOX_API MessageEventFilter : public MessageFilter
00039   {
00040     public:
00047       MessageEventFilter( MessageSession *parent,
00048                           int defaultEvents = MessageEventOffline | MessageEventDelivered
00049                                               | MessageEventDisplayed | MessageEventComposing );
00050 
00054       virtual ~MessageEventFilter();
00055 
00066       void raiseMessageEvent( MessageEventType event );
00067 
00073       void registerMessageEventHandler( MessageEventHandler *meh );
00074 
00080       void removeMessageEventHandler();
00081 
00082       // reimplemented from MessageFilter
00083       virtual void decorate( Tag *tag );
00084 
00085       // reimplemented from MessageFilter
00086       virtual void filter( Stanza *stanza );
00087 
00088     private:
00089       MessageEventHandler *m_messageEventHandler;
00090       std::string m_lastID;
00091       int m_requestedEvents;
00092       int m_defaultEvents;
00093       MessageEventType m_lastSent;
00094       bool m_disable;
00095 
00096   };
00097 
00098 }
00099 
00100 #endif // MESSAGEVENTFILTER_H__

Generated on Mon Dec 7 13:28:19 2009 for gloox by  doxygen 1.6.1