1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
8 ** |
8 ** |
64 class QFileNetworkReplyPrivate; |
64 class QFileNetworkReplyPrivate; |
65 class QFileNetworkReply: public QNetworkReply |
65 class QFileNetworkReply: public QNetworkReply |
66 { |
66 { |
67 Q_OBJECT |
67 Q_OBJECT |
68 public: |
68 public: |
69 QFileNetworkReply(QObject *parent, const QNetworkRequest &req); |
69 QFileNetworkReply(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op); |
70 ~QFileNetworkReply(); |
70 ~QFileNetworkReply(); |
71 virtual void abort(); |
71 virtual void abort(); |
72 |
72 |
73 // reimplemented from QNetworkReply |
73 // reimplemented from QNetworkReply |
74 virtual void close(); |
74 virtual void close(); |
75 virtual qint64 bytesAvailable() const; |
75 virtual qint64 bytesAvailable() const; |
76 virtual bool isSequential () const; |
76 virtual bool isSequential () const; |
77 qint64 size() const; |
77 qint64 size() const; |
78 |
78 |
79 |
|
80 virtual qint64 readData(char *data, qint64 maxlen); |
79 virtual qint64 readData(char *data, qint64 maxlen); |
81 |
80 |
82 Q_DECLARE_PRIVATE(QFileNetworkReply) |
81 Q_DECLARE_PRIVATE(QFileNetworkReply) |
83 Q_PRIVATE_SLOT(d_func(), void _q_startOperation()) |
|
84 |
|
85 }; |
82 }; |
86 |
83 |
87 class QFileNetworkReplyPrivate: public QNetworkReplyPrivate |
84 class QFileNetworkReplyPrivate: public QNetworkReplyPrivate |
88 { |
85 { |
89 public: |
86 public: |
90 QFileNetworkReplyPrivate(); |
87 QFileNetworkReplyPrivate(); |
91 |
88 |
92 QFile realFile; |
89 QFile realFile; |
93 qint64 realFileSize; |
90 qint64 realFileSize; |
94 |
91 |
95 void _q_startOperation(); |
|
96 |
|
97 virtual bool isFinished() const; |
92 virtual bool isFinished() const; |
98 void doFinished(); |
|
99 bool finished; |
|
100 |
|
101 |
93 |
102 Q_DECLARE_PUBLIC(QFileNetworkReply) |
94 Q_DECLARE_PUBLIC(QFileNetworkReply) |
103 }; |
95 }; |
104 |
96 |
105 QT_END_NAMESPACE |
97 QT_END_NAMESPACE |