kopete/protocols/messenger/libpapillon
httpcoreprotocol.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PAPILLON_HTTPCOREPROTOCOL_H
00020 #define PAPILLON_HTTPCOREPROTOCOL_H
00021
00022 #include <QtCore/QObject>
00023 #include <QtCore/QByteArray>
00024
00025 #include <Papillon/Macros>
00026
00027 class QDataStream;
00028
00029 namespace Papillon
00030 {
00031
00032 class HttpTransfer;
00033
00044 class PAPILLON_EXPORT HttpCoreProtocol : public QObject
00045 {
00046 Q_OBJECT
00047 public:
00051 enum State
00052 {
00056 NeedMore,
00060 Available,
00064 NoData,
00068 WaitForContent
00069 };
00070
00074 HttpCoreProtocol();
00078 virtual ~HttpCoreProtocol();
00079
00083 void reset();
00084
00091 void addIncomingData(const QByteArray &incomingBytes);
00092
00098 HttpTransfer *incomingTransfer();
00099
00105 void outgoingTransfer(HttpTransfer *outgoing);
00106
00112 int state();
00113
00114 signals:
00119 void outgoingData(const QByteArray &data);
00120
00124 void incomingData();
00125
00126 protected:
00131 bool okToProceed(const QDataStream &din);
00137 int rawToTransfer(const QByteArray &raw);
00138
00139 private:
00140 class Private;
00141 Private *d;
00142 };
00143
00144 }
00145
00146 #endif