Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / groupwise / libgroupwise / compress.h
blobccc98d97d76fa6793c80b29a31db25cc051f0178
1 #ifndef COMPRESS_H
2 #define COMPRESS_H
4 #include <QObject>
6 #include "zlib.h"
8 class QIODevice;
10 class Compressor : public QObject
12 Q_OBJECT
14 public:
15 Compressor(QIODevice* device, int compression = Z_DEFAULT_COMPRESSION);
16 ~Compressor();
18 int write(const QByteArray&);
20 protected slots:
21 void flush();
23 protected:
24 int write(const QByteArray&, bool flush);
26 private:
27 QIODevice* device_;
28 z_stream* zlib_stream_;
29 bool flushed_;
32 class Decompressor : public QObject
34 Q_OBJECT
36 public:
37 Decompressor(QIODevice* device);
38 ~Decompressor();
40 int write(const QByteArray&);
42 protected slots:
43 void flush();
45 protected:
46 int write(const QByteArray&, bool flush);
48 private:
49 QIODevice* device_;
50 z_stream* zlib_stream_;
51 bool flushed_;
54 #endif