00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef INBANDBYTESTREAM_H__
00015 #define INBANDBYTESTREAM_H__
00016
00017 #include "messagefilter.h"
00018 #include "iqhandler.h"
00019 #include "gloox.h"
00020 #include "inbandbytestreammanager.h"
00021
00022 namespace gloox
00023 {
00024
00025 class ClientBase;
00026 class InBandBytestreamDataHandler;
00027
00039 class GLOOX_API InBandBytestream : public MessageFilter
00040 {
00041 friend class InBandBytestreamManager;
00042
00043 public:
00047 virtual ~InBandBytestream();
00048
00053 bool isOpen() const { return m_open; };
00054
00065 bool sendBlock( const std::string& data );
00066
00071 const std::string& sid() const { return m_sid; };
00072
00077 int blockSize() const { return (int)m_blockSize; };
00078
00085 void registerInBandBytestreamDataHandler( InBandBytestreamDataHandler *ibbdh );
00086
00090 void removeInBandBytestreamDataHandler();
00091
00092
00093 virtual void decorate( Tag *tag );
00094
00095
00096 virtual void filter( Stanza *stanza );
00097
00098 private:
00099 InBandBytestream( MessageSession *session, ClientBase *clientbase );
00100 void setBlockSize( int blockSize ) { m_blockSize = blockSize; };
00101 void close();
00102 void closed();
00103 void setSid( const std::string& sid ) { m_sid = sid; };
00104
00105 ClientBase *m_clientbase;
00106 InBandBytestreamManager *m_manager;
00107 InBandBytestreamDataHandler *m_inbandBytestreamDataHandler;
00108 std::string m_sid;
00109 std::string::size_type m_blockSize;
00110 int m_sequence;
00111 int m_lastChunkReceived;
00112 bool m_open;
00113
00114 };
00115
00116 }
00117
00118 #endif // INBANDBYTESTREAM_H__