| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QNETWORKREPLY_P_H |
| 5 | #define QNETWORKREPLY_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of the Network Access API. This header file may change from |
| 13 | // version to version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtNetwork/private/qtnetworkglobal_p.h> |
| 19 | #include "qnetworkrequest.h" |
| 20 | #include "qnetworkrequest_p.h" |
| 21 | #include "qnetworkreply.h" |
| 22 | #include "QtCore/qpointer.h" |
| 23 | #include <QtCore/QElapsedTimer> |
| 24 | #include "private/qiodevice_p.h" |
| 25 | |
| 26 | QT_BEGIN_NAMESPACE |
| 27 | |
| 28 | class QNetworkReplyPrivate: public QIODevicePrivate, public QNetworkHeadersPrivate |
| 29 | { |
| 30 | public: |
| 31 | enum State { |
| 32 | Idle, // The reply is idle. |
| 33 | Buffering, // The reply is buffering outgoing data. |
| 34 | Working, // The reply is uploading/downloading data. |
| 35 | Finished, // The reply has finished. |
| 36 | Aborted, // The reply has been aborted. |
| 37 | }; |
| 38 | |
| 39 | QNetworkReplyPrivate(); |
| 40 | QNetworkRequest request; |
| 41 | QNetworkRequest originalRequest; |
| 42 | QUrl url; |
| 43 | QPointer<QNetworkAccessManager> manager; |
| 44 | qint64 readBufferMaxSize; |
| 45 | QElapsedTimer downloadProgressSignalChoke; |
| 46 | QElapsedTimer uploadProgressSignalChoke; |
| 47 | bool emitAllUploadProgressSignals; |
| 48 | const static int progressSignalInterval; |
| 49 | QNetworkAccessManager::Operation operation; |
| 50 | QNetworkReply::NetworkError errorCode; |
| 51 | bool isFinished; |
| 52 | |
| 53 | static inline void setManager(QNetworkReply *reply, QNetworkAccessManager *manager) |
| 54 | { reply->d_func()->manager = manager; } |
| 55 | |
| 56 | Q_DECLARE_PUBLIC(QNetworkReply) |
| 57 | }; |
| 58 | |
| 59 | QT_END_NAMESPACE |
| 60 | |
| 61 | #endif |
| 62 |
