1// qnetworkreply.sip generated by MetaSIP
2//
3// This file is part of the QtNetwork Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QNetworkReply : QIODevice
24{
25%TypeHeaderCode
26#include <qnetworkreply.h>
27%End
28
29public:
30    enum NetworkError
31    {
32        NoError,
33        ConnectionRefusedError,
34        RemoteHostClosedError,
35        HostNotFoundError,
36        TimeoutError,
37        OperationCanceledError,
38        SslHandshakeFailedError,
39        UnknownNetworkError,
40        ProxyConnectionRefusedError,
41        ProxyConnectionClosedError,
42        ProxyNotFoundError,
43        ProxyTimeoutError,
44        ProxyAuthenticationRequiredError,
45        UnknownProxyError,
46        ContentAccessDenied,
47        ContentOperationNotPermittedError,
48        ContentNotFoundError,
49        AuthenticationRequiredError,
50        UnknownContentError,
51        ProtocolUnknownError,
52        ProtocolInvalidOperationError,
53        ProtocolFailure,
54        ContentReSendError,
55        TemporaryNetworkFailureError,
56        NetworkSessionFailedError,
57        BackgroundRequestNotAllowedError,
58%If (Qt_5_3_0 -)
59        ContentConflictError,
60%End
61%If (Qt_5_3_0 -)
62        ContentGoneError,
63%End
64%If (Qt_5_3_0 -)
65        InternalServerError,
66%End
67%If (Qt_5_3_0 -)
68        OperationNotImplementedError,
69%End
70%If (Qt_5_3_0 -)
71        ServiceUnavailableError,
72%End
73%If (Qt_5_3_0 -)
74        UnknownServerError,
75%End
76%If (Qt_5_6_0 -)
77        TooManyRedirectsError,
78%End
79%If (Qt_5_6_0 -)
80        InsecureRedirectError,
81%End
82    };
83
84    virtual ~QNetworkReply();
85    virtual void abort() = 0;
86    virtual void close();
87    virtual bool isSequential() const;
88    qint64 readBufferSize() const;
89    virtual void setReadBufferSize(qint64 size);
90    QNetworkAccessManager *manager() const;
91    QNetworkAccessManager::Operation operation() const;
92    QNetworkRequest request() const;
93    QNetworkReply::NetworkError error() const;
94    QUrl url() const;
95    QVariant header(QNetworkRequest::KnownHeaders header) const;
96    bool hasRawHeader(const QByteArray &headerName) const;
97    QList<QByteArray> rawHeaderList() const;
98    QByteArray rawHeader(const QByteArray &headerName) const;
99    QVariant attribute(QNetworkRequest::Attribute code) const;
100%If (PyQt_SSL)
101    QSslConfiguration sslConfiguration() const;
102%End
103%If (PyQt_SSL)
104    void setSslConfiguration(const QSslConfiguration &configuration);
105%End
106
107public slots:
108    virtual void ignoreSslErrors();
109
110signals:
111    void metaDataChanged();
112    void finished();
113%If (Qt_5_1_0 -)
114%If (PyQt_SSL)
115    void encrypted();
116%End
117%End
118    void error(QNetworkReply::NetworkError);
119%If (Qt_5_15_0 -)
120    void errorOccurred(QNetworkReply::NetworkError);
121%End
122%If (PyQt_SSL)
123    void sslErrors(const QList<QSslError> &errors);
124%End
125    void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
126    void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
127%If (Qt_5_5_0 -)
128%If (PyQt_SSL)
129    void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
130%End
131%End
132%If (Qt_5_6_0 -)
133    void redirected(const QUrl &url);
134%End
135%If (Qt_5_9_0 -)
136    void redirectAllowed();
137%End
138
139protected:
140    explicit QNetworkReply(QObject *parent /TransferThis/ = 0);
141    virtual qint64 writeData(const char *data /Array/, qint64 len /ArraySize/) /ReleaseGIL/;
142    void setOperation(QNetworkAccessManager::Operation operation);
143    void setRequest(const QNetworkRequest &request);
144    void setError(QNetworkReply::NetworkError errorCode, const QString &errorString);
145    void setUrl(const QUrl &url);
146    void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
147    void setRawHeader(const QByteArray &headerName, const QByteArray &value);
148    void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
149    void setFinished(bool finished);
150
151public:
152    bool isFinished() const;
153    bool isRunning() const;
154%If (PyQt_SSL)
155    void ignoreSslErrors(const QList<QSslError> &errors);
156%End
157    const QList<QPair<QByteArray, QByteArray>> &rawHeaderPairs() const;
158
159protected:
160%If (PyQt_SSL)
161    virtual void sslConfigurationImplementation(QSslConfiguration &) const;
162%End
163%If (PyQt_SSL)
164    virtual void setSslConfigurationImplementation(const QSslConfiguration &);
165%End
166%If (PyQt_SSL)
167    virtual void ignoreSslErrorsImplementation(const QList<QSslError> &);
168%End
169};
170