qnetworkreply.sip 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. // qnetworkreply.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNetwork Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QNetworkReply : public QIODevice
  22. {
  23. %TypeHeaderCode
  24. #include <qnetworkreply.h>
  25. %End
  26. public:
  27. enum NetworkError
  28. {
  29. NoError,
  30. ConnectionRefusedError,
  31. RemoteHostClosedError,
  32. HostNotFoundError,
  33. TimeoutError,
  34. OperationCanceledError,
  35. SslHandshakeFailedError,
  36. UnknownNetworkError,
  37. ProxyConnectionRefusedError,
  38. ProxyConnectionClosedError,
  39. ProxyNotFoundError,
  40. ProxyTimeoutError,
  41. ProxyAuthenticationRequiredError,
  42. UnknownProxyError,
  43. ContentAccessDenied,
  44. ContentOperationNotPermittedError,
  45. ContentNotFoundError,
  46. AuthenticationRequiredError,
  47. UnknownContentError,
  48. ProtocolUnknownError,
  49. ProtocolInvalidOperationError,
  50. ProtocolFailure,
  51. ContentReSendError,
  52. TemporaryNetworkFailureError,
  53. NetworkSessionFailedError,
  54. BackgroundRequestNotAllowedError,
  55. ContentConflictError,
  56. ContentGoneError,
  57. InternalServerError,
  58. OperationNotImplementedError,
  59. ServiceUnavailableError,
  60. UnknownServerError,
  61. TooManyRedirectsError,
  62. InsecureRedirectError,
  63. };
  64. virtual ~QNetworkReply();
  65. virtual void abort() = 0;
  66. virtual void close();
  67. virtual bool isSequential() const;
  68. qint64 readBufferSize() const;
  69. virtual void setReadBufferSize(qint64 size);
  70. QNetworkAccessManager *manager() const;
  71. QNetworkAccessManager::Operation operation() const;
  72. QNetworkRequest request() const;
  73. QNetworkReply::NetworkError error() const;
  74. QUrl url() const;
  75. QVariant header(QNetworkRequest::KnownHeaders header) const;
  76. %If (Qt_6_7_0 -)
  77. bool hasRawHeader(QAnyStringView headerName) const;
  78. %End
  79. %If (- Qt_6_7_0)
  80. bool hasRawHeader(const QByteArray &headerName) const;
  81. %End
  82. QList<QByteArray> rawHeaderList() const;
  83. %If (Qt_6_7_0 -)
  84. QByteArray rawHeader(QAnyStringView headerName) const;
  85. %End
  86. %If (- Qt_6_7_0)
  87. QByteArray rawHeader(const QByteArray &headerName) const;
  88. %End
  89. QVariant attribute(QNetworkRequest::Attribute code) const;
  90. %If (PyQt_SSL)
  91. QSslConfiguration sslConfiguration() const;
  92. %End
  93. %If (PyQt_SSL)
  94. void setSslConfiguration(const QSslConfiguration &configuration);
  95. %End
  96. public slots:
  97. virtual void ignoreSslErrors();
  98. signals:
  99. void metaDataChanged();
  100. void finished();
  101. %If (PyQt_SSL)
  102. void encrypted();
  103. %End
  104. void errorOccurred(QNetworkReply::NetworkError);
  105. %If (PyQt_SSL)
  106. void sslErrors(const QList<QSslError> &errors);
  107. %End
  108. void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
  109. void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
  110. %If (PyQt_SSL)
  111. void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
  112. %End
  113. void redirected(const QUrl &url);
  114. void redirectAllowed();
  115. protected:
  116. explicit QNetworkReply(QObject *parent /TransferThis/ = 0);
  117. virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
  118. %MethodCode
  119. sipBufferInfoDef bi;
  120. if (sipGetBufferInfo(a0, &bi) > 0)
  121. {
  122. Py_BEGIN_ALLOW_THREADS
  123. #if defined(SIP_PROTECTED_IS_PUBLIC)
  124. sipRes = sipSelfWasArg ?
  125. sipCpp->QNetworkReply::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
  126. sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
  127. #else
  128. sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
  129. bi.bi_len);
  130. #endif
  131. Py_END_ALLOW_THREADS
  132. sipReleaseBufferInfo(&bi);
  133. }
  134. else
  135. {
  136. sipIsErr = 1;
  137. }
  138. %End
  139. void setOperation(QNetworkAccessManager::Operation operation);
  140. void setRequest(const QNetworkRequest &request);
  141. void setError(QNetworkReply::NetworkError errorCode, const QString &errorString);
  142. void setUrl(const QUrl &url);
  143. void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
  144. void setRawHeader(const QByteArray &headerName, const QByteArray &value);
  145. void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
  146. void setFinished(bool finished);
  147. public:
  148. bool isFinished() const;
  149. bool isRunning() const;
  150. %If (PyQt_SSL)
  151. void ignoreSslErrors(const QList<QSslError> &errors);
  152. %End
  153. typedef std::pair<QByteArray, QByteArray> RawHeaderPair;
  154. const QList<std::pair<QByteArray, QByteArray>> &rawHeaderPairs() const;
  155. protected:
  156. %If (PyQt_SSL)
  157. virtual void sslConfigurationImplementation(QSslConfiguration &) const;
  158. %End
  159. %If (PyQt_SSL)
  160. virtual void setSslConfigurationImplementation(const QSslConfiguration &);
  161. %End
  162. %If (PyQt_SSL)
  163. virtual void ignoreSslErrorsImplementation(const QList<QSslError> &);
  164. %End
  165. signals:
  166. %If (Qt_6_3_0 -)
  167. void socketStartedConnecting();
  168. %End
  169. %If (Qt_6_3_0 -)
  170. void requestSent();
  171. %End
  172. public:
  173. %If (Qt_6_8_0 -)
  174. QHttpHeaders headers() const;
  175. %End
  176. protected:
  177. %If (Qt_6_8_0 -)
  178. void setHeaders(const QHttpHeaders &newHeaders);
  179. %End
  180. %If (Qt_6_8_0 -)
  181. void setWellKnownHeader(QHttpHeaders::WellKnownHeader name, QByteArrayView value);
  182. %End
  183. };