qnetworkproxy.sip 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. // qnetworkproxy.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 QNetworkProxy
  22. {
  23. %TypeHeaderCode
  24. #include <qnetworkproxy.h>
  25. %End
  26. public:
  27. enum ProxyType
  28. {
  29. DefaultProxy,
  30. Socks5Proxy,
  31. NoProxy,
  32. HttpProxy,
  33. HttpCachingProxy,
  34. FtpCachingProxy,
  35. };
  36. QNetworkProxy();
  37. QNetworkProxy(QNetworkProxy::ProxyType type, const QString &hostName = QString(), quint16 port = 0, const QString &user = QString(), const QString &password = QString());
  38. QNetworkProxy(const QNetworkProxy &other);
  39. ~QNetworkProxy();
  40. void setType(QNetworkProxy::ProxyType type);
  41. QNetworkProxy::ProxyType type() const;
  42. void setUser(const QString &userName);
  43. QString user() const;
  44. void setPassword(const QString &password);
  45. QString password() const;
  46. void setHostName(const QString &hostName);
  47. QString hostName() const;
  48. void setPort(quint16 port);
  49. quint16 port() const;
  50. static void setApplicationProxy(const QNetworkProxy &proxy);
  51. static QNetworkProxy applicationProxy();
  52. bool isCachingProxy() const;
  53. bool isTransparentProxy() const;
  54. bool operator==(const QNetworkProxy &other) const;
  55. bool operator!=(const QNetworkProxy &other) const;
  56. enum Capability /BaseType=Flag/
  57. {
  58. TunnelingCapability,
  59. ListeningCapability,
  60. UdpTunnelingCapability,
  61. CachingCapability,
  62. HostNameLookupCapability,
  63. SctpTunnelingCapability,
  64. SctpListeningCapability,
  65. };
  66. typedef QFlags<QNetworkProxy::Capability> Capabilities;
  67. void setCapabilities(QNetworkProxy::Capabilities capab);
  68. QNetworkProxy::Capabilities capabilities() const;
  69. void swap(QNetworkProxy &other /Constrained/);
  70. QVariant header(QNetworkRequest::KnownHeaders header) const;
  71. void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
  72. bool hasRawHeader(const QByteArray &headerName) const;
  73. QList<QByteArray> rawHeaderList() const;
  74. QByteArray rawHeader(const QByteArray &headerName) const;
  75. void setRawHeader(const QByteArray &headerName, const QByteArray &value);
  76. %If (Qt_6_8_0 -)
  77. QHttpHeaders headers() const;
  78. %End
  79. %If (Qt_6_8_0 -)
  80. void setHeaders(const QHttpHeaders &newHeaders);
  81. %End
  82. };
  83. class QNetworkProxyQuery
  84. {
  85. %TypeHeaderCode
  86. #include <qnetworkproxy.h>
  87. %End
  88. public:
  89. enum QueryType
  90. {
  91. TcpSocket,
  92. UdpSocket,
  93. TcpServer,
  94. UrlRequest,
  95. SctpSocket,
  96. SctpServer,
  97. };
  98. QNetworkProxyQuery();
  99. QNetworkProxyQuery(const QUrl &requestUrl, QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::UrlRequest);
  100. QNetworkProxyQuery(const QString &hostname, int port, const QString &protocolTag = QString(), QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::TcpSocket);
  101. QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(), QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::TcpServer);
  102. QNetworkProxyQuery(const QNetworkProxyQuery &other);
  103. ~QNetworkProxyQuery();
  104. bool operator==(const QNetworkProxyQuery &other) const;
  105. bool operator!=(const QNetworkProxyQuery &other) const;
  106. QNetworkProxyQuery::QueryType queryType() const;
  107. void setQueryType(QNetworkProxyQuery::QueryType type);
  108. int peerPort() const;
  109. void setPeerPort(int port);
  110. QString peerHostName() const;
  111. void setPeerHostName(const QString &hostname);
  112. int localPort() const;
  113. void setLocalPort(int port);
  114. QString protocolTag() const;
  115. void setProtocolTag(const QString &protocolTag);
  116. QUrl url() const;
  117. void setUrl(const QUrl &url);
  118. void swap(QNetworkProxyQuery &other /Constrained/);
  119. };
  120. class QNetworkProxyFactory /Supertype=PyQt6.sip.wrapper/
  121. {
  122. %TypeHeaderCode
  123. #include <qnetworkproxy.h>
  124. %End
  125. public:
  126. QNetworkProxyFactory();
  127. virtual ~QNetworkProxyFactory();
  128. virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()) = 0;
  129. static void setApplicationProxyFactory(QNetworkProxyFactory *factory /Transfer/);
  130. static QList<QNetworkProxy> proxyForQuery(const QNetworkProxyQuery &query);
  131. static QList<QNetworkProxy> systemProxyForQuery(const QNetworkProxyQuery &query = QNetworkProxyQuery());
  132. static void setUseSystemConfiguration(bool enable);
  133. static bool usesSystemConfiguration();
  134. };