gloox 1.0
|
00001 /* 00002 Copyright (c) 2005-2009 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 CHATSTATEFILTER_H__ 00015 #define CHATSTATEFILTER_H__ 00016 00017 #include "messagefilter.h" 00018 #include "gloox.h" 00019 00020 namespace gloox 00021 { 00022 00023 class Tag; 00024 class ChatStateHandler; 00025 class MessageSession; 00026 class Message; 00027 00040 class GLOOX_API ChatStateFilter : public MessageFilter 00041 { 00042 public: 00047 ChatStateFilter( MessageSession* parent ); 00048 00052 virtual ~ChatStateFilter(); 00053 00064 void setChatState( ChatStateType state ); 00065 00071 void registerChatStateHandler( ChatStateHandler* csh ) 00072 { m_chatStateHandler = csh; } 00073 00079 void removeChatStateHandler() 00080 { m_chatStateHandler = 0; } 00081 00082 // reimplemented from MessageFilter 00083 virtual void decorate( Message& msg ); 00084 00085 // reimplemented from MessageFilter 00086 virtual void filter( Message& msg ); 00087 00088 protected: 00090 ChatStateHandler* m_chatStateHandler; 00091 00093 ChatStateType m_lastSent; 00094 00096 bool m_enableChatStates; 00097 00098 }; 00099 00100 } 00101 00102 #endif // CHATSTATEFILTER_H__