messageeventfilter.h

00001 /*
00002   Copyright (c) 2005-2006 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 MessageEventHandler;
00025   class MessageSession;
00026 
00037   class GLOOX_API MessageEventFilter : public MessageFilter
00038   {
00039     public:
00046       MessageEventFilter( MessageSession *parent,
00047                              int defaultEvents = MessageEventOffline | MessageEventDelivered
00048                                                | MessageEventDisplayed | MessageEventComposing );
00049 
00053       virtual ~MessageEventFilter();
00054 
00065       void raiseMessageEvent( MessageEventType event );
00066 
00072       void registerMessageEventHandler( MessageEventHandler *meh );
00073 
00079       void removeMessageEventHandler();
00080 
00081       // reimplemented from MessageFilter
00082       virtual void decorate( Tag *tag );
00083 
00084       // reimplemented from MessageFilter
00085       virtual void filter( Stanza *stanza );
00086 
00087     private:
00088       MessageEventHandler *m_messageEventHandler;
00089       std::string m_lastID;
00090       int m_requestedEvents;
00091       int m_defaultEvents;
00092       MessageEventType m_lastSent;
00093 
00094   };
00095 
00096 }
00097 
00098 #endif // MESSAGEVENTFILTER_H__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1