kopete/protocols/messenger/libpapillon
bytestreambase.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 #ifndef BYTESTREAMBASE_H
00019 #define BYTESTREAMBASE_H
00020
00021 #include <QtCore/QObject>
00022 #include <QtCore/QByteArray>
00023
00024 namespace Papillon
00025 {
00026
00029 class ByteStreamBase : public QObject
00030 {
00031 Q_OBJECT
00032
00033 public:
00035 ByteStreamBase(QObject *parent);
00037 ~ByteStreamBase();
00038
00039 public:
00041 virtual qint64 bytesAvailable() const;
00043 virtual qint64 bytesToWrite() const;
00045 virtual bool isOpen() const = 0;
00047 virtual void close();
00049 virtual QByteArray read(qint64 count) = 0;
00051 virtual qint64 write(const QByteArray & buffer) = 0;
00052
00053 signals:
00054 void bytesWritten(const qint64 count);
00055 void readyRead();
00056
00057 };
00058 }
00059
00060 #endif // BYTESTREAMBASE_H