qwebsocket.sip 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // qwebsocket.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWebSockets 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. %If (Qt_6_2_0 -)
  22. class QWebSocket : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qwebsocket.h>
  26. %End
  27. %ConvertToSubClassCode
  28. static struct class_graph {
  29. const char *name;
  30. sipTypeDef **type;
  31. int yes, no;
  32. } graph[] = {
  33. {sipName_QWebSocket, &sipType_QWebSocket, -1, 1},
  34. {sipName_QWebSocketServer, &sipType_QWebSocketServer, -1, 2},
  35. {sipName_QMaskGenerator, &sipType_QMaskGenerator, -1, -1},
  36. };
  37. int i = 0;
  38. sipType = NULL;
  39. do
  40. {
  41. struct class_graph *cg = &graph[i];
  42. if (cg->name != NULL && sipCpp->inherits(cg->name))
  43. {
  44. sipType = *cg->type;
  45. i = cg->yes;
  46. }
  47. else
  48. i = cg->no;
  49. }
  50. while (i >= 0);
  51. %End
  52. public:
  53. QWebSocket(const QString &origin = QString(), QWebSocketProtocol::Version version = QWebSocketProtocol::VersionLatest, QObject *parent /TransferThis/ = 0);
  54. virtual ~QWebSocket();
  55. void abort();
  56. QAbstractSocket::SocketError error() const;
  57. QString errorString() const;
  58. bool flush() /ReleaseGIL/;
  59. bool isValid() const;
  60. QHostAddress localAddress() const;
  61. quint16 localPort() const;
  62. QAbstractSocket::PauseModes pauseMode() const;
  63. QHostAddress peerAddress() const;
  64. QString peerName() const;
  65. quint16 peerPort() const;
  66. QNetworkProxy proxy() const;
  67. void setProxy(const QNetworkProxy &networkProxy);
  68. void setMaskGenerator(const QMaskGenerator *maskGenerator /KeepReference/);
  69. const QMaskGenerator *maskGenerator() const;
  70. qint64 readBufferSize() const;
  71. void setReadBufferSize(qint64 size);
  72. void resume() /ReleaseGIL/;
  73. void setPauseMode(QAbstractSocket::PauseModes pauseMode);
  74. QAbstractSocket::SocketState state() const;
  75. QWebSocketProtocol::Version version() const;
  76. QString resourceName() const;
  77. QUrl requestUrl() const;
  78. QString origin() const;
  79. QWebSocketProtocol::CloseCode closeCode() const;
  80. QString closeReason() const;
  81. qint64 sendTextMessage(const QString &message) /ReleaseGIL/;
  82. qint64 sendBinaryMessage(const QByteArray &data) /ReleaseGIL/;
  83. %If (PyQt_SSL)
  84. void ignoreSslErrors(const QList<QSslError> &errors);
  85. %End
  86. %If (PyQt_SSL)
  87. void setSslConfiguration(const QSslConfiguration &sslConfiguration);
  88. %End
  89. %If (PyQt_SSL)
  90. QSslConfiguration sslConfiguration() const;
  91. %End
  92. QNetworkRequest request() const;
  93. public slots:
  94. void close(QWebSocketProtocol::CloseCode closeCode = QWebSocketProtocol::CloseCodeNormal, const QString &reason = QString()) /ReleaseGIL/;
  95. %If (Qt_6_4_0 -)
  96. void open(const QNetworkRequest &request, const QWebSocketHandshakeOptions &options) /ReleaseGIL/;
  97. %End
  98. %If (Qt_6_4_0 -)
  99. void open(const QUrl &url, const QWebSocketHandshakeOptions &options) /ReleaseGIL/;
  100. %End
  101. void open(const QUrl &url) /ReleaseGIL/;
  102. void open(const QNetworkRequest &request) /ReleaseGIL/;
  103. void ping(const QByteArray &payload = QByteArray()) /ReleaseGIL/;
  104. %If (PyQt_SSL)
  105. void ignoreSslErrors();
  106. %End
  107. signals:
  108. void aboutToClose();
  109. void connected();
  110. void disconnected();
  111. void stateChanged(QAbstractSocket::SocketState state);
  112. void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *pAuthenticator);
  113. void readChannelFinished();
  114. void textFrameReceived(const QString &frame, bool isLastFrame);
  115. void binaryFrameReceived(const QByteArray &frame, bool isLastFrame);
  116. void textMessageReceived(const QString &message);
  117. void binaryMessageReceived(const QByteArray &message);
  118. void error(QAbstractSocket::SocketError error);
  119. void pong(quint64 elapsedTime, const QByteArray &payload);
  120. void bytesWritten(qint64 bytes);
  121. %If (PyQt_SSL)
  122. void sslErrors(const QList<QSslError> &errors);
  123. %End
  124. %If (PyQt_SSL)
  125. void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
  126. %End
  127. public:
  128. qint64 bytesToWrite() const;
  129. void setMaxAllowedIncomingFrameSize(quint64 maxAllowedIncomingFrameSize);
  130. quint64 maxAllowedIncomingFrameSize() const;
  131. void setMaxAllowedIncomingMessageSize(quint64 maxAllowedIncomingMessageSize);
  132. quint64 maxAllowedIncomingMessageSize() const;
  133. static quint64 maxIncomingMessageSize();
  134. static quint64 maxIncomingFrameSize();
  135. void setOutgoingFrameSize(quint64 outgoingFrameSize);
  136. quint64 outgoingFrameSize() const;
  137. static quint64 maxOutgoingFrameSize();
  138. void continueInterruptedHandshake();
  139. signals:
  140. %If (PyQt_SSL)
  141. void peerVerifyError(const QSslError &error);
  142. %End
  143. %If (PyQt_SSL)
  144. void alertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description);
  145. %End
  146. %If (PyQt_SSL)
  147. void alertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description);
  148. %End
  149. %If (PyQt_SSL)
  150. void handshakeInterruptedOnError(const QSslError &error);
  151. %End
  152. public:
  153. %If (Qt_6_4_0 -)
  154. QWebSocketHandshakeOptions handshakeOptions() const;
  155. %End
  156. %If (Qt_6_4_0 -)
  157. QString subprotocol() const;
  158. %End
  159. signals:
  160. %If (Qt_6_5_0 -)
  161. void errorOccurred(QAbstractSocket::SocketError error);
  162. %End
  163. %If (Qt_6_6_0 -)
  164. void authenticationRequired(QAuthenticator *authenticator);
  165. %End
  166. };
  167. %End