Fix tray visibility and message reception issues
- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Automatically generated configuration for PyQt6.QtNetwork.
|
||||
|
||||
sip-version = "6.14.0"
|
||||
sip-abi-version = "13.8"
|
||||
module-tags = ["Qt_6_10_0", "Linux"]
|
||||
module-disabled-features = []
|
||||
@@ -0,0 +1,94 @@
|
||||
// QtNetworkmod.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%Module(name=PyQt6.QtNetwork, keyword_arguments="Optional", use_limited_api=True)
|
||||
|
||||
%Import QtCore/QtCoremod.sip
|
||||
|
||||
%Copying
|
||||
Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
|
||||
This file is part of PyQt6.
|
||||
|
||||
This file may be used under the terms of the GNU General Public License
|
||||
version 3.0 as published by the Free Software Foundation and appearing in
|
||||
the file LICENSE included in the packaging of this file. Please review the
|
||||
following information to ensure the GNU General Public License version 3.0
|
||||
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
then you may purchase a commercial license. For more information contact
|
||||
info@riverbankcomputing.com.
|
||||
|
||||
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
%End
|
||||
|
||||
%DefaultSupertype PyQt6.sip.simplewrapper
|
||||
|
||||
%Include qabstractnetworkcache.sip
|
||||
%Include qabstractsocket.sip
|
||||
%Include qauthenticator.sip
|
||||
%Include qdnslookup.sip
|
||||
%Include qformdatabuilder.sip
|
||||
%Include qhostaddress.sip
|
||||
%Include qhostinfo.sip
|
||||
%Include qhstspolicy.sip
|
||||
%Include qhttp1configuration.sip
|
||||
%Include qhttp2configuration.sip
|
||||
%Include qhttpheaders.sip
|
||||
%Include qhttpmultipart.sip
|
||||
%Include qlocalserver.sip
|
||||
%Include qlocalsocket.sip
|
||||
%Include qnetworkaccessmanager.sip
|
||||
%Include qnetworkcookie.sip
|
||||
%Include qnetworkcookiejar.sip
|
||||
%Include qnetworkdatagram.sip
|
||||
%Include qnetworkdiskcache.sip
|
||||
%Include qnetworkinformation.sip
|
||||
%Include qnetworkinterface.sip
|
||||
%Include qnetworkproxy.sip
|
||||
%Include qnetworkreply.sip
|
||||
%Include qnetworkrequest.sip
|
||||
%Include qnetworkrequestfactory.sip
|
||||
%Include qocspresponse.sip
|
||||
%Include qpassworddigestor.sip
|
||||
%Include qrestaccessmanager.sip
|
||||
%Include qrestreply.sip
|
||||
%Include qssl.sip
|
||||
%Include qsslcertificate.sip
|
||||
%Include qsslcertificateextension.sip
|
||||
%Include qsslcipher.sip
|
||||
%Include qsslconfiguration.sip
|
||||
%Include qssldiffiehellmanparameters.sip
|
||||
%Include qsslellipticcurve.sip
|
||||
%Include qsslerror.sip
|
||||
%Include qsslkey.sip
|
||||
%Include qsslpresharedkeyauthenticator.sip
|
||||
%Include qsslserver.sip
|
||||
%Include qsslsocket.sip
|
||||
%Include qtcpserver.sip
|
||||
%Include qtcpsocket.sip
|
||||
%Include qudpsocket.sip
|
||||
%Include qpynetwork_qlist.sip
|
||||
%Include qpynetwork_qhash.sip
|
||||
%Include qpynetwork_qmap.sip
|
||||
@@ -0,0 +1,84 @@
|
||||
// qabstractnetworkcache.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkCacheMetaData
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstractnetworkcache.h>
|
||||
%End
|
||||
|
||||
typedef QList<std::pair<QByteArray, QByteArray>> RawHeaderList;
|
||||
typedef QHash<QNetworkRequest::Attribute, QVariant> AttributesMap;
|
||||
|
||||
public:
|
||||
QNetworkCacheMetaData();
|
||||
QNetworkCacheMetaData(const QNetworkCacheMetaData &other);
|
||||
~QNetworkCacheMetaData();
|
||||
bool operator==(const QNetworkCacheMetaData &other) const;
|
||||
bool operator!=(const QNetworkCacheMetaData &other) const;
|
||||
bool isValid() const;
|
||||
QUrl url() const;
|
||||
void setUrl(const QUrl &url);
|
||||
QNetworkCacheMetaData::RawHeaderList rawHeaders() const;
|
||||
void setRawHeaders(const QNetworkCacheMetaData::RawHeaderList &headers);
|
||||
QDateTime lastModified() const;
|
||||
void setLastModified(const QDateTime &dateTime);
|
||||
QDateTime expirationDate() const;
|
||||
void setExpirationDate(const QDateTime &dateTime);
|
||||
bool saveToDisk() const;
|
||||
void setSaveToDisk(bool allow);
|
||||
QNetworkCacheMetaData::AttributesMap attributes() const;
|
||||
void setAttributes(const QNetworkCacheMetaData::AttributesMap &attributes);
|
||||
void swap(QNetworkCacheMetaData &other /Constrained/);
|
||||
%If (Qt_6_8_0 -)
|
||||
QHttpHeaders headers() const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setHeaders(const QHttpHeaders &headers);
|
||||
%End
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &, const QNetworkCacheMetaData & /Constrained/) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QNetworkCacheMetaData & /Constrained/) /ReleaseGIL/;
|
||||
|
||||
class QAbstractNetworkCache : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstractnetworkcache.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QAbstractNetworkCache();
|
||||
virtual QNetworkCacheMetaData metaData(const QUrl &url) = 0;
|
||||
virtual void updateMetaData(const QNetworkCacheMetaData &metaData) = 0;
|
||||
virtual QIODevice *data(const QUrl &url) = 0 /Factory/;
|
||||
virtual bool remove(const QUrl &url) = 0;
|
||||
virtual qint64 cacheSize() const = 0;
|
||||
virtual QIODevice *prepare(const QNetworkCacheMetaData &metaData) = 0;
|
||||
virtual void insert(QIODevice *device) = 0;
|
||||
|
||||
public slots:
|
||||
virtual void clear() = 0;
|
||||
|
||||
protected:
|
||||
explicit QAbstractNetworkCache(QObject *parent /TransferThis/ = 0);
|
||||
};
|
||||
@@ -0,0 +1,330 @@
|
||||
// qabstractsocket.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QAbstractSocket : public QIODevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qabstractsocket.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
static struct class_graph {
|
||||
const char *name;
|
||||
sipTypeDef **type;
|
||||
int yes, no;
|
||||
} graph[] = {
|
||||
{sipName_QAbstractNetworkCache, &sipType_QAbstractNetworkCache, 11, 1},
|
||||
{sipName_QAbstractSocket, &sipType_QAbstractSocket, 12, 2},
|
||||
{sipName_QDnsLookup, &sipType_QDnsLookup, -1, 3},
|
||||
{sipName_QHttpMultiPart, &sipType_QHttpMultiPart, -1, 4},
|
||||
{sipName_QLocalServer, &sipType_QLocalServer, -1, 5},
|
||||
{sipName_QLocalSocket, &sipType_QLocalSocket, -1, 6},
|
||||
{sipName_QNetworkAccessManager, &sipType_QNetworkAccessManager, -1, 7},
|
||||
{sipName_QNetworkCookieJar, &sipType_QNetworkCookieJar, -1, 8},
|
||||
#if QT_VERSION >= 0x060100
|
||||
{sipName_QNetworkInformation, &sipType_QNetworkInformation, -1, 9},
|
||||
#else
|
||||
{0, 0, -1, 9},
|
||||
#endif
|
||||
{sipName_QNetworkReply, &sipType_QNetworkReply, -1, 10},
|
||||
{sipName_QTcpServer, &sipType_QTcpServer, 15, -1},
|
||||
{sipName_QNetworkDiskCache, &sipType_QNetworkDiskCache, -1, -1},
|
||||
{sipName_QTcpSocket, &sipType_QTcpSocket, 14, 13},
|
||||
{sipName_QUdpSocket, &sipType_QUdpSocket, -1, -1},
|
||||
#if defined(SIP_FEATURE_PyQt_SSL)
|
||||
{sipName_QSslSocket, &sipType_QSslSocket, -1, -1},
|
||||
#else
|
||||
{0, 0, -1, -1},
|
||||
#endif
|
||||
#if QT_VERSION >= 0x060400 && defined(SIP_FEATURE_PyQt_SSL)
|
||||
{sipName_QSslServer, &sipType_QSslServer, -1, -1},
|
||||
#else
|
||||
{0, 0, -1, -1},
|
||||
#endif
|
||||
};
|
||||
|
||||
int i = 0;
|
||||
|
||||
sipType = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
struct class_graph *cg = &graph[i];
|
||||
|
||||
if (cg->name != NULL && sipCpp->inherits(cg->name))
|
||||
{
|
||||
sipType = *cg->type;
|
||||
i = cg->yes;
|
||||
}
|
||||
else
|
||||
i = cg->no;
|
||||
}
|
||||
while (i >= 0);
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SocketType
|
||||
{
|
||||
TcpSocket,
|
||||
UdpSocket,
|
||||
SctpSocket,
|
||||
UnknownSocketType,
|
||||
};
|
||||
|
||||
enum NetworkLayerProtocol
|
||||
{
|
||||
IPv4Protocol,
|
||||
IPv6Protocol,
|
||||
AnyIPProtocol,
|
||||
UnknownNetworkLayerProtocol,
|
||||
};
|
||||
|
||||
enum SocketError
|
||||
{
|
||||
ConnectionRefusedError,
|
||||
RemoteHostClosedError,
|
||||
HostNotFoundError,
|
||||
SocketAccessError,
|
||||
SocketResourceError,
|
||||
SocketTimeoutError,
|
||||
DatagramTooLargeError,
|
||||
NetworkError,
|
||||
AddressInUseError,
|
||||
SocketAddressNotAvailableError,
|
||||
UnsupportedSocketOperationError,
|
||||
UnfinishedSocketOperationError,
|
||||
ProxyAuthenticationRequiredError,
|
||||
SslHandshakeFailedError,
|
||||
ProxyConnectionRefusedError,
|
||||
ProxyConnectionClosedError,
|
||||
ProxyConnectionTimeoutError,
|
||||
ProxyNotFoundError,
|
||||
ProxyProtocolError,
|
||||
OperationError,
|
||||
SslInternalError,
|
||||
SslInvalidUserDataError,
|
||||
TemporaryError,
|
||||
UnknownSocketError,
|
||||
};
|
||||
|
||||
enum SocketState
|
||||
{
|
||||
UnconnectedState,
|
||||
HostLookupState,
|
||||
ConnectingState,
|
||||
ConnectedState,
|
||||
BoundState,
|
||||
ListeningState,
|
||||
ClosingState,
|
||||
};
|
||||
|
||||
QAbstractSocket(QAbstractSocket::SocketType socketType, QObject *parent /TransferThis/);
|
||||
virtual ~QAbstractSocket();
|
||||
virtual void connectToHost(const QString &hostName, quint16 port, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
|
||||
void connectToHost(const QHostAddress &address, quint16 port, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
|
||||
virtual void disconnectFromHost() /ReleaseGIL/;
|
||||
bool isValid() const;
|
||||
virtual qint64 bytesAvailable() const;
|
||||
virtual qint64 bytesToWrite() const;
|
||||
quint16 localPort() const;
|
||||
QHostAddress localAddress() const;
|
||||
quint16 peerPort() const;
|
||||
QHostAddress peerAddress() const;
|
||||
QString peerName() const;
|
||||
qint64 readBufferSize() const;
|
||||
virtual void setReadBufferSize(qint64 size);
|
||||
void abort();
|
||||
virtual bool setSocketDescriptor(qintptr socketDescriptor, QAbstractSocket::SocketState state = QAbstractSocket::ConnectedState, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite);
|
||||
virtual qintptr socketDescriptor() const;
|
||||
QAbstractSocket::SocketType socketType() const;
|
||||
QAbstractSocket::SocketState state() const;
|
||||
QAbstractSocket::SocketError error() const;
|
||||
virtual void close();
|
||||
virtual bool isSequential() const;
|
||||
bool flush() /ReleaseGIL/;
|
||||
virtual bool waitForConnected(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForReadyRead(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForBytesWritten(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForDisconnected(int msecs = 30000) /ReleaseGIL/;
|
||||
void setProxy(const QNetworkProxy &networkProxy);
|
||||
QNetworkProxy proxy() const;
|
||||
|
||||
signals:
|
||||
void hostFound();
|
||||
void connected();
|
||||
void disconnected();
|
||||
void stateChanged(QAbstractSocket::SocketState);
|
||||
void errorOccurred(QAbstractSocket::SocketError);
|
||||
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
|
||||
|
||||
protected:
|
||||
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="bytes",ReleaseGIL/ [qint64 (char *data, qint64 maxlen)];
|
||||
%MethodCode
|
||||
// Return the data read or None if there was an error.
|
||||
if (a0 < 0)
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *s = new char[a0];
|
||||
qint64 len;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
len = sipSelfWasArg ? sipCpp->QAbstractSocket::readData(s, a0) : sipCpp->readData(s, a0);
|
||||
#else
|
||||
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = PyBytes_FromStringAndSize(s, len);
|
||||
|
||||
if (!sipRes)
|
||||
sipIsErr = 1;
|
||||
}
|
||||
|
||||
delete[] s;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual SIP_PYOBJECT readLineData(qint64 maxlen) /TypeHint="bytes",ReleaseGIL/ [qint64 (char *data, qint64 maxlen)];
|
||||
%MethodCode
|
||||
// Return the data read or None if there was an error.
|
||||
if (a0 < 0)
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *s = new char[a0];
|
||||
qint64 len;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
len = sipSelfWasArg ? sipCpp->QAbstractSocket::readLineData(s, a0) : sipCpp->readLineData(s, a0);
|
||||
#else
|
||||
len = sipCpp->sipProtectVirt_readLineData(sipSelfWasArg, s, a0);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = PyBytes_FromStringAndSize(s, len);
|
||||
|
||||
if (!sipRes)
|
||||
sipIsErr = 1;
|
||||
}
|
||||
|
||||
delete[] s;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
|
||||
%MethodCode
|
||||
sipBufferInfoDef bi;
|
||||
|
||||
if (sipGetBufferInfo(a0, &bi) > 0)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
sipRes = sipSelfWasArg ?
|
||||
sipCpp->QAbstractSocket::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
|
||||
sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
|
||||
#else
|
||||
sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
|
||||
bi.bi_len);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
sipReleaseBufferInfo(&bi);
|
||||
}
|
||||
else
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual qint64 skipData(qint64 maxSize) /ReleaseGIL/;
|
||||
void setSocketState(QAbstractSocket::SocketState state);
|
||||
void setSocketError(QAbstractSocket::SocketError socketError);
|
||||
void setLocalPort(quint16 port);
|
||||
void setLocalAddress(const QHostAddress &address);
|
||||
void setPeerPort(quint16 port);
|
||||
void setPeerAddress(const QHostAddress &address);
|
||||
void setPeerName(const QString &name);
|
||||
|
||||
public:
|
||||
enum SocketOption
|
||||
{
|
||||
LowDelayOption,
|
||||
KeepAliveOption,
|
||||
MulticastTtlOption,
|
||||
MulticastLoopbackOption,
|
||||
TypeOfServiceOption,
|
||||
SendBufferSizeSocketOption,
|
||||
ReceiveBufferSizeSocketOption,
|
||||
PathMtuSocketOption,
|
||||
};
|
||||
|
||||
virtual void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
|
||||
virtual QVariant socketOption(QAbstractSocket::SocketOption option);
|
||||
|
||||
enum BindFlag /BaseType=Flag/
|
||||
{
|
||||
DefaultForPlatform,
|
||||
ShareAddress,
|
||||
DontShareAddress,
|
||||
ReuseAddressHint,
|
||||
};
|
||||
|
||||
typedef QFlags<QAbstractSocket::BindFlag> BindMode;
|
||||
|
||||
enum PauseMode /BaseType=Flag/
|
||||
{
|
||||
PauseNever,
|
||||
PauseOnSslErrors,
|
||||
};
|
||||
|
||||
typedef QFlags<QAbstractSocket::PauseMode> PauseModes;
|
||||
virtual void resume() /ReleaseGIL/;
|
||||
QAbstractSocket::PauseModes pauseMode() const;
|
||||
void setPauseMode(QAbstractSocket::PauseModes pauseMode);
|
||||
virtual bool bind(const QHostAddress &address, quint16 port = 0, QAbstractSocket::BindMode mode = QAbstractSocket::DefaultForPlatform);
|
||||
bool bind(quint16 port = 0, QAbstractSocket::BindMode mode = QAbstractSocket::DefaultForPlatform);
|
||||
QString protocolTag() const;
|
||||
void setProtocolTag(const QString &tag);
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
// qauthenticator.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QAuthenticator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qauthenticator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QAuthenticator();
|
||||
QAuthenticator(const QAuthenticator &other);
|
||||
~QAuthenticator();
|
||||
bool operator==(const QAuthenticator &other) const;
|
||||
bool operator!=(const QAuthenticator &other) const;
|
||||
QString user() const;
|
||||
void setUser(const QString &user);
|
||||
QString password() const;
|
||||
void setPassword(const QString &password);
|
||||
QString realm() const;
|
||||
bool isNull() const;
|
||||
QVariant option(const QString &opt) const;
|
||||
QVariantHash options() const;
|
||||
void setOption(const QString &opt, const QVariant &value);
|
||||
};
|
||||
@@ -0,0 +1,310 @@
|
||||
// qdnslookup.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QDnsDomainNameRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDnsDomainNameRecord();
|
||||
QDnsDomainNameRecord(const QDnsDomainNameRecord &other);
|
||||
~QDnsDomainNameRecord();
|
||||
void swap(QDnsDomainNameRecord &other /Constrained/);
|
||||
QString name() const;
|
||||
quint32 timeToLive() const;
|
||||
QString value() const;
|
||||
};
|
||||
|
||||
class QDnsHostAddressRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDnsHostAddressRecord();
|
||||
QDnsHostAddressRecord(const QDnsHostAddressRecord &other);
|
||||
~QDnsHostAddressRecord();
|
||||
void swap(QDnsHostAddressRecord &other /Constrained/);
|
||||
QString name() const;
|
||||
quint32 timeToLive() const;
|
||||
QHostAddress value() const;
|
||||
};
|
||||
|
||||
class QDnsMailExchangeRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDnsMailExchangeRecord();
|
||||
QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other);
|
||||
~QDnsMailExchangeRecord();
|
||||
void swap(QDnsMailExchangeRecord &other /Constrained/);
|
||||
QString exchange() const;
|
||||
QString name() const;
|
||||
quint16 preference() const;
|
||||
quint32 timeToLive() const;
|
||||
};
|
||||
|
||||
class QDnsServiceRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDnsServiceRecord();
|
||||
QDnsServiceRecord(const QDnsServiceRecord &other);
|
||||
~QDnsServiceRecord();
|
||||
void swap(QDnsServiceRecord &other /Constrained/);
|
||||
QString name() const;
|
||||
quint16 port() const;
|
||||
quint16 priority() const;
|
||||
QString target() const;
|
||||
quint32 timeToLive() const;
|
||||
quint16 weight() const;
|
||||
};
|
||||
|
||||
class QDnsTextRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QDnsTextRecord();
|
||||
QDnsTextRecord(const QDnsTextRecord &other);
|
||||
~QDnsTextRecord();
|
||||
void swap(QDnsTextRecord &other /Constrained/);
|
||||
QString name() const;
|
||||
quint32 timeToLive() const;
|
||||
QList<QByteArray> values() const;
|
||||
};
|
||||
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
class QDnsTlsAssociationRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum class CertificateUsage : quint8
|
||||
{
|
||||
CertificateAuthorityConstrait,
|
||||
ServiceCertificateConstraint,
|
||||
TrustAnchorAssertion,
|
||||
DomainIssuedCertificate,
|
||||
PrivateUse,
|
||||
PKIX_TA,
|
||||
PKIX_EE,
|
||||
DANE_TA,
|
||||
DANE_EE,
|
||||
PrivCert,
|
||||
};
|
||||
|
||||
enum class Selector : quint8
|
||||
{
|
||||
FullCertificate,
|
||||
SubjectPublicKeyInfo,
|
||||
PrivateUse,
|
||||
Cert,
|
||||
SPKI,
|
||||
PrivSel,
|
||||
};
|
||||
|
||||
enum class MatchingType : quint8
|
||||
{
|
||||
Exact,
|
||||
Sha256,
|
||||
Sha512,
|
||||
PrivateUse,
|
||||
PrivMatch,
|
||||
};
|
||||
|
||||
QDnsTlsAssociationRecord();
|
||||
QDnsTlsAssociationRecord(const QDnsTlsAssociationRecord &other);
|
||||
~QDnsTlsAssociationRecord();
|
||||
void swap(QDnsTlsAssociationRecord &other /Constrained/);
|
||||
QString name() const;
|
||||
quint32 timeToLive() const;
|
||||
QDnsTlsAssociationRecord::CertificateUsage usage() const;
|
||||
QDnsTlsAssociationRecord::Selector selector() const;
|
||||
QDnsTlsAssociationRecord::MatchingType matchType() const;
|
||||
QByteArray value() const;
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
class QDnsLookup : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qdnslookup.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Error
|
||||
{
|
||||
NoError,
|
||||
ResolverError,
|
||||
OperationCancelledError,
|
||||
InvalidRequestError,
|
||||
InvalidReplyError,
|
||||
ServerFailureError,
|
||||
ServerRefusedError,
|
||||
NotFoundError,
|
||||
%If (Qt_6_6_0 -)
|
||||
TimeoutError,
|
||||
%End
|
||||
};
|
||||
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
enum Protocol : quint8
|
||||
{
|
||||
Standard,
|
||||
DnsOverTls,
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
enum Type
|
||||
{
|
||||
A,
|
||||
AAAA,
|
||||
ANY,
|
||||
CNAME,
|
||||
MX,
|
||||
NS,
|
||||
PTR,
|
||||
SRV,
|
||||
TXT,
|
||||
%If (Qt_6_8_0 -)
|
||||
TLSA,
|
||||
%End
|
||||
};
|
||||
|
||||
explicit QDnsLookup(QObject *parent /TransferThis/ = 0);
|
||||
QDnsLookup(QDnsLookup::Type type, const QString &name, QObject *parent /TransferThis/ = 0);
|
||||
QDnsLookup(QDnsLookup::Type type, const QString &name, const QHostAddress &nameserver, QObject *parent /TransferThis/ = 0);
|
||||
%If (Qt_6_6_0 -)
|
||||
QDnsLookup(QDnsLookup::Type type, const QString &name, const QHostAddress &nameserver, quint16 port, QObject *parent /TransferThis/ = 0);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
QDnsLookup(QDnsLookup::Type type, const QString &name, QDnsLookup::Protocol protocol, const QHostAddress &nameserver, quint16 port = 0, QObject *parent /TransferThis/ = 0);
|
||||
%End
|
||||
virtual ~QDnsLookup();
|
||||
QDnsLookup::Error error() const;
|
||||
QString errorString() const;
|
||||
bool isFinished() const;
|
||||
QString name() const;
|
||||
void setName(const QString &name);
|
||||
QDnsLookup::Type type() const;
|
||||
void setType(QDnsLookup::Type);
|
||||
QList<QDnsDomainNameRecord> canonicalNameRecords() const;
|
||||
QList<QDnsHostAddressRecord> hostAddressRecords() const;
|
||||
QList<QDnsMailExchangeRecord> mailExchangeRecords() const;
|
||||
QList<QDnsDomainNameRecord> nameServerRecords() const;
|
||||
QList<QDnsDomainNameRecord> pointerRecords() const;
|
||||
QList<QDnsServiceRecord> serviceRecords() const;
|
||||
QList<QDnsTextRecord> textRecords() const;
|
||||
|
||||
public slots:
|
||||
void abort() /ReleaseGIL/;
|
||||
void lookup() /ReleaseGIL/;
|
||||
|
||||
signals:
|
||||
void finished();
|
||||
void nameChanged(const QString &name);
|
||||
%If (Qt_6_8_0 -)
|
||||
void typeChanged(QDnsLookup::Type type);
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
void typeChanged(QDnsLookup::Type type /ScopesStripped=1/);
|
||||
%End
|
||||
|
||||
public:
|
||||
QHostAddress nameserver() const;
|
||||
void setNameserver(const QHostAddress &nameserver);
|
||||
%If (Qt_6_6_0 -)
|
||||
void setNameserver(const QHostAddress &nameserver, quint16 port);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setNameserver(QDnsLookup::Protocol protocol, const QHostAddress &nameserver, quint16 port = 0);
|
||||
%End
|
||||
|
||||
signals:
|
||||
void nameserverChanged(const QHostAddress &nameserver);
|
||||
|
||||
public:
|
||||
%If (Qt_6_6_0 -)
|
||||
quint16 nameserverPort() const;
|
||||
%End
|
||||
%If (Qt_6_6_0 -)
|
||||
void setNameserverPort(quint16 port);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_6_6_0 -)
|
||||
void nameserverPortChanged(quint16 port);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_6_8_0 -)
|
||||
bool isAuthenticData() const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
QDnsLookup::Protocol nameserverProtocol() const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setNameserverProtocol(QDnsLookup::Protocol protocol);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
QList<QDnsTlsAssociationRecord> tlsAssociationRecords() const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
%If (PyQt_SSL)
|
||||
void setSslConfiguration(const QSslConfiguration &sslConfiguration);
|
||||
%End
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
%If (PyQt_SSL)
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
%End
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
static bool isProtocolSupported(QDnsLookup::Protocol protocol);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
static quint16 defaultPortForProtocol(QDnsLookup::Protocol protocol);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_6_8_0 -)
|
||||
void nameserverProtocolChanged(QDnsLookup::Protocol protocol);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,74 @@
|
||||
// qformdatabuilder.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
class QFormDataPartBuilder
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qformdatabuilder.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QFormDataPartBuilder();
|
||||
QFormDataPartBuilder setBody(QByteArrayView data, QAnyStringView fileName = {}, QAnyStringView mimeType = {});
|
||||
QFormDataPartBuilder setBodyDevice(QIODevice *body, QAnyStringView fileName = {}, QAnyStringView mimeType = {});
|
||||
QFormDataPartBuilder setHeaders(const QHttpHeaders &headers);
|
||||
void swap(QFormDataPartBuilder &other /Constrained/);
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
class QFormDataBuilder
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qformdatabuilder.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum class Option
|
||||
{
|
||||
Default,
|
||||
OmitRfc8187EncodedFilename,
|
||||
UseRfc7578PercentEncodedFilename,
|
||||
PreferLatin1EncodedFilename,
|
||||
StrictRfc7578,
|
||||
};
|
||||
|
||||
typedef QFlags<QFormDataBuilder::Option> Options;
|
||||
QFormDataBuilder();
|
||||
~QFormDataBuilder();
|
||||
void swap(QFormDataBuilder &other /Constrained/);
|
||||
QFormDataPartBuilder part(QAnyStringView name);
|
||||
QHttpMultiPart *buildMultiPart(QFormDataBuilder::Options options = {}) /Factory/;
|
||||
%MethodCode
|
||||
sipRes = sipCpp->buildMultiPart(*a0).release();
|
||||
%End
|
||||
|
||||
private:
|
||||
%If (Qt_6_8_0 -)
|
||||
QFormDataBuilder(const QFormDataBuilder &);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,192 @@
|
||||
// qhostaddress.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QHostAddress /TypeHintIn="Union[QHostAddress, QHostAddress.SpecialAddress]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhostaddress.h>
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// SIP doesn't support automatic type convertors so we explicitly allow a
|
||||
// QHostAddress::SpecialAddress to be used whenever a QHostAddress is expected.
|
||||
|
||||
bool is_special_address = true;
|
||||
int special_address = sipConvertToEnum(sipPy, sipType_QHostAddress_SpecialAddress);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Clear();
|
||||
is_special_address = false;
|
||||
}
|
||||
|
||||
if (sipIsErr == NULL)
|
||||
return (is_special_address ||
|
||||
sipCanConvertToType(sipPy, sipType_QHostAddress, SIP_NO_CONVERTORS));
|
||||
|
||||
if (is_special_address)
|
||||
{
|
||||
*sipCppPtr = new QHostAddress(static_cast<QHostAddress::SpecialAddress>(special_address));
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
}
|
||||
|
||||
|
||||
*sipCppPtr = reinterpret_cast<QHostAddress *>(sipConvertToType(sipPy, sipType_QHostAddress, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
|
||||
|
||||
return 0;
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SpecialAddress
|
||||
{
|
||||
Null,
|
||||
Broadcast,
|
||||
LocalHost,
|
||||
LocalHostIPv6,
|
||||
AnyIPv4,
|
||||
AnyIPv6,
|
||||
Any,
|
||||
};
|
||||
|
||||
QHostAddress();
|
||||
QHostAddress(QHostAddress::SpecialAddress address /Constrained/);
|
||||
explicit QHostAddress(quint32 ip4Addr);
|
||||
explicit QHostAddress(const QString &address);
|
||||
explicit QHostAddress(const Q_IPV6ADDR &ip6Addr);
|
||||
QHostAddress(const QHostAddress ©);
|
||||
~QHostAddress();
|
||||
void setAddress(QHostAddress::SpecialAddress address /Constrained/);
|
||||
void setAddress(quint32 ip4Addr);
|
||||
bool setAddress(const QString &address);
|
||||
void setAddress(const Q_IPV6ADDR &ip6Addr);
|
||||
QAbstractSocket::NetworkLayerProtocol protocol() const;
|
||||
quint32 toIPv4Address(bool *ok = 0) const;
|
||||
Q_IPV6ADDR toIPv6Address() const;
|
||||
QString toString() const;
|
||||
QString scopeId() const;
|
||||
void setScopeId(const QString &id);
|
||||
bool operator==(const QHostAddress &address) const;
|
||||
bool operator==(QHostAddress::SpecialAddress address) const;
|
||||
bool operator!=(const QHostAddress &address) const;
|
||||
bool operator!=(QHostAddress::SpecialAddress address) const;
|
||||
bool isNull() const;
|
||||
void clear();
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
|
||||
bool isInSubnet(const QHostAddress &subnet, int netmask) const;
|
||||
bool isInSubnet(const std::pair<QHostAddress, int> &subnet) const;
|
||||
bool isLoopback() const;
|
||||
static std::pair<QHostAddress, int> parseSubnet(const QString &subnet);
|
||||
void swap(QHostAddress &other /Constrained/);
|
||||
bool isMulticast() const;
|
||||
|
||||
enum ConversionModeFlag /BaseType=Flag/
|
||||
{
|
||||
ConvertV4MappedToIPv4,
|
||||
ConvertV4CompatToIPv4,
|
||||
ConvertUnspecifiedAddress,
|
||||
ConvertLocalHost,
|
||||
TolerantConversion,
|
||||
StrictConversion,
|
||||
};
|
||||
|
||||
typedef QFlags<QHostAddress::ConversionModeFlag> ConversionMode;
|
||||
bool isEqual(const QHostAddress &address, QHostAddress::ConversionMode mode = QHostAddress::TolerantConversion) const;
|
||||
bool isGlobal() const;
|
||||
bool isLinkLocal() const;
|
||||
bool isSiteLocal() const;
|
||||
bool isUniqueLocalUnicast() const;
|
||||
bool isBroadcast() const;
|
||||
%If (Qt_6_6_0 -)
|
||||
bool isPrivateUse() const;
|
||||
%End
|
||||
};
|
||||
|
||||
bool operator==(QHostAddress::SpecialAddress address1, const QHostAddress &address2);
|
||||
bool operator!=(QHostAddress::SpecialAddress lhs, const QHostAddress &rhs);
|
||||
QDataStream &operator<<(QDataStream &, const QHostAddress &) /ReleaseGIL/;
|
||||
QDataStream &operator>>(QDataStream &, QHostAddress &) /ReleaseGIL/;
|
||||
// Q_IPV6ADDR is implemented as a Python 16-tuple of ints.
|
||||
%MappedType Q_IPV6ADDR /TypeHint="Tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhostaddress.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
// Create the tuple.
|
||||
PyObject *t;
|
||||
|
||||
if ((t = PyTuple_New(16)) == NULL)
|
||||
return NULL;
|
||||
|
||||
// Set the tuple elements.
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
PyObject *pobj;
|
||||
|
||||
if ((pobj = PyLong_FromLong((*sipCpp)[i])) == NULL)
|
||||
{
|
||||
Py_DECREF(t);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyTuple_SetItem(t, i, pobj);
|
||||
}
|
||||
|
||||
return t;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// Check the type if that is all that is required.
|
||||
if (sipIsErr == NULL)
|
||||
return (PySequence_Check(sipPy) && PySequence_Size(sipPy) == 16);
|
||||
|
||||
Q_IPV6ADDR *qa = new Q_IPV6ADDR;
|
||||
|
||||
for (Py_ssize_t i = 0; i < 16; ++i)
|
||||
{
|
||||
PyObject *itm = PySequence_GetItem(sipPy, i);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
delete qa;
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
(*qa)[i] = PyLong_AsLong(itm);
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
*sipCppPtr = qa;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
// qhostinfo.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QHostInfo
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhostinfo.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum HostInfoError
|
||||
{
|
||||
NoError,
|
||||
HostNotFound,
|
||||
UnknownError,
|
||||
};
|
||||
|
||||
explicit QHostInfo(int id = -1);
|
||||
QHostInfo(const QHostInfo &d);
|
||||
~QHostInfo();
|
||||
QString hostName() const;
|
||||
void setHostName(const QString &name);
|
||||
QList<QHostAddress> addresses() const;
|
||||
void setAddresses(const QList<QHostAddress> &addresses);
|
||||
QHostInfo::HostInfoError error() const;
|
||||
void setError(QHostInfo::HostInfoError error);
|
||||
QString errorString() const;
|
||||
void setErrorString(const QString &errorString);
|
||||
void setLookupId(int id);
|
||||
int lookupId() const;
|
||||
static int lookupHost(const QString &name, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot_signature;
|
||||
|
||||
if ((sipError = pyqt6_qtnetwork_get_connection_parts(a1, 0, "(QHostInfo)", true, &receiver, slot_signature)) == sipErrorNone)
|
||||
{
|
||||
QHostInfo::lookupHost(*a0, receiver, slot_signature.constData());
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(1, a1);
|
||||
}
|
||||
%End
|
||||
|
||||
static void abortHostLookup(int lookupId);
|
||||
static QHostInfo fromName(const QString &name);
|
||||
static QString localHostName();
|
||||
static QString localDomainName();
|
||||
void swap(QHostInfo &other /Constrained/);
|
||||
};
|
||||
|
||||
%ModuleHeaderCode
|
||||
// Imports from QtCore.
|
||||
typedef sipErrorState (*pyqt6_qtnetwork_get_connection_parts_t)(PyObject *, QObject *, const char *, bool, QObject **, QByteArray &);
|
||||
extern pyqt6_qtnetwork_get_connection_parts_t pyqt6_qtnetwork_get_connection_parts;
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Imports from QtCore.
|
||||
pyqt6_qtnetwork_get_connection_parts_t pyqt6_qtnetwork_get_connection_parts;
|
||||
%End
|
||||
|
||||
%PostInitialisationCode
|
||||
// Imports from QtCore.
|
||||
pyqt6_qtnetwork_get_connection_parts = (pyqt6_qtnetwork_get_connection_parts_t)sipImportSymbol("pyqt6_get_connection_parts");
|
||||
Q_ASSERT(pyqt6_qtnetwork_get_connection_parts);
|
||||
%End
|
||||
@@ -0,0 +1,51 @@
|
||||
// qhstspolicy.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QHstsPolicy
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhstspolicy.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum PolicyFlag /BaseType=Flag/
|
||||
{
|
||||
IncludeSubDomains,
|
||||
};
|
||||
|
||||
typedef QFlags<QHstsPolicy::PolicyFlag> PolicyFlags;
|
||||
QHstsPolicy();
|
||||
QHstsPolicy(const QDateTime &expiry, QHstsPolicy::PolicyFlags flags, const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode);
|
||||
QHstsPolicy(const QHstsPolicy &rhs);
|
||||
~QHstsPolicy();
|
||||
void swap(QHstsPolicy &other);
|
||||
void setHost(const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode);
|
||||
QString host(QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded) const;
|
||||
void setExpiry(const QDateTime &expiry);
|
||||
QDateTime expiry() const;
|
||||
void setIncludesSubDomains(bool include);
|
||||
bool includesSubDomains() const;
|
||||
bool isExpired() const;
|
||||
};
|
||||
|
||||
bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs);
|
||||
bool operator!=(const QHstsPolicy &lhs, const QHstsPolicy &rhs);
|
||||
@@ -0,0 +1,50 @@
|
||||
// qhttp1configuration.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_5_0 -)
|
||||
|
||||
class QHttp1Configuration
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhttp1configuration.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QHttp1Configuration();
|
||||
QHttp1Configuration(const QHttp1Configuration &other);
|
||||
~QHttp1Configuration();
|
||||
void setNumberOfConnectionsPerHost(qsizetype amount);
|
||||
qsizetype numberOfConnectionsPerHost() const;
|
||||
void swap(QHttp1Configuration &other);
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_6_5_0 -)
|
||||
bool operator==(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs);
|
||||
%End
|
||||
%If (Qt_6_5_0 -)
|
||||
bool operator!=(const QHttp1Configuration &lhs, const QHttp1Configuration &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,53 @@
|
||||
// qhttp2configuration.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QHttp2Configuration
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhttp2configuration.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QHttp2Configuration();
|
||||
QHttp2Configuration(const QHttp2Configuration &other);
|
||||
~QHttp2Configuration();
|
||||
void setServerPushEnabled(bool enable);
|
||||
bool serverPushEnabled() const;
|
||||
void setHuffmanCompressionEnabled(bool enable);
|
||||
bool huffmanCompressionEnabled() const;
|
||||
bool setSessionReceiveWindowSize(unsigned int size);
|
||||
unsigned int sessionReceiveWindowSize() const;
|
||||
bool setStreamReceiveWindowSize(unsigned int size);
|
||||
unsigned int streamReceiveWindowSize() const;
|
||||
bool setMaxFrameSize(unsigned int size);
|
||||
unsigned int maxFrameSize() const;
|
||||
void swap(QHttp2Configuration &other /Constrained/);
|
||||
%If (Qt_6_9_0 -)
|
||||
void setMaxConcurrentStreams(unsigned int value);
|
||||
%End
|
||||
%If (Qt_6_9_0 -)
|
||||
unsigned int maxConcurrentStreams() const;
|
||||
%End
|
||||
};
|
||||
|
||||
bool operator==(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs);
|
||||
bool operator!=(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs);
|
||||
@@ -0,0 +1,287 @@
|
||||
// qhttpheaders.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_7_0 -)
|
||||
|
||||
class QHttpHeaders
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhttpheaders.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum class WellKnownHeader
|
||||
{
|
||||
AIM,
|
||||
Accept,
|
||||
AcceptAdditions,
|
||||
AcceptCH,
|
||||
AcceptDatetime,
|
||||
AcceptEncoding,
|
||||
AcceptFeatures,
|
||||
AcceptLanguage,
|
||||
AcceptPatch,
|
||||
AcceptPost,
|
||||
AcceptRanges,
|
||||
AcceptSignature,
|
||||
AccessControlAllowCredentials,
|
||||
AccessControlAllowHeaders,
|
||||
AccessControlAllowMethods,
|
||||
AccessControlAllowOrigin,
|
||||
AccessControlExposeHeaders,
|
||||
AccessControlMaxAge,
|
||||
AccessControlRequestHeaders,
|
||||
AccessControlRequestMethod,
|
||||
Age,
|
||||
Allow,
|
||||
ALPN,
|
||||
AltSvc,
|
||||
AltUsed,
|
||||
Alternates,
|
||||
ApplyToRedirectRef,
|
||||
AuthenticationControl,
|
||||
AuthenticationInfo,
|
||||
Authorization,
|
||||
CacheControl,
|
||||
CacheStatus,
|
||||
CalManagedID,
|
||||
CalDAVTimezones,
|
||||
CapsuleProtocol,
|
||||
CDNCacheControl,
|
||||
CDNLoop,
|
||||
CertNotAfter,
|
||||
CertNotBefore,
|
||||
ClearSiteData,
|
||||
ClientCert,
|
||||
ClientCertChain,
|
||||
Close,
|
||||
Connection,
|
||||
ContentDigest,
|
||||
ContentDisposition,
|
||||
ContentEncoding,
|
||||
ContentID,
|
||||
ContentLanguage,
|
||||
ContentLength,
|
||||
ContentLocation,
|
||||
ContentRange,
|
||||
ContentSecurityPolicy,
|
||||
ContentSecurityPolicyReportOnly,
|
||||
ContentType,
|
||||
Cookie,
|
||||
CrossOriginEmbedderPolicy,
|
||||
CrossOriginEmbedderPolicyReportOnly,
|
||||
CrossOriginOpenerPolicy,
|
||||
CrossOriginOpenerPolicyReportOnly,
|
||||
CrossOriginResourcePolicy,
|
||||
DASL,
|
||||
Date,
|
||||
DAV,
|
||||
DeltaBase,
|
||||
Depth,
|
||||
Destination,
|
||||
DifferentialID,
|
||||
DPoP,
|
||||
DPoPNonce,
|
||||
EarlyData,
|
||||
ETag,
|
||||
Expect,
|
||||
ExpectCT,
|
||||
Expires,
|
||||
Forwarded,
|
||||
From,
|
||||
Hobareg,
|
||||
Host,
|
||||
If,
|
||||
IfMatch,
|
||||
IfModifiedSince,
|
||||
IfNoneMatch,
|
||||
IfRange,
|
||||
IfScheduleTagMatch,
|
||||
IfUnmodifiedSince,
|
||||
IM,
|
||||
IncludeReferredTokenBindingID,
|
||||
KeepAlive,
|
||||
Label,
|
||||
LastEventID,
|
||||
LastModified,
|
||||
Link,
|
||||
Location,
|
||||
LockToken,
|
||||
MaxForwards,
|
||||
MementoDatetime,
|
||||
Meter,
|
||||
MIMEVersion,
|
||||
Negotiate,
|
||||
NEL,
|
||||
ODataEntityId,
|
||||
ODataIsolation,
|
||||
ODataMaxVersion,
|
||||
ODataVersion,
|
||||
OptionalWWWAuthenticate,
|
||||
OrderingType,
|
||||
Origin,
|
||||
OriginAgentCluster,
|
||||
OSCORE,
|
||||
OSLCCoreVersion,
|
||||
Overwrite,
|
||||
PingFrom,
|
||||
PingTo,
|
||||
Position,
|
||||
Prefer,
|
||||
PreferenceApplied,
|
||||
Priority,
|
||||
ProxyAuthenticate,
|
||||
ProxyAuthenticationInfo,
|
||||
ProxyAuthorization,
|
||||
ProxyStatus,
|
||||
PublicKeyPins,
|
||||
PublicKeyPinsReportOnly,
|
||||
Range,
|
||||
RedirectRef,
|
||||
Referer,
|
||||
Refresh,
|
||||
ReplayNonce,
|
||||
ReprDigest,
|
||||
RetryAfter,
|
||||
ScheduleReply,
|
||||
ScheduleTag,
|
||||
SecPurpose,
|
||||
SecTokenBinding,
|
||||
SecWebSocketAccept,
|
||||
SecWebSocketExtensions,
|
||||
SecWebSocketKey,
|
||||
SecWebSocketProtocol,
|
||||
SecWebSocketVersion,
|
||||
Server,
|
||||
ServerTiming,
|
||||
SetCookie,
|
||||
Signature,
|
||||
SignatureInput,
|
||||
SLUG,
|
||||
SoapAction,
|
||||
StatusURI,
|
||||
StrictTransportSecurity,
|
||||
Sunset,
|
||||
SurrogateCapability,
|
||||
SurrogateControl,
|
||||
TCN,
|
||||
TE,
|
||||
Timeout,
|
||||
Topic,
|
||||
Traceparent,
|
||||
Tracestate,
|
||||
Trailer,
|
||||
TransferEncoding,
|
||||
TTL,
|
||||
Upgrade,
|
||||
Urgency,
|
||||
UserAgent,
|
||||
VariantVary,
|
||||
Vary,
|
||||
Via,
|
||||
WantContentDigest,
|
||||
WantReprDigest,
|
||||
WWWAuthenticate,
|
||||
XContentTypeOptions,
|
||||
XFrameOptions,
|
||||
AcceptCharset,
|
||||
CPEPInfo,
|
||||
Pragma,
|
||||
ProtocolInfo,
|
||||
ProtocolQuery,
|
||||
};
|
||||
|
||||
QHttpHeaders();
|
||||
QHttpHeaders(const QHttpHeaders &other);
|
||||
~QHttpHeaders();
|
||||
void swap(QHttpHeaders &other /Constrained/);
|
||||
bool append(QAnyStringView name, QAnyStringView value);
|
||||
bool append(QHttpHeaders::WellKnownHeader name, QAnyStringView value);
|
||||
bool insert(qsizetype i, QAnyStringView name, QAnyStringView value);
|
||||
bool insert(qsizetype i, QHttpHeaders::WellKnownHeader name, QAnyStringView value);
|
||||
bool replace(qsizetype i, QAnyStringView name, QAnyStringView newValue);
|
||||
bool replace(qsizetype i, QHttpHeaders::WellKnownHeader name, QAnyStringView newValue);
|
||||
bool contains(QAnyStringView name) const;
|
||||
bool contains(QHttpHeaders::WellKnownHeader name) const;
|
||||
void clear();
|
||||
void removeAll(QAnyStringView name);
|
||||
void removeAll(QHttpHeaders::WellKnownHeader name);
|
||||
void removeAt(qsizetype i);
|
||||
QByteArrayView value(QAnyStringView name, QByteArrayView defaultValue = {}) const;
|
||||
QByteArrayView value(QHttpHeaders::WellKnownHeader name, QByteArrayView defaultValue = {}) const;
|
||||
QList<QByteArray> values(QAnyStringView name) const;
|
||||
QList<QByteArray> values(QHttpHeaders::WellKnownHeader name) const;
|
||||
QByteArrayView valueAt(qsizetype i) const;
|
||||
QString nameAt(qsizetype i) const [QLatin1StringView (qsizetype i)];
|
||||
QByteArray combinedValue(QAnyStringView name) const;
|
||||
QByteArray combinedValue(QHttpHeaders::WellKnownHeader name) const;
|
||||
qsizetype size() const;
|
||||
void reserve(qsizetype size);
|
||||
bool isEmpty() const;
|
||||
static QByteArrayView wellKnownHeaderName(QHttpHeaders::WellKnownHeader name);
|
||||
static QHttpHeaders fromListOfPairs(const QList<std::pair<QByteArray, QByteArray>> &headers);
|
||||
QList<std::pair<QByteArray, QByteArray>> toListOfPairs() const;
|
||||
%If (Qt_6_8_0 -)
|
||||
bool replaceOrAppend(QHttpHeaders::WellKnownHeader name, QAnyStringView newValue);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
bool replaceOrAppend(QAnyStringView name, QAnyStringView newValue);
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<qint64> intValue(QHttpHeaders::WellKnownHeader name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<qint64> intValue(QAnyStringView name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QList<qint64>> intValues(QHttpHeaders::WellKnownHeader name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QList<qint64>> intValues(QAnyStringView name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<qint64> intValueAt(qsizetype i) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QDateTime> dateTimeValue(QHttpHeaders::WellKnownHeader name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QDateTime> dateTimeValue(QAnyStringView name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QList<QDateTime>> dateTimeValues(QHttpHeaders::WellKnownHeader name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QList<QDateTime>> dateTimeValues(QAnyStringView name) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
std::optional<QDateTime> dateTimeValueAt(qsizetype i) const;
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
void setDateTimeValue(QHttpHeaders::WellKnownHeader name, const QDateTime &dateTime);
|
||||
%End
|
||||
%If (Qt_6_10_0 -)
|
||||
void setDateTimeValue(QAnyStringView name, const QDateTime &dateTime);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,64 @@
|
||||
// qhttpmultipart.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QHttpPart
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhttpmultipart.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QHttpPart();
|
||||
QHttpPart(const QHttpPart &other);
|
||||
~QHttpPart();
|
||||
bool operator==(const QHttpPart &other) const;
|
||||
bool operator!=(const QHttpPart &other) const;
|
||||
void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
|
||||
void setRawHeader(const QByteArray &headerName, const QByteArray &headerValue);
|
||||
void setBody(const QByteArray &body);
|
||||
void setBodyDevice(QIODevice *device);
|
||||
void swap(QHttpPart &other /Constrained/);
|
||||
};
|
||||
|
||||
class QHttpMultiPart : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhttpmultipart.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ContentType
|
||||
{
|
||||
MixedType,
|
||||
RelatedType,
|
||||
FormDataType,
|
||||
AlternativeType,
|
||||
};
|
||||
|
||||
explicit QHttpMultiPart(QObject *parent /TransferThis/ = 0);
|
||||
QHttpMultiPart(QHttpMultiPart::ContentType contentType, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QHttpMultiPart();
|
||||
void append(const QHttpPart &httpPart);
|
||||
void setContentType(QHttpMultiPart::ContentType contentType);
|
||||
QByteArray boundary() const;
|
||||
void setBoundary(const QByteArray &boundary);
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
// qlocalserver.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QLocalServer : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qlocalserver.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QLocalServer(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QLocalServer();
|
||||
void close();
|
||||
QString errorString() const;
|
||||
virtual bool hasPendingConnections() const;
|
||||
bool isListening() const;
|
||||
bool listen(const QString &name);
|
||||
bool listen(qintptr socketDescriptor);
|
||||
int maxPendingConnections() const;
|
||||
virtual QLocalSocket *nextPendingConnection();
|
||||
QString serverName() const;
|
||||
QString fullServerName() const;
|
||||
QAbstractSocket::SocketError serverError() const;
|
||||
void setMaxPendingConnections(int numConnections);
|
||||
bool waitForNewConnection(int msecs = 0, bool *timedOut = 0) /ReleaseGIL/;
|
||||
static bool removeServer(const QString &name);
|
||||
|
||||
signals:
|
||||
void newConnection();
|
||||
|
||||
protected:
|
||||
virtual void incomingConnection(quintptr socketDescriptor);
|
||||
%If (Qt_6_8_0 -)
|
||||
void addPendingConnection(QLocalSocket *socket);
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SocketOption /BaseType=Flag/
|
||||
{
|
||||
UserAccessOption,
|
||||
GroupAccessOption,
|
||||
OtherAccessOption,
|
||||
WorldAccessOption,
|
||||
%If (Qt_6_2_0 -)
|
||||
AbstractNamespaceOption,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QLocalServer::SocketOption> SocketOptions;
|
||||
void setSocketOptions(QLocalServer::SocketOptions options);
|
||||
QLocalServer::SocketOptions socketOptions() const;
|
||||
qintptr socketDescriptor() const;
|
||||
%If (Qt_6_3_0 -)
|
||||
void setListenBacklogSize(int size);
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
int listenBacklogSize() const;
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,214 @@
|
||||
// qlocalsocket.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QLocalSocket : public QIODevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qlocalsocket.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum LocalSocketError
|
||||
{
|
||||
ConnectionRefusedError,
|
||||
PeerClosedError,
|
||||
ServerNotFoundError,
|
||||
SocketAccessError,
|
||||
SocketResourceError,
|
||||
SocketTimeoutError,
|
||||
DatagramTooLargeError,
|
||||
ConnectionError,
|
||||
UnsupportedSocketOperationError,
|
||||
OperationError,
|
||||
UnknownSocketError,
|
||||
};
|
||||
|
||||
enum LocalSocketState
|
||||
{
|
||||
UnconnectedState,
|
||||
ConnectingState,
|
||||
ConnectedState,
|
||||
ClosingState,
|
||||
};
|
||||
|
||||
QLocalSocket(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QLocalSocket();
|
||||
void connectToServer(const QString &name, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
|
||||
void connectToServer(QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
|
||||
void disconnectFromServer() /ReleaseGIL/;
|
||||
virtual bool open(QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite);
|
||||
QString serverName() const;
|
||||
void setServerName(const QString &name);
|
||||
QString fullServerName() const;
|
||||
void abort();
|
||||
virtual bool isSequential() const;
|
||||
virtual qint64 bytesAvailable() const;
|
||||
virtual qint64 bytesToWrite() const;
|
||||
virtual bool canReadLine() const;
|
||||
virtual void close();
|
||||
QLocalSocket::LocalSocketError error() const;
|
||||
bool flush();
|
||||
bool isValid() const;
|
||||
qint64 readBufferSize() const;
|
||||
void setReadBufferSize(qint64 size);
|
||||
bool setSocketDescriptor(qintptr socketDescriptor, QLocalSocket::LocalSocketState state = QLocalSocket::ConnectedState, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite);
|
||||
qintptr socketDescriptor() const;
|
||||
QLocalSocket::LocalSocketState state() const;
|
||||
virtual bool waitForBytesWritten(int msecs = 30000) /ReleaseGIL/;
|
||||
bool waitForConnected(int msecs = 30000) /ReleaseGIL/;
|
||||
bool waitForDisconnected(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForReadyRead(int msecs = 30000) /ReleaseGIL/;
|
||||
|
||||
signals:
|
||||
void connected();
|
||||
void disconnected();
|
||||
void errorOccurred(QLocalSocket::LocalSocketError socketError);
|
||||
void stateChanged(QLocalSocket::LocalSocketState socketState);
|
||||
|
||||
protected:
|
||||
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="bytes",ReleaseGIL/ [qint64 (char *, qint64)];
|
||||
%MethodCode
|
||||
// Return the data read or None if there was an error.
|
||||
if (a0 < 0)
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *s = new char[a0];
|
||||
qint64 len;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
len = sipSelfWasArg ? sipCpp->QLocalSocket::readData(s, a0) : sipCpp->readData(s, a0);
|
||||
#else
|
||||
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = PyBytes_FromStringAndSize(s, len);
|
||||
|
||||
if (!sipRes)
|
||||
sipIsErr = 1;
|
||||
}
|
||||
|
||||
delete[] s;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *, qint64)];
|
||||
%MethodCode
|
||||
sipBufferInfoDef bi;
|
||||
|
||||
if (sipGetBufferInfo(a0, &bi) > 0)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
sipRes = sipSelfWasArg ?
|
||||
sipCpp->QLocalSocket::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
|
||||
sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
|
||||
#else
|
||||
sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
|
||||
bi.bi_len);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
sipReleaseBufferInfo(&bi);
|
||||
}
|
||||
else
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual qint64 skipData(qint64 maxSize) /ReleaseGIL/;
|
||||
|
||||
public:
|
||||
%If (Qt_6_2_0 -)
|
||||
|
||||
enum SocketOption /BaseType=Flag/
|
||||
{
|
||||
NoOptions,
|
||||
AbstractNamespaceOption,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_6_2_0 -)
|
||||
typedef QFlags<QLocalSocket::SocketOption> SocketOptions;
|
||||
%End
|
||||
%If (Qt_6_2_0 -)
|
||||
void setSocketOptions(QLocalSocket::SocketOptions option);
|
||||
%End
|
||||
%If (Qt_6_2_0 -)
|
||||
QLocalSocket::SocketOptions socketOptions() const;
|
||||
%End
|
||||
|
||||
protected:
|
||||
%If (Qt_6_3_0 -)
|
||||
virtual SIP_PYOBJECT readLineData(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/ [qint64 (char *data, qint64 maxSize)];
|
||||
%MethodCode
|
||||
// Return the data read or None if there was an error.
|
||||
if (a0 < 0)
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *s = new char[a0];
|
||||
qint64 len;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
len = sipSelfWasArg ? sipCpp->QLocalSocket::readLineData(s, a0) : sipCpp->readLineData(s, a0);
|
||||
#else
|
||||
len = sipCpp->sipProtectVirt_readLineData(sipSelfWasArg, s, a0);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = PyBytes_FromStringAndSize(s, len);
|
||||
|
||||
if (!sipRes)
|
||||
sipIsErr = 1;
|
||||
}
|
||||
|
||||
delete[] s;
|
||||
}
|
||||
%End
|
||||
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,115 @@
|
||||
// qnetworkaccessmanager.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkAccessManager : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkaccessmanager.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Operation
|
||||
{
|
||||
HeadOperation,
|
||||
GetOperation,
|
||||
PutOperation,
|
||||
PostOperation,
|
||||
DeleteOperation,
|
||||
CustomOperation,
|
||||
};
|
||||
|
||||
explicit QNetworkAccessManager(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QNetworkAccessManager();
|
||||
QNetworkProxy proxy() const;
|
||||
void setProxy(const QNetworkProxy &proxy);
|
||||
QNetworkCookieJar *cookieJar() const;
|
||||
void setCookieJar(QNetworkCookieJar *cookieJar /Transfer/);
|
||||
QNetworkReply *head(const QNetworkRequest &request) /Transfer/;
|
||||
QNetworkReply *get(const QNetworkRequest &request) /Transfer/;
|
||||
%If (Qt_6_7_0 -)
|
||||
QNetworkReply *get(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
%End
|
||||
%If (Qt_6_7_0 -)
|
||||
QNetworkReply *get(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
%End
|
||||
QNetworkReply *post(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, QHttpMultiPart *multiPart) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *multiPart) /Transfer/;
|
||||
|
||||
signals:
|
||||
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
|
||||
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
|
||||
void finished(QNetworkReply *reply);
|
||||
%If (PyQt_SSL)
|
||||
void encrypted(QNetworkReply *reply);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
void preSharedKeyAuthenticationRequired(QNetworkReply *reply, QSslPreSharedKeyAuthenticator *authenticator);
|
||||
%End
|
||||
|
||||
protected:
|
||||
virtual QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *device = 0) /AbortOnException,DisallowNone,ReleaseGIL/;
|
||||
|
||||
public:
|
||||
QNetworkProxyFactory *proxyFactory() const;
|
||||
void setProxyFactory(QNetworkProxyFactory *factory /Transfer/);
|
||||
QAbstractNetworkCache *cache() const;
|
||||
void setCache(QAbstractNetworkCache *cache /Transfer/);
|
||||
QNetworkReply *deleteResource(const QNetworkRequest &request) /Transfer/;
|
||||
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = 0) /Transfer/;
|
||||
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QHttpMultiPart *multiPart) /Transfer/;
|
||||
void clearAccessCache();
|
||||
virtual QStringList supportedSchemes() const;
|
||||
%If (PyQt_SSL)
|
||||
void connectToHostEncrypted(const QString &hostName, quint16 port = 443, const QSslConfiguration &sslConfiguration = QSslConfiguration::defaultConfiguration());
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
void connectToHostEncrypted(const QString &hostName, quint16 port, const QSslConfiguration &sslConfiguration, const QString &peerName);
|
||||
%End
|
||||
void connectToHost(const QString &hostName, quint16 port = 80);
|
||||
|
||||
protected slots:
|
||||
QStringList supportedSchemesImplementation() const;
|
||||
|
||||
public:
|
||||
void clearConnectionCache();
|
||||
void setStrictTransportSecurityEnabled(bool enabled);
|
||||
bool isStrictTransportSecurityEnabled() const;
|
||||
void addStrictTransportSecurityHosts(const QList<QHstsPolicy> &knownHosts);
|
||||
QList<QHstsPolicy> strictTransportSecurityHosts() const;
|
||||
void setRedirectPolicy(QNetworkRequest::RedirectPolicy policy);
|
||||
QNetworkRequest::RedirectPolicy redirectPolicy() const;
|
||||
void enableStrictTransportSecurityStore(bool enabled, const QString &storeDir = QString());
|
||||
bool isStrictTransportSecurityStoreEnabled() const;
|
||||
bool autoDeleteReplies() const;
|
||||
void setAutoDeleteReplies(bool autoDelete);
|
||||
int transferTimeout() const;
|
||||
// In Qt v6.7 this was replaced by two overloads but we need the optional keyword argument.
|
||||
void setTransferTimeout(int timeout = QNetworkRequest::DefaultTransferTimeoutConstant);
|
||||
};
|
||||
@@ -0,0 +1,83 @@
|
||||
// qnetworkcookie.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkCookie
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkcookie.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum RawForm
|
||||
{
|
||||
NameAndValueOnly,
|
||||
Full,
|
||||
};
|
||||
|
||||
QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray());
|
||||
QNetworkCookie(const QNetworkCookie &other);
|
||||
~QNetworkCookie();
|
||||
bool isSecure() const;
|
||||
void setSecure(bool enable);
|
||||
bool isSessionCookie() const;
|
||||
QDateTime expirationDate() const;
|
||||
void setExpirationDate(const QDateTime &date);
|
||||
QString domain() const;
|
||||
void setDomain(const QString &domain);
|
||||
QString path() const;
|
||||
void setPath(const QString &path);
|
||||
QByteArray name() const;
|
||||
void setName(const QByteArray &cookieName);
|
||||
QByteArray value() const;
|
||||
void setValue(const QByteArray &value);
|
||||
QByteArray toRawForm(QNetworkCookie::RawForm form = QNetworkCookie::Full) const;
|
||||
%If (Qt_6_7_0 -)
|
||||
static QList<QNetworkCookie> parseCookies(QByteArrayView cookieString);
|
||||
%End
|
||||
%If (- Qt_6_7_0)
|
||||
static QList<QNetworkCookie> parseCookies(const QByteArray &cookieString);
|
||||
%End
|
||||
bool operator==(const QNetworkCookie &other) const;
|
||||
bool operator!=(const QNetworkCookie &other) const;
|
||||
bool isHttpOnly() const;
|
||||
void setHttpOnly(bool enable);
|
||||
void swap(QNetworkCookie &other /Constrained/);
|
||||
bool hasSameIdentifier(const QNetworkCookie &other) const;
|
||||
void normalize(const QUrl &url);
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
enum class SameSite
|
||||
{
|
||||
Default,
|
||||
None /PyName=None_/,
|
||||
Lax,
|
||||
Strict,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
QNetworkCookie::SameSite sameSitePolicy() const;
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
void setSameSitePolicy(QNetworkCookie::SameSite sameSite);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
// qnetworkcookiejar.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkCookieJar : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkcookiejar.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QNetworkCookieJar(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QNetworkCookieJar();
|
||||
virtual QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const;
|
||||
virtual bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
|
||||
virtual bool insertCookie(const QNetworkCookie &cookie);
|
||||
virtual bool updateCookie(const QNetworkCookie &cookie);
|
||||
virtual bool deleteCookie(const QNetworkCookie &cookie);
|
||||
|
||||
protected:
|
||||
void setAllCookies(const QList<QNetworkCookie> &cookieList);
|
||||
QList<QNetworkCookie> allCookies() const;
|
||||
virtual bool validateCookie(const QNetworkCookie &cookie, const QUrl &url) const;
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
// qnetworkdatagram.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkDatagram
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkdatagram.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNetworkDatagram();
|
||||
QNetworkDatagram(const QByteArray &data, const QHostAddress &destinationAddress = QHostAddress(), quint16 port = 0);
|
||||
QNetworkDatagram(const QNetworkDatagram &other);
|
||||
~QNetworkDatagram();
|
||||
void swap(QNetworkDatagram &other /Constrained/);
|
||||
void clear();
|
||||
bool isValid() const;
|
||||
bool isNull() const;
|
||||
uint interfaceIndex() const;
|
||||
void setInterfaceIndex(uint index);
|
||||
QHostAddress senderAddress() const;
|
||||
QHostAddress destinationAddress() const;
|
||||
int senderPort() const;
|
||||
int destinationPort() const;
|
||||
void setSender(const QHostAddress &address, quint16 port = 0);
|
||||
void setDestination(const QHostAddress &address, quint16 port);
|
||||
int hopLimit() const;
|
||||
void setHopLimit(int count);
|
||||
QByteArray data() const;
|
||||
void setData(const QByteArray &data);
|
||||
QNetworkDatagram makeReply(const QByteArray &payload) const;
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
// qnetworkdiskcache.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkDiskCache : public QAbstractNetworkCache
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkdiskcache.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QNetworkDiskCache(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QNetworkDiskCache();
|
||||
QString cacheDirectory() const;
|
||||
void setCacheDirectory(const QString &cacheDir);
|
||||
qint64 maximumCacheSize() const;
|
||||
void setMaximumCacheSize(qint64 size);
|
||||
virtual qint64 cacheSize() const;
|
||||
virtual QNetworkCacheMetaData metaData(const QUrl &url);
|
||||
virtual void updateMetaData(const QNetworkCacheMetaData &metaData);
|
||||
virtual QIODevice *data(const QUrl &url) /Factory/;
|
||||
virtual bool remove(const QUrl &url);
|
||||
virtual QIODevice *prepare(const QNetworkCacheMetaData &metaData);
|
||||
virtual void insert(QIODevice *device);
|
||||
QNetworkCacheMetaData fileMetaData(const QString &fileName) const;
|
||||
|
||||
public slots:
|
||||
virtual void clear();
|
||||
|
||||
protected:
|
||||
virtual qint64 expire();
|
||||
};
|
||||
@@ -0,0 +1,131 @@
|
||||
// qnetworkinformation.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
class QNetworkInformation : public QObject /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkinformation.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum class Reachability
|
||||
{
|
||||
Unknown,
|
||||
Disconnected,
|
||||
Local,
|
||||
Site,
|
||||
Online,
|
||||
};
|
||||
|
||||
enum class Feature
|
||||
{
|
||||
Reachability,
|
||||
%If (Qt_6_2_0 -)
|
||||
CaptivePortal,
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
TransportMedium,
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
Metered,
|
||||
%End
|
||||
};
|
||||
|
||||
typedef QFlags<QNetworkInformation::Feature> Features;
|
||||
QNetworkInformation::Reachability reachability() const;
|
||||
QString backendName() const;
|
||||
bool supports(QNetworkInformation::Features features) const;
|
||||
static bool load(QStringView backend);
|
||||
static bool load(QNetworkInformation::Features features);
|
||||
static QStringList availableBackends();
|
||||
static QNetworkInformation *instance();
|
||||
|
||||
signals:
|
||||
%If (Qt_6_8_0 -)
|
||||
void reachabilityChanged(QNetworkInformation::Reachability newReachability);
|
||||
%End
|
||||
%If (- Qt_6_8_0)
|
||||
void reachabilityChanged(QNetworkInformation::Reachability newReachability /ScopesStripped=1/);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_6_2_0 -)
|
||||
bool isBehindCaptivePortal() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_6_2_0 -)
|
||||
void isBehindCaptivePortalChanged(bool state);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_6_3_0 -)
|
||||
|
||||
enum class TransportMedium
|
||||
{
|
||||
Unknown,
|
||||
Ethernet,
|
||||
Cellular,
|
||||
WiFi,
|
||||
Bluetooth,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
QNetworkInformation::TransportMedium transportMedium() const;
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
bool isMetered() const;
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
QNetworkInformation::Features supportedFeatures() const;
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
static bool loadDefaultBackend();
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_6_8_0 -)
|
||||
void transportMediumChanged(QNetworkInformation::TransportMedium current);
|
||||
%End
|
||||
%If (Qt_6_3_0 - Qt_6_8_0)
|
||||
void transportMediumChanged(QNetworkInformation::TransportMedium current /ScopesStripped=1/);
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
void isMeteredChanged(bool isMetered);
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_6_4_0 -)
|
||||
static bool loadBackendByName(QStringView backend);
|
||||
%End
|
||||
%If (Qt_6_4_0 -)
|
||||
static bool loadBackendByFeatures(QNetworkInformation::Features features);
|
||||
%End
|
||||
|
||||
private:
|
||||
virtual ~QNetworkInformation();
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,120 @@
|
||||
// qnetworkinterface.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkAddressEntry
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkinterface.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNetworkAddressEntry();
|
||||
QNetworkAddressEntry(const QNetworkAddressEntry &other);
|
||||
~QNetworkAddressEntry();
|
||||
QHostAddress ip() const;
|
||||
void setIp(const QHostAddress &newIp);
|
||||
QHostAddress netmask() const;
|
||||
void setNetmask(const QHostAddress &newNetmask);
|
||||
QHostAddress broadcast() const;
|
||||
void setBroadcast(const QHostAddress &newBroadcast);
|
||||
bool operator==(const QNetworkAddressEntry &other) const;
|
||||
bool operator!=(const QNetworkAddressEntry &other) const;
|
||||
int prefixLength() const;
|
||||
void setPrefixLength(int length);
|
||||
void swap(QNetworkAddressEntry &other /Constrained/);
|
||||
|
||||
enum DnsEligibilityStatus : qint8
|
||||
{
|
||||
DnsEligibilityUnknown,
|
||||
DnsIneligible,
|
||||
DnsEligible,
|
||||
};
|
||||
|
||||
QNetworkAddressEntry::DnsEligibilityStatus dnsEligibility() const;
|
||||
void setDnsEligibility(QNetworkAddressEntry::DnsEligibilityStatus status);
|
||||
bool isLifetimeKnown() const;
|
||||
QDeadlineTimer preferredLifetime() const;
|
||||
QDeadlineTimer validityLifetime() const;
|
||||
void setAddressLifetime(QDeadlineTimer preferred, QDeadlineTimer validity);
|
||||
void clearAddressLifetime();
|
||||
bool isPermanent() const;
|
||||
bool isTemporary() const;
|
||||
};
|
||||
|
||||
class QNetworkInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkinterface.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum InterfaceFlag /BaseType=Flag/
|
||||
{
|
||||
IsUp,
|
||||
IsRunning,
|
||||
CanBroadcast,
|
||||
IsLoopBack,
|
||||
IsPointToPoint,
|
||||
CanMulticast,
|
||||
};
|
||||
|
||||
typedef QFlags<QNetworkInterface::InterfaceFlag> InterfaceFlags;
|
||||
QNetworkInterface();
|
||||
QNetworkInterface(const QNetworkInterface &other);
|
||||
~QNetworkInterface();
|
||||
bool isValid() const;
|
||||
QString name() const;
|
||||
QNetworkInterface::InterfaceFlags flags() const;
|
||||
QString hardwareAddress() const;
|
||||
QList<QNetworkAddressEntry> addressEntries() const;
|
||||
static QNetworkInterface interfaceFromName(const QString &name);
|
||||
static QNetworkInterface interfaceFromIndex(int index);
|
||||
static QList<QNetworkInterface> allInterfaces();
|
||||
static QList<QHostAddress> allAddresses();
|
||||
int index() const;
|
||||
QString humanReadableName() const;
|
||||
void swap(QNetworkInterface &other /Constrained/);
|
||||
static int interfaceIndexFromName(const QString &name);
|
||||
static QString interfaceNameFromIndex(int index);
|
||||
|
||||
enum InterfaceType
|
||||
{
|
||||
Unknown,
|
||||
Loopback,
|
||||
Virtual,
|
||||
Ethernet,
|
||||
Slip,
|
||||
CanBus,
|
||||
Ppp,
|
||||
Fddi,
|
||||
Wifi,
|
||||
Ieee80211,
|
||||
Phonet,
|
||||
Ieee802154,
|
||||
SixLoWPAN,
|
||||
Ieee80216,
|
||||
Ieee1394,
|
||||
};
|
||||
|
||||
QNetworkInterface::InterfaceType type() const;
|
||||
int maximumTransmissionUnit() const;
|
||||
};
|
||||
@@ -0,0 +1,145 @@
|
||||
// qnetworkproxy.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkProxy
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkproxy.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum ProxyType
|
||||
{
|
||||
DefaultProxy,
|
||||
Socks5Proxy,
|
||||
NoProxy,
|
||||
HttpProxy,
|
||||
HttpCachingProxy,
|
||||
FtpCachingProxy,
|
||||
};
|
||||
|
||||
QNetworkProxy();
|
||||
QNetworkProxy(QNetworkProxy::ProxyType type, const QString &hostName = QString(), quint16 port = 0, const QString &user = QString(), const QString &password = QString());
|
||||
QNetworkProxy(const QNetworkProxy &other);
|
||||
~QNetworkProxy();
|
||||
void setType(QNetworkProxy::ProxyType type);
|
||||
QNetworkProxy::ProxyType type() const;
|
||||
void setUser(const QString &userName);
|
||||
QString user() const;
|
||||
void setPassword(const QString &password);
|
||||
QString password() const;
|
||||
void setHostName(const QString &hostName);
|
||||
QString hostName() const;
|
||||
void setPort(quint16 port);
|
||||
quint16 port() const;
|
||||
static void setApplicationProxy(const QNetworkProxy &proxy);
|
||||
static QNetworkProxy applicationProxy();
|
||||
bool isCachingProxy() const;
|
||||
bool isTransparentProxy() const;
|
||||
bool operator==(const QNetworkProxy &other) const;
|
||||
bool operator!=(const QNetworkProxy &other) const;
|
||||
|
||||
enum Capability /BaseType=Flag/
|
||||
{
|
||||
TunnelingCapability,
|
||||
ListeningCapability,
|
||||
UdpTunnelingCapability,
|
||||
CachingCapability,
|
||||
HostNameLookupCapability,
|
||||
SctpTunnelingCapability,
|
||||
SctpListeningCapability,
|
||||
};
|
||||
|
||||
typedef QFlags<QNetworkProxy::Capability> Capabilities;
|
||||
void setCapabilities(QNetworkProxy::Capabilities capab);
|
||||
QNetworkProxy::Capabilities capabilities() const;
|
||||
void swap(QNetworkProxy &other /Constrained/);
|
||||
QVariant header(QNetworkRequest::KnownHeaders header) const;
|
||||
void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
|
||||
bool hasRawHeader(const QByteArray &headerName) const;
|
||||
QList<QByteArray> rawHeaderList() const;
|
||||
QByteArray rawHeader(const QByteArray &headerName) const;
|
||||
void setRawHeader(const QByteArray &headerName, const QByteArray &value);
|
||||
%If (Qt_6_8_0 -)
|
||||
QHttpHeaders headers() const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setHeaders(const QHttpHeaders &newHeaders);
|
||||
%End
|
||||
};
|
||||
|
||||
class QNetworkProxyQuery
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkproxy.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum QueryType
|
||||
{
|
||||
TcpSocket,
|
||||
UdpSocket,
|
||||
TcpServer,
|
||||
UrlRequest,
|
||||
SctpSocket,
|
||||
SctpServer,
|
||||
};
|
||||
|
||||
QNetworkProxyQuery();
|
||||
QNetworkProxyQuery(const QUrl &requestUrl, QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::UrlRequest);
|
||||
QNetworkProxyQuery(const QString &hostname, int port, const QString &protocolTag = QString(), QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::TcpSocket);
|
||||
QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(), QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::TcpServer);
|
||||
QNetworkProxyQuery(const QNetworkProxyQuery &other);
|
||||
~QNetworkProxyQuery();
|
||||
bool operator==(const QNetworkProxyQuery &other) const;
|
||||
bool operator!=(const QNetworkProxyQuery &other) const;
|
||||
QNetworkProxyQuery::QueryType queryType() const;
|
||||
void setQueryType(QNetworkProxyQuery::QueryType type);
|
||||
int peerPort() const;
|
||||
void setPeerPort(int port);
|
||||
QString peerHostName() const;
|
||||
void setPeerHostName(const QString &hostname);
|
||||
int localPort() const;
|
||||
void setLocalPort(int port);
|
||||
QString protocolTag() const;
|
||||
void setProtocolTag(const QString &protocolTag);
|
||||
QUrl url() const;
|
||||
void setUrl(const QUrl &url);
|
||||
void swap(QNetworkProxyQuery &other /Constrained/);
|
||||
};
|
||||
|
||||
class QNetworkProxyFactory /Supertype=PyQt6.sip.wrapper/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkproxy.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNetworkProxyFactory();
|
||||
virtual ~QNetworkProxyFactory();
|
||||
virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()) = 0;
|
||||
static void setApplicationProxyFactory(QNetworkProxyFactory *factory /Transfer/);
|
||||
static QList<QNetworkProxy> proxyForQuery(const QNetworkProxyQuery &query);
|
||||
static QList<QNetworkProxy> systemProxyForQuery(const QNetworkProxyQuery &query = QNetworkProxyQuery());
|
||||
static void setUseSystemConfiguration(bool enable);
|
||||
static bool usesSystemConfiguration();
|
||||
};
|
||||
@@ -0,0 +1,198 @@
|
||||
// qnetworkreply.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkReply : public QIODevice
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkreply.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum NetworkError
|
||||
{
|
||||
NoError,
|
||||
ConnectionRefusedError,
|
||||
RemoteHostClosedError,
|
||||
HostNotFoundError,
|
||||
TimeoutError,
|
||||
OperationCanceledError,
|
||||
SslHandshakeFailedError,
|
||||
UnknownNetworkError,
|
||||
ProxyConnectionRefusedError,
|
||||
ProxyConnectionClosedError,
|
||||
ProxyNotFoundError,
|
||||
ProxyTimeoutError,
|
||||
ProxyAuthenticationRequiredError,
|
||||
UnknownProxyError,
|
||||
ContentAccessDenied,
|
||||
ContentOperationNotPermittedError,
|
||||
ContentNotFoundError,
|
||||
AuthenticationRequiredError,
|
||||
UnknownContentError,
|
||||
ProtocolUnknownError,
|
||||
ProtocolInvalidOperationError,
|
||||
ProtocolFailure,
|
||||
ContentReSendError,
|
||||
TemporaryNetworkFailureError,
|
||||
NetworkSessionFailedError,
|
||||
BackgroundRequestNotAllowedError,
|
||||
ContentConflictError,
|
||||
ContentGoneError,
|
||||
InternalServerError,
|
||||
OperationNotImplementedError,
|
||||
ServiceUnavailableError,
|
||||
UnknownServerError,
|
||||
TooManyRedirectsError,
|
||||
InsecureRedirectError,
|
||||
};
|
||||
|
||||
virtual ~QNetworkReply();
|
||||
virtual void abort() = 0;
|
||||
virtual void close();
|
||||
virtual bool isSequential() const;
|
||||
qint64 readBufferSize() const;
|
||||
virtual void setReadBufferSize(qint64 size);
|
||||
QNetworkAccessManager *manager() const;
|
||||
QNetworkAccessManager::Operation operation() const;
|
||||
QNetworkRequest request() const;
|
||||
QNetworkReply::NetworkError error() const;
|
||||
QUrl url() const;
|
||||
QVariant header(QNetworkRequest::KnownHeaders header) const;
|
||||
%If (Qt_6_7_0 -)
|
||||
bool hasRawHeader(QAnyStringView headerName) const;
|
||||
%End
|
||||
%If (- Qt_6_7_0)
|
||||
bool hasRawHeader(const QByteArray &headerName) const;
|
||||
%End
|
||||
QList<QByteArray> rawHeaderList() const;
|
||||
%If (Qt_6_7_0 -)
|
||||
QByteArray rawHeader(QAnyStringView headerName) const;
|
||||
%End
|
||||
%If (- Qt_6_7_0)
|
||||
QByteArray rawHeader(const QByteArray &headerName) const;
|
||||
%End
|
||||
QVariant attribute(QNetworkRequest::Attribute code) const;
|
||||
%If (PyQt_SSL)
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
void setSslConfiguration(const QSslConfiguration &configuration);
|
||||
%End
|
||||
|
||||
public slots:
|
||||
virtual void ignoreSslErrors();
|
||||
|
||||
signals:
|
||||
void metaDataChanged();
|
||||
void finished();
|
||||
%If (PyQt_SSL)
|
||||
void encrypted();
|
||||
%End
|
||||
void errorOccurred(QNetworkReply::NetworkError);
|
||||
%If (PyQt_SSL)
|
||||
void sslErrors(const QList<QSslError> &errors);
|
||||
%End
|
||||
void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
|
||||
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||
%If (PyQt_SSL)
|
||||
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
|
||||
%End
|
||||
void redirected(const QUrl &url);
|
||||
void redirectAllowed();
|
||||
|
||||
protected:
|
||||
explicit QNetworkReply(QObject *parent /TransferThis/ = 0);
|
||||
virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
|
||||
%MethodCode
|
||||
sipBufferInfoDef bi;
|
||||
|
||||
if (sipGetBufferInfo(a0, &bi) > 0)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
sipRes = sipSelfWasArg ?
|
||||
sipCpp->QNetworkReply::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
|
||||
sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
|
||||
#else
|
||||
sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
|
||||
bi.bi_len);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
sipReleaseBufferInfo(&bi);
|
||||
}
|
||||
else
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
%End
|
||||
|
||||
void setOperation(QNetworkAccessManager::Operation operation);
|
||||
void setRequest(const QNetworkRequest &request);
|
||||
void setError(QNetworkReply::NetworkError errorCode, const QString &errorString);
|
||||
void setUrl(const QUrl &url);
|
||||
void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
|
||||
void setRawHeader(const QByteArray &headerName, const QByteArray &value);
|
||||
void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
|
||||
void setFinished(bool finished);
|
||||
|
||||
public:
|
||||
bool isFinished() const;
|
||||
bool isRunning() const;
|
||||
%If (PyQt_SSL)
|
||||
void ignoreSslErrors(const QList<QSslError> &errors);
|
||||
%End
|
||||
typedef std::pair<QByteArray, QByteArray> RawHeaderPair;
|
||||
const QList<std::pair<QByteArray, QByteArray>> &rawHeaderPairs() const;
|
||||
|
||||
protected:
|
||||
%If (PyQt_SSL)
|
||||
virtual void sslConfigurationImplementation(QSslConfiguration &) const;
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
virtual void setSslConfigurationImplementation(const QSslConfiguration &);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
virtual void ignoreSslErrorsImplementation(const QList<QSslError> &);
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_6_3_0 -)
|
||||
void socketStartedConnecting();
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
void requestSent();
|
||||
%End
|
||||
|
||||
public:
|
||||
%If (Qt_6_8_0 -)
|
||||
QHttpHeaders headers() const;
|
||||
%End
|
||||
|
||||
protected:
|
||||
%If (Qt_6_8_0 -)
|
||||
void setHeaders(const QHttpHeaders &newHeaders);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setWellKnownHeader(QHttpHeaders::WellKnownHeader name, QByteArrayView value);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,187 @@
|
||||
// qnetworkrequest.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QNetworkRequest
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkrequest.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum KnownHeaders
|
||||
{
|
||||
ContentTypeHeader,
|
||||
ContentLengthHeader,
|
||||
LocationHeader,
|
||||
LastModifiedHeader,
|
||||
CookieHeader,
|
||||
SetCookieHeader,
|
||||
ContentDispositionHeader,
|
||||
UserAgentHeader,
|
||||
ServerHeader,
|
||||
IfModifiedSinceHeader,
|
||||
ETagHeader,
|
||||
IfMatchHeader,
|
||||
IfNoneMatchHeader,
|
||||
};
|
||||
|
||||
enum Attribute
|
||||
{
|
||||
HttpStatusCodeAttribute,
|
||||
HttpReasonPhraseAttribute,
|
||||
RedirectionTargetAttribute,
|
||||
ConnectionEncryptedAttribute,
|
||||
CacheLoadControlAttribute,
|
||||
CacheSaveControlAttribute,
|
||||
SourceIsFromCacheAttribute,
|
||||
DoNotBufferUploadDataAttribute,
|
||||
HttpPipeliningAllowedAttribute,
|
||||
HttpPipeliningWasUsedAttribute,
|
||||
CustomVerbAttribute,
|
||||
CookieLoadControlAttribute,
|
||||
AuthenticationReuseAttribute,
|
||||
CookieSaveControlAttribute,
|
||||
BackgroundRequestAttribute,
|
||||
EmitAllUploadProgressSignalsAttribute,
|
||||
Http2AllowedAttribute,
|
||||
Http2WasUsedAttribute,
|
||||
OriginalContentLengthAttribute,
|
||||
RedirectPolicyAttribute,
|
||||
Http2DirectAttribute,
|
||||
AutoDeleteReplyOnFinishAttribute,
|
||||
%If (Qt_6_3_0 -)
|
||||
ConnectionCacheExpiryTimeoutSecondsAttribute,
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
Http2CleartextAllowedAttribute,
|
||||
%End
|
||||
%If (Qt_6_5_0 -)
|
||||
UseCredentialsAttribute,
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
FullLocalServerNameAttribute,
|
||||
%End
|
||||
User,
|
||||
UserMax,
|
||||
};
|
||||
|
||||
enum CacheLoadControl
|
||||
{
|
||||
AlwaysNetwork,
|
||||
PreferNetwork,
|
||||
PreferCache,
|
||||
AlwaysCache,
|
||||
};
|
||||
|
||||
enum LoadControl
|
||||
{
|
||||
Automatic,
|
||||
Manual,
|
||||
};
|
||||
|
||||
enum Priority
|
||||
{
|
||||
HighPriority,
|
||||
NormalPriority,
|
||||
LowPriority,
|
||||
};
|
||||
|
||||
explicit QNetworkRequest(const QUrl &url);
|
||||
QNetworkRequest();
|
||||
QNetworkRequest(const QNetworkRequest &other);
|
||||
~QNetworkRequest();
|
||||
QUrl url() const;
|
||||
void setUrl(const QUrl &url);
|
||||
QVariant header(QNetworkRequest::KnownHeaders header) const;
|
||||
void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
|
||||
%If (Qt_6_7_0 -)
|
||||
bool hasRawHeader(QAnyStringView headerName) const;
|
||||
%End
|
||||
%If (- Qt_6_7_0)
|
||||
bool hasRawHeader(const QByteArray &headerName) const;
|
||||
%End
|
||||
QList<QByteArray> rawHeaderList() const;
|
||||
%If (Qt_6_7_0 -)
|
||||
QByteArray rawHeader(QAnyStringView headerName) const;
|
||||
%End
|
||||
%If (- Qt_6_7_0)
|
||||
QByteArray rawHeader(const QByteArray &headerName) const;
|
||||
%End
|
||||
void setRawHeader(const QByteArray &headerName, const QByteArray &value);
|
||||
QVariant attribute(QNetworkRequest::Attribute code, const QVariant &defaultValue = QVariant()) const;
|
||||
void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
|
||||
%If (PyQt_SSL)
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
void setSslConfiguration(const QSslConfiguration &configuration);
|
||||
%End
|
||||
bool operator==(const QNetworkRequest &other) const;
|
||||
bool operator!=(const QNetworkRequest &other) const;
|
||||
void setOriginatingObject(QObject *object /KeepReference/);
|
||||
QObject *originatingObject() const;
|
||||
QNetworkRequest::Priority priority() const;
|
||||
void setPriority(QNetworkRequest::Priority priority);
|
||||
void swap(QNetworkRequest &other /Constrained/);
|
||||
int maximumRedirectsAllowed() const;
|
||||
void setMaximumRedirectsAllowed(int maximumRedirectsAllowed);
|
||||
|
||||
enum RedirectPolicy
|
||||
{
|
||||
ManualRedirectPolicy,
|
||||
NoLessSafeRedirectPolicy,
|
||||
SameOriginRedirectPolicy,
|
||||
UserVerifiedRedirectPolicy,
|
||||
};
|
||||
|
||||
QString peerVerifyName() const;
|
||||
void setPeerVerifyName(const QString &peerName);
|
||||
%If (Qt_6_5_0 -)
|
||||
QHttp1Configuration http1Configuration() const;
|
||||
%End
|
||||
QHttp2Configuration http2Configuration() const;
|
||||
%If (Qt_6_5_0 -)
|
||||
void setHttp1Configuration(const QHttp1Configuration &configuration);
|
||||
%End
|
||||
void setHttp2Configuration(const QHttp2Configuration &configuration);
|
||||
|
||||
enum TransferTimeoutConstant
|
||||
{
|
||||
DefaultTransferTimeoutConstant,
|
||||
};
|
||||
|
||||
int transferTimeout() const;
|
||||
// In Qt v6.7 this was replaced by two overloads but we need the optional keyword argument.
|
||||
void setTransferTimeout(int timeout = QNetworkRequest::DefaultTransferTimeoutConstant);
|
||||
%If (Qt_6_2_0 -)
|
||||
qint64 decompressedSafetyCheckThreshold() const;
|
||||
%End
|
||||
%If (Qt_6_2_0 -)
|
||||
void setDecompressedSafetyCheckThreshold(qint64 threshold);
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
QHttpHeaders headers() const;
|
||||
%End
|
||||
%If (Qt_6_8_0 -)
|
||||
void setHeaders(const QHttpHeaders &newHeaders);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
// qnetworkrequestfactory.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
class QNetworkRequestFactory
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnetworkrequestfactory.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNetworkRequestFactory();
|
||||
explicit QNetworkRequestFactory(const QUrl &baseUrl);
|
||||
QNetworkRequestFactory(const QNetworkRequestFactory &other);
|
||||
~QNetworkRequestFactory();
|
||||
void swap(QNetworkRequestFactory &other /Constrained/);
|
||||
QUrl baseUrl() const;
|
||||
void setBaseUrl(const QUrl &url);
|
||||
%If (PyQt_SSL)
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
void setSslConfiguration(const QSslConfiguration &configuration);
|
||||
%End
|
||||
QNetworkRequest createRequest() const;
|
||||
QNetworkRequest createRequest(const QUrlQuery &query) const;
|
||||
QNetworkRequest createRequest(const QString &path) const;
|
||||
QNetworkRequest createRequest(const QString &path, const QUrlQuery &query) const;
|
||||
void setCommonHeaders(const QHttpHeaders &headers);
|
||||
QHttpHeaders commonHeaders() const;
|
||||
void clearCommonHeaders();
|
||||
QByteArray bearerToken() const;
|
||||
void setBearerToken(const QByteArray &token);
|
||||
void clearBearerToken();
|
||||
QString userName() const;
|
||||
void setUserName(const QString &userName);
|
||||
void clearUserName();
|
||||
QString password() const;
|
||||
void setPassword(const QString &password);
|
||||
void clearPassword();
|
||||
void setTransferTimeout(std::chrono::milliseconds timeout);
|
||||
std::chrono::milliseconds transferTimeout() const;
|
||||
QUrlQuery queryParameters() const;
|
||||
void setQueryParameters(const QUrlQuery &query);
|
||||
void clearQueryParameters();
|
||||
void setPriority(QNetworkRequest::Priority priority);
|
||||
QNetworkRequest::Priority priority() const;
|
||||
QVariant attribute(QNetworkRequest::Attribute attribute) const;
|
||||
QVariant attribute(QNetworkRequest::Attribute attribute, const QVariant &defaultValue) const;
|
||||
void setAttribute(QNetworkRequest::Attribute attribute, const QVariant &value);
|
||||
void clearAttribute(QNetworkRequest::Attribute attribute);
|
||||
void clearAttributes();
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,84 @@
|
||||
// qocspresponse.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
%ModuleCode
|
||||
#include <qocspresponse.h>
|
||||
%End
|
||||
%End
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
enum class QOcspCertificateStatus
|
||||
{
|
||||
Good,
|
||||
Revoked,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
|
||||
enum class QOcspRevocationReason
|
||||
{
|
||||
None,
|
||||
Unspecified,
|
||||
KeyCompromise,
|
||||
CACompromise,
|
||||
AffiliationChanged,
|
||||
Superseded,
|
||||
CessationOfOperation,
|
||||
CertificateHold,
|
||||
RemoveFromCRL,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QOcspResponse
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qocspresponse.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QOcspResponse();
|
||||
QOcspResponse(const QOcspResponse &other);
|
||||
~QOcspResponse();
|
||||
QOcspCertificateStatus certificateStatus() const;
|
||||
QOcspRevocationReason revocationReason() const;
|
||||
QSslCertificate responder() const;
|
||||
QSslCertificate subject() const;
|
||||
void swap(QOcspResponse &other);
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator==(const QOcspResponse &lhs, const QOcspResponse &rhs);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator!=(const QOcspResponse &lhs, const QOcspResponse &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,35 @@
|
||||
// qpassworddigestor.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
namespace QPasswordDigestor
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qpassworddigestor.h>
|
||||
%End
|
||||
|
||||
QByteArray deriveKeyPbkdf1(QCryptographicHash::Algorithm algorithm, const QByteArray &password, const QByteArray &salt, int iterations, quint64 dkLen);
|
||||
QByteArray deriveKeyPbkdf2(QCryptographicHash::Algorithm algorithm, const QByteArray &password, const QByteArray &salt, int iterations, quint64 dkLen);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,132 @@
|
||||
// This is the SIP interface definition for the QHash based mapped types
|
||||
// specific to the QtNetwork module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%MappedType QHash<QNetworkRequest::Attribute, QVariant>
|
||||
/TypeHint="Dict[QNetworkRequest.Attribute, QVariant]",
|
||||
TypeHintValue="{}"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qhash.h>
|
||||
#include <qnetworkrequest.h>
|
||||
#include <qvariant.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *d = PyDict_New();
|
||||
|
||||
if (!d)
|
||||
return 0;
|
||||
|
||||
QHash<QNetworkRequest::Attribute, QVariant>::const_iterator it = sipCpp->constBegin();
|
||||
QHash<QNetworkRequest::Attribute, QVariant>::const_iterator end = sipCpp->constEnd();
|
||||
|
||||
while (it != end)
|
||||
{
|
||||
PyObject *kobj = sipConvertFromEnum(it.key(),
|
||||
sipType_QNetworkRequest_Attribute);
|
||||
|
||||
if (!kobj)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVariant *v = new QVariant(it.value());
|
||||
PyObject *vobj = sipConvertFromNewType(v, sipType_QVariant,
|
||||
sipTransferObj);
|
||||
|
||||
if (!vobj)
|
||||
{
|
||||
delete v;
|
||||
Py_DECREF(kobj);
|
||||
Py_DECREF(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rc = PyDict_SetItem(d, kobj, vobj);
|
||||
|
||||
Py_DECREF(vobj);
|
||||
Py_DECREF(kobj);
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
|
||||
return d;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
if (!sipIsErr)
|
||||
return PyDict_Check(sipPy);
|
||||
|
||||
QHash<QNetworkRequest::Attribute, QVariant> *qh = new QHash<QNetworkRequest::Attribute, QVariant>;
|
||||
|
||||
Py_ssize_t pos = 0;
|
||||
PyObject *kobj, *vobj;
|
||||
|
||||
while (PyDict_Next(sipPy, &pos, &kobj, &vobj))
|
||||
{
|
||||
int k = sipConvertToEnum(kobj, sipType_QNetworkRequest_Attribute);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"a key has type '%s' but 'QNetworkRequest.Attribute' is expected",
|
||||
sipPyTypeName(Py_TYPE(kobj)));
|
||||
|
||||
delete qh;
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vstate;
|
||||
QVariant *v = reinterpret_cast<QVariant *>(
|
||||
sipForceConvertToType(vobj, sipType_QVariant, sipTransferObj,
|
||||
SIP_NOT_NONE, &vstate, sipIsErr));
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
// Any error must be internal, so leave the exception as it is.
|
||||
|
||||
delete qh;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
qh->insert(static_cast<QNetworkRequest::Attribute>(k), *v);
|
||||
|
||||
sipReleaseType(v, sipType_QVariant, vstate);
|
||||
}
|
||||
|
||||
*sipCppPtr = qh;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,349 @@
|
||||
// This is the SIP interface definition for the QList based mapped types
|
||||
// specific to the QtNetwork module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
%MappedType QList<QSsl::SslProtocol>
|
||||
/TypeHintIn="Iterable[QSsl.SslProtocol]",
|
||||
TypeHintOut="List[QSsl.SslProtocol]", TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qlist.h>
|
||||
#include <qssl.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
PyObject *eobj = sipConvertFromEnum(sipCpp->at(i),
|
||||
sipType_QSsl_SslProtocol);
|
||||
|
||||
if (!eobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, eobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter && !PyBytes_Check(sipPy) && !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<QSsl::SslProtocol> *ql = new QList<QSsl::SslProtocol>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete ql;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
int v = sipConvertToEnum(itm, sipType_QSsl_SslProtocol);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'QSsl.SslProtocol' is expected",
|
||||
i, sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete ql;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ql->append(static_cast<QSsl::SslProtocol>(v));
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = ql;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
%End
|
||||
|
||||
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
%MappedType QList<QSsl::ImplementedClass>
|
||||
/TypeHintIn="Iterable[QSsl.ImplementedClass]",
|
||||
TypeHintOut="List[QSsl.ImplementedClass]", TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qlist.h>
|
||||
#include <qssl.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
PyObject *eobj = sipConvertFromEnum(static_cast<int>(sipCpp->at(i)),
|
||||
sipType_QSsl_ImplementedClass);
|
||||
|
||||
if (!eobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, eobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter && !PyBytes_Check(sipPy) && !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<QSsl::ImplementedClass> *ql = new QList<QSsl::ImplementedClass>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete ql;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
int v = sipConvertToEnum(itm, sipType_QSsl_ImplementedClass);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'QSsl.ImplementedClass' is expected",
|
||||
i, sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete ql;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ql->append(static_cast<QSsl::ImplementedClass>(v));
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = ql;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
%End
|
||||
|
||||
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
%MappedType QList<QSsl::SupportedFeature>
|
||||
/TypeHintIn="Iterable[QSsl.SupportedFeature]",
|
||||
TypeHintOut="List[QSsl.SupportedFeature]", TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qlist.h>
|
||||
#include <qssl.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
PyObject *l = PyList_New(sipCpp->size());
|
||||
|
||||
if (!l)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
PyObject *eobj = sipConvertFromEnum(static_cast<int>(sipCpp->at(i)),
|
||||
sipType_QSsl_SupportedFeature);
|
||||
|
||||
if (!eobj)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(l, i, eobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *iter = PyObject_GetIter(sipPy);
|
||||
|
||||
if (!sipIsErr)
|
||||
{
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(iter);
|
||||
|
||||
return (iter && !PyBytes_Check(sipPy) && !PyUnicode_Check(sipPy));
|
||||
}
|
||||
|
||||
if (!iter)
|
||||
{
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<QSsl::SupportedFeature> *ql = new QList<QSsl::SupportedFeature>;
|
||||
|
||||
for (Py_ssize_t i = 0; ; ++i)
|
||||
{
|
||||
PyErr_Clear();
|
||||
PyObject *itm = PyIter_Next(iter);
|
||||
|
||||
if (!itm)
|
||||
{
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
delete ql;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
int v = sipConvertToEnum(itm, sipType_QSsl_SupportedFeature);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"index %zd has type '%s' but 'QSsl.SupportedFeature' is expected",
|
||||
i, sipPyTypeName(Py_TYPE(itm)));
|
||||
|
||||
Py_DECREF(itm);
|
||||
delete ql;
|
||||
Py_DECREF(iter);
|
||||
*sipIsErr = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ql->append(static_cast<QSsl::SupportedFeature>(v));
|
||||
|
||||
Py_DECREF(itm);
|
||||
}
|
||||
|
||||
Py_DECREF(iter);
|
||||
|
||||
*sipCppPtr = ql;
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,208 @@
|
||||
// This is the SIP interface definition for the QMap and QMultiMap based mapped
|
||||
// types specific to the QtNetwork module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
%MappedType QMultiMap<QSsl::AlternativeNameEntryType, QString>
|
||||
/TypeHintOut="Dict[QSsl.AlternativeNameEntryType, List[QString]]",
|
||||
TypeHintValue="[]"/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qmap.h>
|
||||
#include <qssl.h>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
// Get the enum member objects that are the dictionary keys.
|
||||
static PyObject *email_entry = 0;
|
||||
|
||||
if (!email_entry)
|
||||
{
|
||||
email_entry = sipConvertFromEnum(static_cast<int>(QSsl::EmailEntry),
|
||||
sipType_QSsl_AlternativeNameEntryType);
|
||||
if (!email_entry)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *dns_entry = 0;
|
||||
|
||||
if (!dns_entry)
|
||||
{
|
||||
dns_entry = sipConvertFromEnum(static_cast<int>(QSsl::DnsEntry),
|
||||
sipType_QSsl_AlternativeNameEntryType);
|
||||
if (!dns_entry)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *ip_address_entry = 0;
|
||||
|
||||
if (!ip_address_entry)
|
||||
{
|
||||
ip_address_entry = sipConvertFromEnum(
|
||||
static_cast<int>(QSsl::IpAddressEntry),
|
||||
sipType_QSsl_AlternativeNameEntryType);
|
||||
if (!ip_address_entry)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Create the dictionary.
|
||||
PyObject *d = PyDict_New();
|
||||
|
||||
if (!d)
|
||||
return 0;
|
||||
|
||||
QList<QString> vl;
|
||||
|
||||
// Handle the Qssl::EmailEntry key.
|
||||
vl = sipCpp->values(QSsl::EmailEntry);
|
||||
|
||||
if (!vl.isEmpty())
|
||||
{
|
||||
PyObject *vlobj = PyList_New(vl.count());
|
||||
|
||||
if (!vlobj)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rc = PyDict_SetItem(d, email_entry, vlobj);
|
||||
|
||||
Py_DECREF(vlobj);
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < vl.count(); ++i)
|
||||
{
|
||||
QString *s = new QString(vl.at(i));
|
||||
PyObject *vobj = sipConvertFromNewType(s, sipType_QString,
|
||||
sipTransferObj);
|
||||
|
||||
if (!vobj)
|
||||
{
|
||||
delete s;
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(vlobj, i, vobj);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the Qssl::DnsEntry key.
|
||||
vl = sipCpp->values(QSsl::DnsEntry);
|
||||
|
||||
if (!vl.isEmpty())
|
||||
{
|
||||
PyObject *vlobj = PyList_New(vl.count());
|
||||
|
||||
if (!vlobj)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rc = PyDict_SetItem(d, dns_entry, vlobj);
|
||||
|
||||
Py_DECREF(vlobj);
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < vl.count(); ++i)
|
||||
{
|
||||
QString *s = new QString(vl.at(i));
|
||||
PyObject *vobj = sipConvertFromNewType(s, sipType_QString,
|
||||
sipTransferObj);
|
||||
|
||||
if (!vobj)
|
||||
{
|
||||
delete s;
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(vlobj, i, vobj);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the Qssl::IpAddressEntry key.
|
||||
vl = sipCpp->values(QSsl::IpAddressEntry);
|
||||
|
||||
if (!vl.isEmpty())
|
||||
{
|
||||
PyObject *vlobj = PyList_New(vl.count());
|
||||
|
||||
if (!vlobj)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rc = PyDict_SetItem(d, ip_address_entry, vlobj);
|
||||
|
||||
Py_DECREF(vlobj);
|
||||
|
||||
if (rc < 0)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < vl.count(); ++i)
|
||||
{
|
||||
QString *s = new QString(vl.at(i));
|
||||
PyObject *vobj = sipConvertFromNewType(s, sipType_QString,
|
||||
sipTransferObj);
|
||||
|
||||
if (!vobj)
|
||||
{
|
||||
delete s;
|
||||
Py_DECREF(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyList_SetItem(vlobj, i, vobj);
|
||||
}
|
||||
}
|
||||
|
||||
return d;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
if (!sipIsErr)
|
||||
return PyDict_Check(sipPy);
|
||||
|
||||
PyErr_SetString(PyExc_NotImplementedError,
|
||||
"converting to QMultiMap<QSsl::AlternativeNameEntryType, QString> is unsupported");
|
||||
|
||||
return 0;
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,60 @@
|
||||
// qrestaccessmanager.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
class QRestAccessManager : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qrestaccessmanager.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QRestAccessManager(QNetworkAccessManager *manager, QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QRestAccessManager();
|
||||
QNetworkAccessManager *networkAccessManager() const;
|
||||
QNetworkReply *deleteResource(const QNetworkRequest &request) /Transfer/;
|
||||
QNetworkReply *head(const QNetworkRequest &request) /Transfer/;
|
||||
QNetworkReply *get(const QNetworkRequest &request) /Transfer/;
|
||||
QNetworkReply *get(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *get(const QNetworkRequest &request, const QJsonDocument &data) /Transfer/;
|
||||
QNetworkReply *get(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, const QJsonDocument &data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, const QVariantMap &data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, QHttpMultiPart *data) /Transfer/;
|
||||
QNetworkReply *post(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, const QJsonDocument &data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, const QVariantMap &data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *data) /Transfer/;
|
||||
QNetworkReply *put(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *patch(const QNetworkRequest &request, const QJsonDocument &data) /Transfer/;
|
||||
QNetworkReply *patch(const QNetworkRequest &request, const QVariantMap &data) /Transfer/;
|
||||
QNetworkReply *patch(const QNetworkRequest &request, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *patch(const QNetworkRequest &request, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &method, const QByteArray &data) /Transfer/;
|
||||
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &method, QIODevice *data) /Transfer/;
|
||||
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &method, QHttpMultiPart *data) /Transfer/;
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,50 @@
|
||||
// qrestreply.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_8_0 -)
|
||||
|
||||
class QRestReply
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qrestreply.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QRestReply(QNetworkReply *reply);
|
||||
~QRestReply();
|
||||
void swap(QRestReply &other /Constrained/);
|
||||
QNetworkReply *networkReply() const;
|
||||
std::optional<QJsonDocument> readJson(QJsonParseError *error = 0);
|
||||
QByteArray readBody();
|
||||
QString readText();
|
||||
bool isSuccess() const;
|
||||
int httpStatus() const;
|
||||
bool isHttpStatusSuccess() const;
|
||||
bool hasError() const;
|
||||
QNetworkReply::NetworkError error() const;
|
||||
QString errorString() const;
|
||||
|
||||
private:
|
||||
QRestReply(const QRestReply &);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,169 @@
|
||||
// qssl.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
namespace QSsl
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qssl.h>
|
||||
%End
|
||||
|
||||
enum KeyType
|
||||
{
|
||||
PrivateKey,
|
||||
PublicKey,
|
||||
};
|
||||
|
||||
enum EncodingFormat
|
||||
{
|
||||
Pem,
|
||||
Der,
|
||||
};
|
||||
|
||||
enum KeyAlgorithm
|
||||
{
|
||||
Opaque,
|
||||
Rsa,
|
||||
Dsa,
|
||||
Ec,
|
||||
Dh,
|
||||
};
|
||||
|
||||
enum AlternativeNameEntryType
|
||||
{
|
||||
EmailEntry,
|
||||
DnsEntry,
|
||||
IpAddressEntry,
|
||||
};
|
||||
|
||||
enum SslProtocol
|
||||
{
|
||||
UnknownProtocol,
|
||||
TlsV1_0,
|
||||
TlsV1_0OrLater,
|
||||
TlsV1_1,
|
||||
TlsV1_1OrLater,
|
||||
TlsV1_2,
|
||||
TlsV1_2OrLater,
|
||||
AnyProtocol,
|
||||
SecureProtocols,
|
||||
DtlsV1_0,
|
||||
DtlsV1_0OrLater,
|
||||
DtlsV1_2,
|
||||
DtlsV1_2OrLater,
|
||||
TlsV1_3,
|
||||
TlsV1_3OrLater,
|
||||
};
|
||||
|
||||
enum SslOption /BaseType=Flag/
|
||||
{
|
||||
SslOptionDisableEmptyFragments,
|
||||
SslOptionDisableSessionTickets,
|
||||
SslOptionDisableCompression,
|
||||
SslOptionDisableServerNameIndication,
|
||||
SslOptionDisableLegacyRenegotiation,
|
||||
SslOptionDisableSessionSharing,
|
||||
SslOptionDisableSessionPersistence,
|
||||
SslOptionDisableServerCipherPreference,
|
||||
};
|
||||
|
||||
typedef QFlags<QSsl::SslOption> SslOptions;
|
||||
|
||||
enum class AlertLevel
|
||||
{
|
||||
Warning,
|
||||
Fatal,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
enum class AlertType
|
||||
{
|
||||
CloseNotify,
|
||||
UnexpectedMessage,
|
||||
BadRecordMac,
|
||||
RecordOverflow,
|
||||
DecompressionFailure,
|
||||
HandshakeFailure,
|
||||
NoCertificate,
|
||||
BadCertificate,
|
||||
UnsupportedCertificate,
|
||||
CertificateRevoked,
|
||||
CertificateExpired,
|
||||
CertificateUnknown,
|
||||
IllegalParameter,
|
||||
UnknownCa,
|
||||
AccessDenied,
|
||||
DecodeError,
|
||||
DecryptError,
|
||||
ExportRestriction,
|
||||
ProtocolVersion,
|
||||
InsufficientSecurity,
|
||||
InternalError,
|
||||
InappropriateFallback,
|
||||
UserCancelled,
|
||||
NoRenegotiation,
|
||||
MissingExtension,
|
||||
UnsupportedExtension,
|
||||
CertificateUnobtainable,
|
||||
UnrecognizedName,
|
||||
BadCertificateStatusResponse,
|
||||
BadCertificateHashValue,
|
||||
UnknownPskIdentity,
|
||||
CertificateRequired,
|
||||
NoApplicationProtocol,
|
||||
UnknownAlertMessage,
|
||||
};
|
||||
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
enum class ImplementedClass
|
||||
{
|
||||
Key,
|
||||
Certificate,
|
||||
Socket,
|
||||
DiffieHellman,
|
||||
EllipticCurve,
|
||||
Dtls,
|
||||
%If (Qt_6_2_0 -)
|
||||
DtlsCookie,
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
|
||||
enum class SupportedFeature
|
||||
{
|
||||
CertificateVerification,
|
||||
ClientSideAlpn,
|
||||
ServerSideAlpn,
|
||||
Ocsp,
|
||||
Psk,
|
||||
SessionTicket,
|
||||
Alerts,
|
||||
};
|
||||
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,98 @@
|
||||
// qsslcertificate.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslCertificate
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslcertificate.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SubjectInfo
|
||||
{
|
||||
Organization,
|
||||
CommonName,
|
||||
LocalityName,
|
||||
OrganizationalUnitName,
|
||||
CountryName,
|
||||
StateOrProvinceName,
|
||||
DistinguishedNameQualifier,
|
||||
SerialNumber,
|
||||
EmailAddress,
|
||||
};
|
||||
|
||||
QSslCertificate(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem) /ReleaseGIL/;
|
||||
QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem);
|
||||
QSslCertificate(const QSslCertificate &other);
|
||||
~QSslCertificate();
|
||||
bool operator==(const QSslCertificate &other) const;
|
||||
bool operator!=(const QSslCertificate &other) const;
|
||||
bool isNull() const;
|
||||
void clear();
|
||||
QByteArray version() const;
|
||||
QByteArray serialNumber() const;
|
||||
QByteArray digest(QCryptographicHash::Algorithm algorithm = QCryptographicHash::Md5) const;
|
||||
QStringList issuerInfo(QSslCertificate::SubjectInfo info) const;
|
||||
QStringList issuerInfo(const QByteArray &attribute) const;
|
||||
QStringList subjectInfo(QSslCertificate::SubjectInfo info) const;
|
||||
QStringList subjectInfo(const QByteArray &attribute) const;
|
||||
QMultiMap<QSsl::AlternativeNameEntryType, QString> subjectAlternativeNames() const;
|
||||
QDateTime effectiveDate() const;
|
||||
QDateTime expiryDate() const;
|
||||
QSslKey publicKey() const;
|
||||
QByteArray toPem() const;
|
||||
QByteArray toDer() const;
|
||||
static QList<QSslCertificate> fromPath(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QSslCertificate::PatternSyntax syntax = QSslCertificate::PatternSyntax::FixedString);
|
||||
static QList<QSslCertificate> fromDevice(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
|
||||
static QList<QSslCertificate> fromData(const QByteArray &data, QSsl::EncodingFormat format = QSsl::Pem);
|
||||
%If (Qt_6_10_0 -)
|
||||
static QList<QSslCertificate> fromFile(const QString &filePath, QSsl::EncodingFormat format = QSsl::Pem);
|
||||
%End
|
||||
Qt::HANDLE handle() const;
|
||||
void swap(QSslCertificate &other /Constrained/);
|
||||
bool isBlacklisted() const;
|
||||
QList<QByteArray> subjectInfoAttributes() const;
|
||||
QList<QByteArray> issuerInfoAttributes() const;
|
||||
QList<QSslCertificateExtension> extensions() const;
|
||||
QString toText() const;
|
||||
static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName = QString());
|
||||
bool isSelfSigned() const;
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
|
||||
static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *certificate, QList<QSslCertificate> *caCertificates = 0, const QByteArray &passPhrase = QByteArray()) /ReleaseGIL/;
|
||||
QString issuerDisplayName() const;
|
||||
QString subjectDisplayName() const;
|
||||
|
||||
enum class PatternSyntax
|
||||
{
|
||||
RegularExpression,
|
||||
Wildcard,
|
||||
FixedString,
|
||||
};
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,43 @@
|
||||
// qsslcertificateextension.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslCertificateExtension
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslcertificateextension.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSslCertificateExtension();
|
||||
QSslCertificateExtension(const QSslCertificateExtension &other);
|
||||
~QSslCertificateExtension();
|
||||
void swap(QSslCertificateExtension &other /Constrained/);
|
||||
QString oid() const;
|
||||
QString name() const;
|
||||
QVariant value() const;
|
||||
bool isCritical() const;
|
||||
bool isSupported() const;
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,51 @@
|
||||
// qsslcipher.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslCipher
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslcipher.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSslCipher();
|
||||
explicit QSslCipher(const QString &name);
|
||||
QSslCipher(const QString &name, QSsl::SslProtocol protocol);
|
||||
QSslCipher(const QSslCipher &other);
|
||||
~QSslCipher();
|
||||
bool operator==(const QSslCipher &other) const;
|
||||
bool operator!=(const QSslCipher &other) const;
|
||||
bool isNull() const;
|
||||
QString name() const;
|
||||
int supportedBits() const;
|
||||
int usedBits() const;
|
||||
QString keyExchangeMethod() const;
|
||||
QString authenticationMethod() const;
|
||||
QString encryptionMethod() const;
|
||||
QString protocolString() const;
|
||||
QSsl::SslProtocol protocol() const;
|
||||
void swap(QSslCipher &other /Constrained/);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,124 @@
|
||||
// qsslconfiguration.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslConfiguration
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslconfiguration.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSslConfiguration();
|
||||
QSslConfiguration(const QSslConfiguration &other);
|
||||
~QSslConfiguration();
|
||||
bool isNull() const;
|
||||
QSsl::SslProtocol protocol() const;
|
||||
void setProtocol(QSsl::SslProtocol protocol);
|
||||
QSslSocket::PeerVerifyMode peerVerifyMode() const;
|
||||
void setPeerVerifyMode(QSslSocket::PeerVerifyMode mode);
|
||||
int peerVerifyDepth() const;
|
||||
void setPeerVerifyDepth(int depth);
|
||||
QSslCertificate localCertificate() const;
|
||||
void setLocalCertificate(const QSslCertificate &certificate);
|
||||
QSslCertificate peerCertificate() const;
|
||||
QList<QSslCertificate> peerCertificateChain() const;
|
||||
QSslCipher sessionCipher() const;
|
||||
QSslKey privateKey() const;
|
||||
void setPrivateKey(const QSslKey &key);
|
||||
QList<QSslCipher> ciphers() const;
|
||||
void setCiphers(const QString &ciphers);
|
||||
void setCiphers(const QList<QSslCipher> &ciphers);
|
||||
QList<QSslCertificate> caCertificates() const;
|
||||
void setCaCertificates(const QList<QSslCertificate> &certificates);
|
||||
static QSslConfiguration defaultConfiguration();
|
||||
static void setDefaultConfiguration(const QSslConfiguration &configuration);
|
||||
bool operator==(const QSslConfiguration &other) const;
|
||||
bool operator!=(const QSslConfiguration &other) const;
|
||||
void setSslOption(QSsl::SslOption option, bool on);
|
||||
bool testSslOption(QSsl::SslOption option) const;
|
||||
void swap(QSslConfiguration &other /Constrained/);
|
||||
QList<QSslCertificate> localCertificateChain() const;
|
||||
void setLocalCertificateChain(const QList<QSslCertificate> &localChain);
|
||||
QByteArray sessionTicket() const;
|
||||
void setSessionTicket(const QByteArray &sessionTicket);
|
||||
int sessionTicketLifeTimeHint() const;
|
||||
|
||||
enum NextProtocolNegotiationStatus
|
||||
{
|
||||
NextProtocolNegotiationNone,
|
||||
NextProtocolNegotiationNegotiated,
|
||||
NextProtocolNegotiationUnsupported,
|
||||
};
|
||||
|
||||
void setAllowedNextProtocols(const QList<QByteArray> &protocols);
|
||||
QList<QByteArray> allowedNextProtocols() const;
|
||||
QByteArray nextNegotiatedProtocol() const;
|
||||
QSslConfiguration::NextProtocolNegotiationStatus nextProtocolNegotiationStatus() const;
|
||||
QSsl::SslProtocol sessionProtocol() const;
|
||||
static QList<QSslCipher> supportedCiphers();
|
||||
static QList<QSslCertificate> systemCaCertificates();
|
||||
QList<QSslEllipticCurve> ellipticCurves() const;
|
||||
void setEllipticCurves(const QList<QSslEllipticCurve> &curves);
|
||||
static QList<QSslEllipticCurve> supportedEllipticCurves();
|
||||
QSslKey ephemeralServerKey() const;
|
||||
QByteArray preSharedKeyIdentityHint() const;
|
||||
void setPreSharedKeyIdentityHint(const QByteArray &hint);
|
||||
QSslDiffieHellmanParameters diffieHellmanParameters() const;
|
||||
void setDiffieHellmanParameters(const QSslDiffieHellmanParameters &dhparams);
|
||||
QMap<QByteArray, QVariant> backendConfiguration() const;
|
||||
void setBackendConfigurationOption(const QByteArray &name, const QVariant &value);
|
||||
void setBackendConfiguration(const QMap<QByteArray, QVariant> &backendConfiguration = QMap<QByteArray, QVariant>());
|
||||
void setOcspStaplingEnabled(bool enable);
|
||||
bool ocspStaplingEnabled() const;
|
||||
void addCaCertificate(const QSslCertificate &certificate);
|
||||
bool addCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QSslCertificate::PatternSyntax syntax = QSslCertificate::PatternSyntax::FixedString);
|
||||
void addCaCertificates(const QList<QSslCertificate> &certificates);
|
||||
bool handshakeMustInterruptOnError() const;
|
||||
void setHandshakeMustInterruptOnError(bool interrupt);
|
||||
bool missingCertificateIsFatal() const;
|
||||
void setMissingCertificateIsFatal(bool cannotRecover);
|
||||
static const char *NextProtocolHttp1_1 /Encoding="None",NoSetter/;
|
||||
%If (Qt_6_3_0 -)
|
||||
%If (PyQt_DTLS)
|
||||
bool dtlsCookieVerificationEnabled() const;
|
||||
%End
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
%If (PyQt_DTLS)
|
||||
void setDtlsCookieVerificationEnabled(bool enable);
|
||||
%End
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
%If (PyQt_DTLS)
|
||||
static QSslConfiguration defaultDtlsConfiguration();
|
||||
%End
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
%If (PyQt_DTLS)
|
||||
static void setDefaultDtlsConfiguration(const QSslConfiguration &configuration);
|
||||
%End
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,62 @@
|
||||
// qssldiffiehellmanparameters.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslDiffieHellmanParameters
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qssldiffiehellmanparameters.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Error
|
||||
{
|
||||
NoError,
|
||||
InvalidInputDataError,
|
||||
UnsafeParametersError,
|
||||
};
|
||||
|
||||
QSslDiffieHellmanParameters();
|
||||
QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other);
|
||||
~QSslDiffieHellmanParameters();
|
||||
void swap(QSslDiffieHellmanParameters &other /Constrained/);
|
||||
static QSslDiffieHellmanParameters defaultParameters();
|
||||
static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem);
|
||||
static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem);
|
||||
bool isEmpty() const;
|
||||
bool isValid() const;
|
||||
QSslDiffieHellmanParameters::Error error() const;
|
||||
QString errorString() const;
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,51 @@
|
||||
// qsslellipticcurve.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslEllipticCurve
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslellipticcurve.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSslEllipticCurve();
|
||||
static QSslEllipticCurve fromShortName(const QString &name);
|
||||
static QSslEllipticCurve fromLongName(const QString &name);
|
||||
QString shortName() const;
|
||||
QString longName() const;
|
||||
bool isValid() const;
|
||||
bool isTlsNamedCurve() const;
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs);
|
||||
%End
|
||||
@@ -0,0 +1,91 @@
|
||||
// qsslerror.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslError
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslerror.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SslError
|
||||
{
|
||||
UnspecifiedError,
|
||||
NoError,
|
||||
UnableToGetIssuerCertificate,
|
||||
UnableToDecryptCertificateSignature,
|
||||
UnableToDecodeIssuerPublicKey,
|
||||
CertificateSignatureFailed,
|
||||
CertificateNotYetValid,
|
||||
CertificateExpired,
|
||||
InvalidNotBeforeField,
|
||||
InvalidNotAfterField,
|
||||
SelfSignedCertificate,
|
||||
SelfSignedCertificateInChain,
|
||||
UnableToGetLocalIssuerCertificate,
|
||||
UnableToVerifyFirstCertificate,
|
||||
CertificateRevoked,
|
||||
InvalidCaCertificate,
|
||||
PathLengthExceeded,
|
||||
InvalidPurpose,
|
||||
CertificateUntrusted,
|
||||
CertificateRejected,
|
||||
SubjectIssuerMismatch,
|
||||
AuthorityIssuerSerialNumberMismatch,
|
||||
NoPeerCertificate,
|
||||
HostNameMismatch,
|
||||
NoSslSupport,
|
||||
CertificateBlacklisted,
|
||||
CertificateStatusUnknown,
|
||||
OcspNoResponseFound,
|
||||
OcspMalformedRequest,
|
||||
OcspMalformedResponse,
|
||||
OcspInternalError,
|
||||
OcspTryLater,
|
||||
OcspSigRequred,
|
||||
OcspUnauthorized,
|
||||
OcspResponseCannotBeTrusted,
|
||||
OcspResponseCertIdUnknown,
|
||||
OcspResponseExpired,
|
||||
OcspStatusUnknown,
|
||||
};
|
||||
|
||||
QSslError();
|
||||
explicit QSslError(QSslError::SslError error);
|
||||
QSslError(QSslError::SslError error, const QSslCertificate &certificate);
|
||||
QSslError(const QSslError &other);
|
||||
~QSslError();
|
||||
QSslError::SslError error() const;
|
||||
QString errorString() const;
|
||||
QSslCertificate certificate() const;
|
||||
bool operator==(const QSslError &other) const;
|
||||
bool operator!=(const QSslError &other) const;
|
||||
void swap(QSslError &other /Constrained/);
|
||||
Py_hash_t __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,51 @@
|
||||
// qsslkey.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslKey
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslkey.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSslKey();
|
||||
QSslKey(const QByteArray &encoded, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray());
|
||||
QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat encoding = QSsl::Pem, QSsl::KeyType type = QSsl::PrivateKey, const QByteArray &passPhrase = QByteArray());
|
||||
QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey);
|
||||
QSslKey(const QSslKey &other);
|
||||
~QSslKey();
|
||||
bool isNull() const;
|
||||
void clear();
|
||||
int length() const;
|
||||
QSsl::KeyType type() const;
|
||||
QSsl::KeyAlgorithm algorithm() const;
|
||||
QByteArray toPem(const QByteArray &passPhrase = QByteArray()) const;
|
||||
QByteArray toDer(const QByteArray &passPhrase = QByteArray()) const;
|
||||
Qt::HANDLE handle() const;
|
||||
bool operator==(const QSslKey &key) const;
|
||||
bool operator!=(const QSslKey &key) const;
|
||||
void swap(QSslKey &other /Constrained/);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,51 @@
|
||||
// qsslpresharedkeyauthenticator.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslPreSharedKeyAuthenticator
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslpresharedkeyauthenticator.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QSslPreSharedKeyAuthenticator();
|
||||
QSslPreSharedKeyAuthenticator(const QSslPreSharedKeyAuthenticator &authenticator);
|
||||
~QSslPreSharedKeyAuthenticator();
|
||||
void swap(QSslPreSharedKeyAuthenticator &authenticator /Constrained/);
|
||||
QByteArray identityHint() const;
|
||||
void setIdentity(const QByteArray &identity);
|
||||
QByteArray identity() const;
|
||||
int maximumIdentityLength() const;
|
||||
void setPreSharedKey(const QByteArray &preSharedKey);
|
||||
QByteArray preSharedKey() const;
|
||||
int maximumPreSharedKeyLength() const;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs);
|
||||
%End
|
||||
%If (PyQt_SSL)
|
||||
bool operator!=(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs);
|
||||
%End
|
||||
@@ -0,0 +1,55 @@
|
||||
// qsslserver.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_6_4_0 -)
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslServer : public QTcpServer
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslserver.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QSslServer(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QSslServer();
|
||||
void setSslConfiguration(const QSslConfiguration &sslConfiguration);
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
void setHandshakeTimeout(int timeout);
|
||||
int handshakeTimeout() const;
|
||||
|
||||
signals:
|
||||
void sslErrors(QSslSocket *socket, const QList<QSslError> &errors);
|
||||
void peerVerifyError(QSslSocket *socket, const QSslError &error);
|
||||
void errorOccurred(QSslSocket *socket, QAbstractSocket::SocketError error);
|
||||
void preSharedKeyAuthenticationRequired(QSslSocket *socket, QSslPreSharedKeyAuthenticator *authenticator);
|
||||
void alertSent(QSslSocket *socket, QSsl::AlertLevel level, QSsl::AlertType type, const QString &description);
|
||||
void alertReceived(QSslSocket *socket, QSsl::AlertLevel level, QSsl::AlertType type, const QString &description);
|
||||
void handshakeInterruptedOnError(QSslSocket *socket, const QSslError &error);
|
||||
void startedEncryptionHandshake(QSslSocket *socket);
|
||||
|
||||
protected:
|
||||
virtual void incomingConnection(qintptr socket);
|
||||
};
|
||||
|
||||
%End
|
||||
%End
|
||||
@@ -0,0 +1,225 @@
|
||||
// qsslsocket.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (PyQt_SSL)
|
||||
|
||||
class QSslSocket : public QTcpSocket
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qsslsocket.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum SslMode
|
||||
{
|
||||
UnencryptedMode,
|
||||
SslClientMode,
|
||||
SslServerMode,
|
||||
};
|
||||
|
||||
explicit QSslSocket(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QSslSocket();
|
||||
void connectToHostEncrypted(const QString &hostName, quint16 port, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
|
||||
void connectToHostEncrypted(const QString &hostName, quint16 port, const QString &sslPeerName, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
|
||||
virtual bool setSocketDescriptor(qintptr socketDescriptor, QAbstractSocket::SocketState state = QAbstractSocket::ConnectedState, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite);
|
||||
QSslSocket::SslMode mode() const;
|
||||
bool isEncrypted() const;
|
||||
QSsl::SslProtocol protocol() const;
|
||||
void setProtocol(QSsl::SslProtocol protocol);
|
||||
virtual qint64 bytesAvailable() const;
|
||||
virtual qint64 bytesToWrite() const;
|
||||
virtual bool canReadLine() const;
|
||||
virtual void close();
|
||||
virtual bool atEnd() const;
|
||||
void setLocalCertificate(const QSslCertificate &certificate);
|
||||
void setLocalCertificate(const QString &path, QSsl::EncodingFormat format = QSsl::Pem);
|
||||
QSslCertificate localCertificate() const;
|
||||
QSslCertificate peerCertificate() const;
|
||||
QList<QSslCertificate> peerCertificateChain() const;
|
||||
QSslCipher sessionCipher() const;
|
||||
void setPrivateKey(const QSslKey &key);
|
||||
void setPrivateKey(const QString &fileName, QSsl::KeyAlgorithm algorithm = QSsl::Rsa, QSsl::EncodingFormat format = QSsl::Pem, const QByteArray &passPhrase = QByteArray());
|
||||
QSslKey privateKey() const;
|
||||
virtual bool waitForConnected(int msecs = 30000) /ReleaseGIL/;
|
||||
bool waitForEncrypted(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForReadyRead(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForBytesWritten(int msecs = 30000) /ReleaseGIL/;
|
||||
virtual bool waitForDisconnected(int msecs = 30000) /ReleaseGIL/;
|
||||
static bool supportsSsl();
|
||||
|
||||
public slots:
|
||||
void startClientEncryption();
|
||||
void startServerEncryption();
|
||||
void ignoreSslErrors();
|
||||
|
||||
signals:
|
||||
void encrypted();
|
||||
void sslErrors(const QList<QSslError> &errors);
|
||||
void modeChanged(QSslSocket::SslMode newMode);
|
||||
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
|
||||
|
||||
protected:
|
||||
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="bytes",ReleaseGIL/ [qint64 (char *data, qint64 maxlen)];
|
||||
%MethodCode
|
||||
// Return the data read or None if there was an error.
|
||||
if (a0 < 0)
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *s = new char[a0];
|
||||
qint64 len;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
len = sipSelfWasArg ? sipCpp->QSslSocket::readData(s, a0) : sipCpp->readData(s, a0);
|
||||
#else
|
||||
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = PyBytes_FromStringAndSize(s, len);
|
||||
|
||||
if (!sipRes)
|
||||
sipIsErr = 1;
|
||||
}
|
||||
|
||||
delete[] s;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
|
||||
%MethodCode
|
||||
sipBufferInfoDef bi;
|
||||
|
||||
if (sipGetBufferInfo(a0, &bi) > 0)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#if defined(SIP_PROTECTED_IS_PUBLIC)
|
||||
sipRes = sipSelfWasArg ?
|
||||
sipCpp->QSslSocket::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
|
||||
sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
|
||||
#else
|
||||
sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
|
||||
bi.bi_len);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
sipReleaseBufferInfo(&bi);
|
||||
}
|
||||
else
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
%End
|
||||
|
||||
virtual qint64 skipData(qint64 maxSize) /ReleaseGIL/;
|
||||
|
||||
public:
|
||||
enum PeerVerifyMode
|
||||
{
|
||||
VerifyNone,
|
||||
QueryPeer,
|
||||
VerifyPeer,
|
||||
AutoVerifyPeer,
|
||||
};
|
||||
|
||||
QSslSocket::PeerVerifyMode peerVerifyMode() const;
|
||||
void setPeerVerifyMode(QSslSocket::PeerVerifyMode mode);
|
||||
int peerVerifyDepth() const;
|
||||
void setPeerVerifyDepth(int depth);
|
||||
virtual void setReadBufferSize(qint64 size);
|
||||
qint64 encryptedBytesAvailable() const;
|
||||
qint64 encryptedBytesToWrite() const;
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
void setSslConfiguration(const QSslConfiguration &config);
|
||||
|
||||
signals:
|
||||
void peerVerifyError(const QSslError &error);
|
||||
void encryptedBytesWritten(qint64 totalBytes);
|
||||
void newSessionTicketReceived();
|
||||
|
||||
public:
|
||||
virtual void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
|
||||
virtual QVariant socketOption(QAbstractSocket::SocketOption option);
|
||||
void ignoreSslErrors(const QList<QSslError> &errors);
|
||||
QString peerVerifyName() const;
|
||||
void setPeerVerifyName(const QString &hostName);
|
||||
virtual void resume() /ReleaseGIL/;
|
||||
virtual void connectToHost(const QString &hostName, quint16 port, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
|
||||
virtual void disconnectFromHost() /ReleaseGIL/;
|
||||
static long sslLibraryVersionNumber();
|
||||
static QString sslLibraryVersionString();
|
||||
void setLocalCertificateChain(const QList<QSslCertificate> &localChain);
|
||||
QList<QSslCertificate> localCertificateChain() const;
|
||||
QSsl::SslProtocol sessionProtocol() const;
|
||||
static long sslLibraryBuildVersionNumber();
|
||||
static QString sslLibraryBuildVersionString();
|
||||
QList<QOcspResponse> ocspResponses() const;
|
||||
QList<QSslError> sslHandshakeErrors() const;
|
||||
void continueInterruptedHandshake();
|
||||
|
||||
signals:
|
||||
void alertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description);
|
||||
void alertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description);
|
||||
void handshakeInterruptedOnError(const QSslError &error);
|
||||
|
||||
public:
|
||||
%If (Qt_6_1_0 -)
|
||||
static QList<QString> availableBackends();
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static QString activeBackend();
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static bool setActiveBackend(const QString &backendName);
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static QList<QSsl::SslProtocol> supportedProtocols(const QString &backendName = {});
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static bool isProtocolSupported(QSsl::SslProtocol protocol, const QString &backendName = {});
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static QList<QSsl::ImplementedClass> implementedClasses(const QString &backendName = {});
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static bool isClassImplemented(QSsl::ImplementedClass cl, const QString &backendName = {});
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static QList<QSsl::SupportedFeature> supportedFeatures(const QString &backendName = {});
|
||||
%End
|
||||
%If (Qt_6_1_0 -)
|
||||
static bool isFeatureSupported(QSsl::SupportedFeature feat, const QString &backendName = {});
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,71 @@
|
||||
// qtcpserver.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTcpServer : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtcpserver.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QTcpServer(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QTcpServer();
|
||||
bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
|
||||
void close();
|
||||
bool isListening() const;
|
||||
void setMaxPendingConnections(int numConnections);
|
||||
int maxPendingConnections() const;
|
||||
quint16 serverPort() const;
|
||||
QHostAddress serverAddress() const;
|
||||
qintptr socketDescriptor() const;
|
||||
bool setSocketDescriptor(qintptr socketDescriptor);
|
||||
bool waitForNewConnection(int msecs = 0, bool *timedOut = 0) /ReleaseGIL/;
|
||||
virtual bool hasPendingConnections() const;
|
||||
virtual QTcpSocket *nextPendingConnection();
|
||||
QAbstractSocket::SocketError serverError() const;
|
||||
QString errorString() const;
|
||||
void setProxy(const QNetworkProxy &networkProxy);
|
||||
QNetworkProxy proxy() const;
|
||||
void pauseAccepting();
|
||||
void resumeAccepting();
|
||||
|
||||
protected:
|
||||
virtual void incomingConnection(qintptr handle);
|
||||
void addPendingConnection(QTcpSocket *socket);
|
||||
|
||||
signals:
|
||||
void newConnection();
|
||||
void acceptError(QAbstractSocket::SocketError socketError);
|
||||
|
||||
public:
|
||||
%If (Qt_6_3_0 -)
|
||||
void setListenBacklogSize(int size);
|
||||
%End
|
||||
%If (Qt_6_3_0 -)
|
||||
int listenBacklogSize() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_6_4_0 -)
|
||||
void pendingConnectionAvailable();
|
||||
%End
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
// qtcpsocket.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QTcpSocket : public QAbstractSocket
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qtcpsocket.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QTcpSocket(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QTcpSocket();
|
||||
};
|
||||
@@ -0,0 +1,95 @@
|
||||
// qudpsocket.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNetwork Python extension module.
|
||||
//
|
||||
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt6.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
class QUdpSocket : public QAbstractSocket
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qudpsocket.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QUdpSocket(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QUdpSocket();
|
||||
bool hasPendingDatagrams() const;
|
||||
qint64 pendingDatagramSize() const;
|
||||
SIP_PYOBJECT readDatagram(qint64 maxlen, QHostAddress *host /Out/ = 0, quint16 *port = 0) /TypeHint="bytes",ReleaseGIL/;
|
||||
%MethodCode
|
||||
// Return the data read or None if there was an error.
|
||||
if (a0 < 0)
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
|
||||
sipIsErr = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *s = new char[a0];
|
||||
qint64 len;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
len = sipCpp->readDatagram(s, a0, a1, &a2);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
Py_INCREF(Py_None);
|
||||
sipRes = Py_None;
|
||||
}
|
||||
else
|
||||
{
|
||||
sipRes = PyBytes_FromStringAndSize(s, len);
|
||||
|
||||
if (!sipRes)
|
||||
sipIsErr = 1;
|
||||
}
|
||||
|
||||
delete[] s;
|
||||
}
|
||||
%End
|
||||
|
||||
QNetworkDatagram receiveDatagram(qint64 maxSize = -1) /ReleaseGIL/;
|
||||
qint64 writeDatagram(SIP_PYBUFFER, const QHostAddress &, quint16) /ReleaseGIL/;
|
||||
%MethodCode
|
||||
sipBufferInfoDef bi;
|
||||
|
||||
if (sipGetBufferInfo(a0, &bi) > 0)
|
||||
{
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
sipRes = sipCpp->writeDatagram(reinterpret_cast<char *>(bi.bi_buf),
|
||||
bi.bi_len, *a1, a2);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
sipReleaseBufferInfo(&bi);
|
||||
}
|
||||
else
|
||||
{
|
||||
sipIsErr = 1;
|
||||
}
|
||||
%End
|
||||
|
||||
qint64 writeDatagram(const QNetworkDatagram &datagram) /ReleaseGIL/;
|
||||
bool joinMulticastGroup(const QHostAddress &groupAddress);
|
||||
bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface);
|
||||
bool leaveMulticastGroup(const QHostAddress &groupAddress);
|
||||
bool leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface);
|
||||
QNetworkInterface multicastInterface() const;
|
||||
void setMulticastInterface(const QNetworkInterface &iface);
|
||||
};
|
||||
Reference in New Issue
Block a user