QtWebSockets.pyi 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. # Copyright (C) 2022 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. This file contains the exact signatures for all functions in module
  5. PySide6.QtWebSockets, except for defaults which are replaced by "...".
  6. """
  7. # mypy: disable-error-code="override, overload-overlap"
  8. # Module `PySide6.QtWebSockets`
  9. import PySide6.QtWebSockets
  10. import PySide6.QtCore
  11. import PySide6.QtNetwork
  12. import os
  13. import enum
  14. import typing
  15. import collections.abc
  16. from PySide6.QtCore import Signal
  17. from shiboken6 import Shiboken
  18. class QIntList: ...
  19. class QMaskGenerator(PySide6.QtCore.QObject):
  20. def __init__(self, /, parent: PySide6.QtCore.QObject | None = ...) -> None: ...
  21. def nextMask(self, /) -> int: ...
  22. def seed(self, /) -> bool: ...
  23. class QWebSocket(PySide6.QtCore.QObject):
  24. aboutToClose : typing.ClassVar[Signal] = ... # aboutToClose()
  25. alertReceived : typing.ClassVar[Signal] = ... # alertReceived(QSsl::AlertLevel,QSsl::AlertType,QString)
  26. alertSent : typing.ClassVar[Signal] = ... # alertSent(QSsl::AlertLevel,QSsl::AlertType,QString)
  27. authenticationRequired : typing.ClassVar[Signal] = ... # authenticationRequired(QAuthenticator*)
  28. binaryFrameReceived : typing.ClassVar[Signal] = ... # binaryFrameReceived(QByteArray,bool)
  29. binaryMessageReceived : typing.ClassVar[Signal] = ... # binaryMessageReceived(QByteArray)
  30. bytesWritten : typing.ClassVar[Signal] = ... # bytesWritten(qlonglong)
  31. connected : typing.ClassVar[Signal] = ... # connected()
  32. disconnected : typing.ClassVar[Signal] = ... # disconnected()
  33. error : typing.ClassVar[Signal] = ... # error(QAbstractSocket::SocketError)
  34. errorOccurred : typing.ClassVar[Signal] = ... # errorOccurred(QAbstractSocket::SocketError)
  35. handshakeInterruptedOnError: typing.ClassVar[Signal] = ... # handshakeInterruptedOnError(QSslError)
  36. peerVerifyError : typing.ClassVar[Signal] = ... # peerVerifyError(QSslError)
  37. pong : typing.ClassVar[Signal] = ... # pong(qulonglong,QByteArray)
  38. preSharedKeyAuthenticationRequired: typing.ClassVar[Signal] = ... # preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)
  39. proxyAuthenticationRequired: typing.ClassVar[Signal] = ... # proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)
  40. readChannelFinished : typing.ClassVar[Signal] = ... # readChannelFinished()
  41. sslErrors : typing.ClassVar[Signal] = ... # sslErrors(QList<QSslError>)
  42. stateChanged : typing.ClassVar[Signal] = ... # stateChanged(QAbstractSocket::SocketState)
  43. textFrameReceived : typing.ClassVar[Signal] = ... # textFrameReceived(QString,bool)
  44. textMessageReceived : typing.ClassVar[Signal] = ... # textMessageReceived(QString)
  45. def __init__(self, /, origin: str = ..., version: PySide6.QtWebSockets.QWebSocketProtocol.Version = ..., parent: PySide6.QtCore.QObject | None = ...) -> None: ...
  46. def abort(self, /) -> None: ...
  47. def bytesToWrite(self, /) -> int: ...
  48. def close(self, /, closeCode: PySide6.QtWebSockets.QWebSocketProtocol.CloseCode = ..., reason: str = ...) -> None: ...
  49. def closeCode(self, /) -> PySide6.QtWebSockets.QWebSocketProtocol.CloseCode: ...
  50. def closeReason(self, /) -> str: ...
  51. def continueInterruptedHandshake(self, /) -> None: ...
  52. def errorString(self, /) -> str: ...
  53. def flush(self, /) -> bool: ...
  54. def handshakeOptions(self, /) -> PySide6.QtWebSockets.QWebSocketHandshakeOptions: ...
  55. @typing.overload
  56. def ignoreSslErrors(self, /) -> None: ...
  57. @typing.overload
  58. def ignoreSslErrors(self, errors: collections.abc.Sequence[PySide6.QtNetwork.QSslError], /) -> None: ...
  59. def isValid(self, /) -> bool: ...
  60. def localAddress(self, /) -> PySide6.QtNetwork.QHostAddress: ...
  61. def localPort(self, /) -> int: ...
  62. def maskGenerator(self, /) -> PySide6.QtWebSockets.QMaskGenerator: ...
  63. def maxAllowedIncomingFrameSize(self, /) -> int: ...
  64. def maxAllowedIncomingMessageSize(self, /) -> int: ...
  65. @staticmethod
  66. def maxIncomingFrameSize() -> int: ...
  67. @staticmethod
  68. def maxIncomingMessageSize() -> int: ...
  69. @staticmethod
  70. def maxOutgoingFrameSize() -> int: ...
  71. @typing.overload
  72. def open(self, request: PySide6.QtNetwork.QNetworkRequest, /) -> None: ...
  73. @typing.overload
  74. def open(self, request: PySide6.QtNetwork.QNetworkRequest, options: PySide6.QtWebSockets.QWebSocketHandshakeOptions, /) -> None: ...
  75. @typing.overload
  76. def open(self, url: PySide6.QtCore.QUrl | str, /) -> None: ...
  77. @typing.overload
  78. def open(self, url: PySide6.QtCore.QUrl | str, options: PySide6.QtWebSockets.QWebSocketHandshakeOptions, /) -> None: ...
  79. def origin(self, /) -> str: ...
  80. def outgoingFrameSize(self, /) -> int: ...
  81. def pauseMode(self, /) -> PySide6.QtNetwork.QAbstractSocket.PauseMode: ...
  82. def peerAddress(self, /) -> PySide6.QtNetwork.QHostAddress: ...
  83. def peerName(self, /) -> str: ...
  84. def peerPort(self, /) -> int: ...
  85. def ping(self, /, payload: PySide6.QtCore.QByteArray | bytes | bytearray | memoryview = ...) -> None: ...
  86. def proxy(self, /) -> PySide6.QtNetwork.QNetworkProxy: ...
  87. def readBufferSize(self, /) -> int: ...
  88. def request(self, /) -> PySide6.QtNetwork.QNetworkRequest: ...
  89. def requestUrl(self, /) -> PySide6.QtCore.QUrl: ...
  90. def resourceName(self, /) -> str: ...
  91. def resume(self, /) -> None: ...
  92. def sendBinaryMessage(self, data: PySide6.QtCore.QByteArray | bytes | bytearray | memoryview, /) -> int: ...
  93. def sendTextMessage(self, message: str, /) -> int: ...
  94. def setMaskGenerator(self, maskGenerator: PySide6.QtWebSockets.QMaskGenerator, /) -> None: ...
  95. def setMaxAllowedIncomingFrameSize(self, maxAllowedIncomingFrameSize: int, /) -> None: ...
  96. def setMaxAllowedIncomingMessageSize(self, maxAllowedIncomingMessageSize: int, /) -> None: ...
  97. def setOutgoingFrameSize(self, outgoingFrameSize: int, /) -> None: ...
  98. def setPauseMode(self, pauseMode: PySide6.QtNetwork.QAbstractSocket.PauseMode, /) -> None: ...
  99. def setProxy(self, networkProxy: PySide6.QtNetwork.QNetworkProxy | PySide6.QtNetwork.QNetworkProxy.ProxyType, /) -> None: ...
  100. def setReadBufferSize(self, size: int, /) -> None: ...
  101. def setSslConfiguration(self, sslConfiguration: PySide6.QtNetwork.QSslConfiguration, /) -> None: ...
  102. def sslConfiguration(self, /) -> PySide6.QtNetwork.QSslConfiguration: ...
  103. def state(self, /) -> PySide6.QtNetwork.QAbstractSocket.SocketState: ...
  104. def subprotocol(self, /) -> str: ...
  105. def version(self, /) -> PySide6.QtWebSockets.QWebSocketProtocol.Version: ...
  106. class QWebSocketCorsAuthenticator(Shiboken.Object):
  107. @typing.overload
  108. def __init__(self, other: PySide6.QtWebSockets.QWebSocketCorsAuthenticator, /) -> None: ...
  109. @typing.overload
  110. def __init__(self, origin: str, /) -> None: ...
  111. def allowed(self, /) -> bool: ...
  112. def origin(self, /) -> str: ...
  113. def setAllowed(self, allowed: bool, /) -> None: ...
  114. def swap(self, other: PySide6.QtWebSockets.QWebSocketCorsAuthenticator, /) -> None: ...
  115. class QWebSocketHandshakeOptions(Shiboken.Object):
  116. @typing.overload
  117. def __init__(self, /) -> None: ...
  118. @typing.overload
  119. def __init__(self, other: PySide6.QtWebSockets.QWebSocketHandshakeOptions, /) -> None: ...
  120. def __copy__(self, /) -> typing.Self: ...
  121. def __eq__(self, rhs: PySide6.QtWebSockets.QWebSocketHandshakeOptions, /) -> bool: ...
  122. def __ne__(self, rhs: PySide6.QtWebSockets.QWebSocketHandshakeOptions, /) -> bool: ...
  123. def setSubprotocols(self, protocols: collections.abc.Sequence[str], /) -> None: ...
  124. def subprotocols(self, /) -> typing.List[str]: ...
  125. def swap(self, other: PySide6.QtWebSockets.QWebSocketHandshakeOptions, /) -> None: ...
  126. class QWebSocketProtocol(Shiboken.Object):
  127. class CloseCode(enum.Enum):
  128. CloseCodeNormal = 0x3e8
  129. CloseCodeGoingAway = 0x3e9
  130. CloseCodeProtocolError = 0x3ea
  131. CloseCodeDatatypeNotSupported = 0x3eb
  132. CloseCodeReserved1004 = 0x3ec
  133. CloseCodeMissingStatusCode = 0x3ed
  134. CloseCodeAbnormalDisconnection = 0x3ee
  135. CloseCodeWrongDatatype = 0x3ef
  136. CloseCodePolicyViolated = 0x3f0
  137. CloseCodeTooMuchData = 0x3f1
  138. CloseCodeMissingExtension = 0x3f2
  139. CloseCodeBadOperation = 0x3f3
  140. CloseCodeTlsHandshakeFailed = 0x3f7
  141. class Version(enum.Enum):
  142. VersionUnknown = -1
  143. Version0 = 0x0
  144. Version4 = 0x4
  145. Version5 = 0x5
  146. Version6 = 0x6
  147. Version7 = 0x7
  148. Version8 = 0x8
  149. Version13 = 0xd
  150. VersionLatest = 0xd
  151. class QWebSocketServer(PySide6.QtCore.QObject):
  152. acceptError : typing.ClassVar[Signal] = ... # acceptError(QAbstractSocket::SocketError)
  153. alertReceived : typing.ClassVar[Signal] = ... # alertReceived(QSsl::AlertLevel,QSsl::AlertType,QString)
  154. alertSent : typing.ClassVar[Signal] = ... # alertSent(QSsl::AlertLevel,QSsl::AlertType,QString)
  155. closed : typing.ClassVar[Signal] = ... # closed()
  156. handshakeInterruptedOnError: typing.ClassVar[Signal] = ... # handshakeInterruptedOnError(QSslError)
  157. newConnection : typing.ClassVar[Signal] = ... # newConnection()
  158. originAuthenticationRequired: typing.ClassVar[Signal] = ... # originAuthenticationRequired(QWebSocketCorsAuthenticator*)
  159. peerVerifyError : typing.ClassVar[Signal] = ... # peerVerifyError(QSslError)
  160. preSharedKeyAuthenticationRequired: typing.ClassVar[Signal] = ... # preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)
  161. serverError : typing.ClassVar[Signal] = ... # serverError(QWebSocketProtocol::CloseCode)
  162. sslErrors : typing.ClassVar[Signal] = ... # sslErrors(QList<QSslError>)
  163. class SslMode(enum.Enum):
  164. SecureMode = 0x0
  165. NonSecureMode = 0x1
  166. def __init__(self, serverName: str, secureMode: PySide6.QtWebSockets.QWebSocketServer.SslMode, /, parent: PySide6.QtCore.QObject | None = ...) -> None: ...
  167. def close(self, /) -> None: ...
  168. def error(self, /) -> PySide6.QtWebSockets.QWebSocketProtocol.CloseCode: ...
  169. def errorString(self, /) -> str: ...
  170. def handleConnection(self, socket: PySide6.QtNetwork.QTcpSocket, /) -> None: ...
  171. def handshakeTimeout(self, /) -> int: ...
  172. def handshakeTimeoutMS(self, /) -> int: ...
  173. def hasPendingConnections(self, /) -> bool: ...
  174. def isListening(self, /) -> bool: ...
  175. def listen(self, /, address: PySide6.QtNetwork.QHostAddress | PySide6.QtNetwork.QHostAddress.SpecialAddress = ..., port: int | None = ...) -> bool: ...
  176. def maxPendingConnections(self, /) -> int: ...
  177. def nativeDescriptor(self, /) -> int: ...
  178. def nextPendingConnection(self, /) -> PySide6.QtWebSockets.QWebSocket: ...
  179. def pauseAccepting(self, /) -> None: ...
  180. def proxy(self, /) -> PySide6.QtNetwork.QNetworkProxy: ...
  181. def resumeAccepting(self, /) -> None: ...
  182. def secureMode(self, /) -> PySide6.QtWebSockets.QWebSocketServer.SslMode: ...
  183. def serverAddress(self, /) -> PySide6.QtNetwork.QHostAddress: ...
  184. def serverName(self, /) -> str: ...
  185. def serverPort(self, /) -> int: ...
  186. def serverUrl(self, /) -> PySide6.QtCore.QUrl: ...
  187. def setHandshakeTimeout(self, msec: int, /) -> None: ...
  188. def setMaxPendingConnections(self, numConnections: int, /) -> None: ...
  189. def setNativeDescriptor(self, descriptor: int, /) -> bool: ...
  190. def setProxy(self, networkProxy: PySide6.QtNetwork.QNetworkProxy | PySide6.QtNetwork.QNetworkProxy.ProxyType, /) -> None: ...
  191. def setServerName(self, serverName: str, /) -> None: ...
  192. def setSocketDescriptor(self, socketDescriptor: int, /) -> bool: ...
  193. def setSslConfiguration(self, sslConfiguration: PySide6.QtNetwork.QSslConfiguration, /) -> None: ...
  194. def setSupportedSubprotocols(self, protocols: collections.abc.Sequence[str], /) -> None: ...
  195. def socketDescriptor(self, /) -> int: ...
  196. def sslConfiguration(self, /) -> PySide6.QtNetwork.QSslConfiguration: ...
  197. def supportedSubprotocols(self, /) -> typing.List[str]: ...
  198. def supportedVersions(self, /) -> typing.List[PySide6.QtWebSockets.QWebSocketProtocol.Version]: ...
  199. # eof