messagesession.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 MESSAGESESSION_H__
00015 #define MESSAGESESSION_H__
00016 
00017 #include "messagehandler.h"
00018 #include "jid.h"
00019 
00020 #include <string>
00021 
00022 namespace gloox
00023 {
00024 
00025   class ClientBase;
00026   class Tag;
00027   class MessageFilter;
00028 
00139   class GLOOX_API MessageSession : public MessageHandler
00140   {
00141 
00142     friend class MessageEventFilter;
00143     friend class ChatStateFilter;
00144     friend class InBandBytestream;
00145 
00146     public:
00155       MessageSession( ClientBase *parent, const JID& jid );
00156 
00163       virtual ~MessageSession();
00164 
00169       const JID& target() const { return m_target; };
00170 
00176       const std::string& threadID() const { return m_thread; };
00177 
00184       void registerMessageHandler( MessageHandler *mh );
00185 
00190       void removeMessageHandler();
00191 
00198       void send( const std::string& message, const std::string& subject );
00199 
00205       void registerMessageFilter( MessageFilter *mf );
00206 
00211       void removeMessageFilter( MessageFilter *mf );
00212 
00213       // reimplemented from MessageHandler
00214       virtual void handleMessage( Stanza *stanza );
00215 
00216     protected:
00223       virtual void send( Tag *tag );
00224 
00225     private:
00226       typedef std::list<MessageFilter*> MessageFilterList;
00227 
00228       MessageFilterList m_messageFilterList;
00229       ClientBase *m_parent;
00230       JID m_target;
00231       MessageHandler *m_messageHandler;
00232       std::string m_thread;
00233 
00234   };
00235 
00236 }
00237 
00238 #endif // MESSAGESESSION_H__

Generated on Sun Sep 24 21:57:32 2006 for gloox by  doxygen 1.4.7