| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef MSGREPLY_H |
| 19 |
#define MSGREPLY_H |
| 20 |
|
| 21 |
#include <QObject> |
| 22 |
#include <QBuffer> |
| 23 |
#include <QNetworkReply> |
| 24 |
#include <qmailstore.h> |
| 25 |
#include <MailServiceClient.h> |
| 26 |
#include "MsgPartQNAM.h" |
| 27 |
|
| 28 |
class MsgReply : public QNetworkReply |
| 29 |
{ |
| 30 |
Q_OBJECT |
| 31 |
public: |
| 32 |
MsgReply(MsgPartQNAM *parent, QMailMessageId &msgId); |
| 33 |
MsgReply(MsgPartQNAM *parent, QMailMessageId &msgId, const bool requiresFormatting); |
| 34 |
~MsgReply(); |
| 35 |
|
| 36 |
|
| 37 |
public: |
| 38 |
virtual void close(); |
| 39 |
virtual qint64 bytesAvailable() const; |
| 40 |
|
| 41 |
protected: |
| 42 |
virtual qint64 readData(char *data, qint64 maxlen); |
| 43 |
|
| 44 |
|
| 45 |
public slots: |
| 46 |
virtual void abort() { close(); } |
| 47 |
void failed(const QString &reason); |
| 48 |
|
| 49 |
void handleMsgsAvailable(const QMailMessageIdList &list); |
| 50 |
void handleFetchFailed(const QMailMessageIdList &list); |
| 51 |
|
| 52 |
void messageReady(); |
| 53 |
void init(); |
| 54 |
|
| 55 |
private: |
| 56 |
QByteArray *formattedBufferContent; |
| 57 |
mutable QBuffer buffer; |
| 58 |
QMailMessageId m_id; |
| 59 |
QMailMessage m_msg; |
| 60 |
bool m_format; |
| 61 |
}; |
| 62 |
|
| 63 |
#endif |