This commit is contained in:
rattatwinko
2025-05-25 20:42:58 +02:00
commit 8e9b2568b2
4902 changed files with 1152638 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Automatically generated configuration for PyQt5.QtNetwork.
sip-version = "6.8.6"
sip-abi-version = "12.15"
module-tags = ["Qt_5_15_14", "WS_X11"]
module-disabled-features = []

View File

@@ -0,0 +1,88 @@
// QtNetworkmod.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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=PyQt5.QtNetwork, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip
%Copying
Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
This file is part of PyQt5.
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 sip.simplewrapper
%Include qabstractnetworkcache.sip
%Include qabstractsocket.sip
%Include qauthenticator.sip
%Include qdnslookup.sip
%Include qhostaddress.sip
%Include qhostinfo.sip
%Include qhstspolicy.sip
%Include qhttp2configuration.sip
%Include qhttpmultipart.sip
%Include qlocalserver.sip
%Include qlocalsocket.sip
%Include qnetworkaccessmanager.sip
%Include qnetworkconfigmanager.sip
%Include qnetworkconfiguration.sip
%Include qnetworkcookie.sip
%Include qnetworkcookiejar.sip
%Include qnetworkdatagram.sip
%Include qnetworkdiskcache.sip
%Include qnetworkinterface.sip
%Include qnetworkproxy.sip
%Include qnetworkreply.sip
%Include qnetworkrequest.sip
%Include qnetworksession.sip
%Include qocspresponse.sip
%Include qpassworddigestor.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 qsslsocket.sip
%Include qtcpserver.sip
%Include qtcpsocket.sip
%Include qudpsocket.sip
%Include qpynetwork_qhash.sip
%Include qpynetwork_qmap.sip

View File

@@ -0,0 +1,78 @@
// qabstractnetworkcache.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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<QPair<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/);
};
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);
};

View File

@@ -0,0 +1,317 @@
// qabstractsocket.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_QNetworkReply, &sipType_QNetworkReply, -1, 1},
{sipName_QHttpMultiPart, &sipType_QHttpMultiPart, -1, 2},
{sipName_QAbstractNetworkCache, &sipType_QAbstractNetworkCache, 12, 3},
{sipName_QNetworkConfigurationManager, &sipType_QNetworkConfigurationManager, -1, 4},
{sipName_QNetworkCookieJar, &sipType_QNetworkCookieJar, -1, 5},
{sipName_QAbstractSocket, &sipType_QAbstractSocket, 13, 6},
{sipName_QLocalSocket, &sipType_QLocalSocket, -1, 7},
{sipName_QDnsLookup, &sipType_QDnsLookup, -1, 8},
{sipName_QNetworkSession, &sipType_QNetworkSession, -1, 9},
{sipName_QTcpServer, &sipType_QTcpServer, -1, 10},
{sipName_QNetworkAccessManager, &sipType_QNetworkAccessManager, -1, 11},
{sipName_QLocalServer, &sipType_QLocalServer, -1, -1},
{sipName_QNetworkDiskCache, &sipType_QNetworkDiskCache, -1, -1},
{sipName_QUdpSocket, &sipType_QUdpSocket, -1, 14},
{sipName_QTcpSocket, &sipType_QTcpSocket, 15, -1},
#if defined(SIP_FEATURE_PyQt_SSL)
{sipName_QSslSocket, &sipType_QSslSocket, -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,
%If (Qt_5_8_0 -)
SctpSocket,
%End
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, QIODevice::OpenMode mode = QIODevice::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
virtual void connectToHost(const QHostAddress &address, quint16 port, QIODevice::OpenMode mode = QIODevice::ReadWrite) /ReleaseGIL/;
virtual void disconnectFromHost() /ReleaseGIL/;
bool isValid() const;
virtual qint64 bytesAvailable() const;
virtual qint64 bytesToWrite() const;
virtual bool canReadLine() 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, QIODevice::OpenMode mode = QIODevice::ReadWrite);
virtual qintptr socketDescriptor() const;
QAbstractSocket::SocketType socketType() const;
QAbstractSocket::SocketState state() const;
QAbstractSocket::SocketError error() const;
virtual void close();
virtual bool isSequential() const;
virtual bool atEnd() 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 error(QAbstractSocket::SocketError);
%If (Qt_5_15_0 -)
void errorOccurred(QAbstractSocket::SocketError);
%End
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="Py_v3:bytes;str",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 = SIPBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual SIP_PYOBJECT readLineData(qint64 maxlen) /TypeHint="Py_v3:bytes;str",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 = SIPBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(const char *data /Array/, qint64 len /ArraySize/) /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,
%If (Qt_5_3_0 -)
SendBufferSizeSocketOption,
%End
%If (Qt_5_3_0 -)
ReceiveBufferSizeSocketOption,
%End
%If (Qt_5_11_0 -)
PathMtuSocketOption,
%End
};
virtual void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
virtual QVariant socketOption(QAbstractSocket::SocketOption option);
enum BindFlag
{
DefaultForPlatform,
ShareAddress,
DontShareAddress,
ReuseAddressHint,
};
typedef QFlags<QAbstractSocket::BindFlag> BindMode;
enum PauseMode
{
PauseNever,
PauseOnSslErrors,
};
typedef QFlags<QAbstractSocket::PauseMode> PauseModes;
virtual void resume() /ReleaseGIL/;
QAbstractSocket::PauseModes pauseMode() const;
void setPauseMode(QAbstractSocket::PauseModes pauseMode);
bool bind(const QHostAddress &address, quint16 port = 0, QAbstractSocket::BindMode mode = QAbstractSocket::DefaultForPlatform);
bool bind(quint16 port = 0, QAbstractSocket::BindMode mode = QAbstractSocket::DefaultForPlatform);
%If (Qt_5_13_0 -)
QString protocolTag() const;
%End
%If (Qt_5_13_0 -)
void setProtocolTag(const QString &tag);
%End
};
QFlags<QAbstractSocket::BindFlag> operator|(QAbstractSocket::BindFlag f1, QFlags<QAbstractSocket::BindFlag> f2);
QFlags<QAbstractSocket::PauseMode> operator|(QAbstractSocket::PauseMode f1, QFlags<QAbstractSocket::PauseMode> f2);

View File

@@ -0,0 +1,44 @@
// qauthenticator.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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);
};

View File

@@ -0,0 +1,181 @@
// qdnslookup.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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;
};
class QDnsLookup : public QObject
{
%TypeHeaderCode
#include <qdnslookup.h>
%End
public:
enum Error
{
NoError,
ResolverError,
OperationCancelledError,
InvalidRequestError,
InvalidReplyError,
ServerFailureError,
ServerRefusedError,
NotFoundError,
};
enum Type
{
A,
AAAA,
ANY,
CNAME,
MX,
NS,
PTR,
SRV,
TXT,
};
explicit QDnsLookup(QObject *parent /TransferThis/ = 0);
QDnsLookup(QDnsLookup::Type type, const QString &name, QObject *parent /TransferThis/ = 0);
%If (Qt_5_5_0 -)
QDnsLookup(QDnsLookup::Type type, const QString &name, const QHostAddress &nameserver, 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);
void typeChanged(QDnsLookup::Type type /ScopesStripped=1/);
public:
%If (Qt_5_3_0 -)
QHostAddress nameserver() const;
%End
%If (Qt_5_3_0 -)
void setNameserver(const QHostAddress &nameserver);
%End
signals:
%If (Qt_5_3_0 -)
void nameserverChanged(const QHostAddress &nameserver);
%End
};

View File

@@ -0,0 +1,206 @@
// qhostaddress.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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.
if (sipIsErr == NULL)
return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QHostAddress_SpecialAddress)) ||
sipCanConvertToType(sipPy, sipType_QHostAddress, SIP_NO_CONVERTORS));
if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QHostAddress_SpecialAddress)))
{
*sipCppPtr = new QHostAddress((QHostAddress::SpecialAddress)SIPLong_AsLong(sipPy));
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 &copy);
~QHostAddress();
%If (Qt_5_8_0 -)
void setAddress(QHostAddress::SpecialAddress address /Constrained/);
%End
void setAddress(quint32 ip4Addr);
bool setAddress(const QString &address);
void setAddress(const Q_IPV6ADDR &ip6Addr);
QAbstractSocket::NetworkLayerProtocol protocol() const;
quint32 toIPv4Address() 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();
long __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
bool isInSubnet(const QHostAddress &subnet, int netmask) const;
bool isInSubnet(const QPair<QHostAddress, int> &subnet) const;
bool isLoopback() const;
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
%If (Qt_5_6_0 -)
void swap(QHostAddress &other /Constrained/);
%End
%If (Qt_5_6_0 -)
bool isMulticast() const;
%End
%If (Qt_5_8_0 -)
enum ConversionModeFlag
{
ConvertV4MappedToIPv4,
ConvertV4CompatToIPv4,
ConvertUnspecifiedAddress,
ConvertLocalHost,
TolerantConversion,
StrictConversion,
};
%End
%If (Qt_5_8_0 -)
typedef QFlags<QHostAddress::ConversionModeFlag> ConversionMode;
%End
%If (Qt_5_8_0 -)
bool isEqual(const QHostAddress &address, QHostAddress::ConversionMode mode = QHostAddress::TolerantConversion) const;
%End
%If (Qt_5_11_0 -)
bool isGlobal() const;
%End
%If (Qt_5_11_0 -)
bool isLinkLocal() const;
%End
%If (Qt_5_11_0 -)
bool isSiteLocal() const;
%End
%If (Qt_5_11_0 -)
bool isUniqueLocalUnicast() const;
%End
%If (Qt_5_11_0 -)
bool isBroadcast() const;
%End
};
bool operator==(QHostAddress::SpecialAddress address1, const QHostAddress &address2);
%If (Qt_5_9_0 -)
bool operator!=(QHostAddress::SpecialAddress lhs, const QHostAddress &rhs);
%End
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 = SIPLong_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] = SIPLong_AsLong(itm);
Py_DECREF(itm);
}
*sipCppPtr = qa;
return sipGetState(sipTransferObj);
%End
};
%If (Qt_5_8_0 -)
QFlags<QHostAddress::ConversionModeFlag> operator|(QHostAddress::ConversionModeFlag f1, QFlags<QHostAddress::ConversionModeFlag> f2);
%End

View File

@@ -0,0 +1,89 @@
// qhostinfo.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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 = pyqt5_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();
%If (Qt_5_10_0 -)
void swap(QHostInfo &other /Constrained/);
%End
};
%ModuleHeaderCode
// Imports from QtCore.
typedef sipErrorState (*pyqt5_qtnetwork_get_connection_parts_t)(PyObject *, QObject *, const char *, bool, QObject **, QByteArray &);
extern pyqt5_qtnetwork_get_connection_parts_t pyqt5_qtnetwork_get_connection_parts;
%End
%ModuleCode
// Imports from QtCore.
pyqt5_qtnetwork_get_connection_parts_t pyqt5_qtnetwork_get_connection_parts;
%End
%PostInitialisationCode
// Imports from QtCore.
pyqt5_qtnetwork_get_connection_parts = (pyqt5_qtnetwork_get_connection_parts_t)sipImportSymbol("pyqt5_get_connection_parts");
Q_ASSERT(pyqt5_qtnetwork_get_connection_parts);
%End

View File

@@ -0,0 +1,61 @@
// qhstspolicy.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_9_0 -)
class QHstsPolicy
{
%TypeHeaderCode
#include <qhstspolicy.h>
%End
public:
enum PolicyFlag
{
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::ComponentFormattingOption::FullyDecoded) const;
void setExpiry(const QDateTime &expiry);
QDateTime expiry() const;
void setIncludesSubDomains(bool include);
bool includesSubDomains() const;
bool isExpired() const;
};
%End
%If (Qt_5_9_0 -)
bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs);
%End
%If (Qt_5_9_0 -)
bool operator!=(const QHstsPolicy &lhs, const QHstsPolicy &rhs);
%End
%If (Qt_5_9_0 -)
QFlags<QHstsPolicy::PolicyFlag> operator|(QHstsPolicy::PolicyFlag f1, QFlags<QHstsPolicy::PolicyFlag> f2);
%End

View File

@@ -0,0 +1,54 @@
// qhttp2configuration.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_14_0 -)
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/);
};
%End
%If (Qt_5_14_0 -)
bool operator==(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs);
%End
%If (Qt_5_14_0 -)
bool operator!=(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs);
%End

View File

@@ -0,0 +1,64 @@
// qhttpmultipart.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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);
};

View File

@@ -0,0 +1,70 @@
// qlocalserver.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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);
public:
enum SocketOption
{
UserAccessOption,
GroupAccessOption,
OtherAccessOption,
WorldAccessOption,
};
typedef QFlags<QLocalServer::SocketOption> SocketOptions;
void setSocketOptions(QLocalServer::SocketOptions options);
QLocalServer::SocketOptions socketOptions() const;
%If (Qt_5_10_0 -)
qintptr socketDescriptor() const;
%End
};
QFlags<QLocalServer::SocketOption> operator|(QLocalServer::SocketOption f1, QFlags<QLocalServer::SocketOption> f2);

View File

@@ -0,0 +1,136 @@
// qlocalsocket.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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, QIODevice::OpenMode mode = QIODevice::ReadWrite) /ReleaseGIL/;
%If (Qt_5_1_0 -)
void connectToServer(QIODevice::OpenMode mode = QIODevice::ReadWrite) /ReleaseGIL/;
%End
void disconnectFromServer() /ReleaseGIL/;
%If (Qt_5_1_0 -)
virtual bool open(QIODevice::OpenMode mode = QIODevice::ReadWrite);
%End
QString serverName() const;
%If (Qt_5_1_0 -)
void setServerName(const QString &name);
%End
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, QIODevice::OpenMode mode = QIODevice::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 error(QLocalSocket::LocalSocketError socketError);
%If (Qt_5_15_0 -)
void errorOccurred(QLocalSocket::LocalSocketError socketError);
%End
void stateChanged(QLocalSocket::LocalSocketState socketState);
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="Py_v3:bytes;str",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 = SIPBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(const char * /Array/, qint64 /ArraySize/) /ReleaseGIL/;
};

View File

@@ -0,0 +1,166 @@
// qnetworkaccessmanager.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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);
QNetworkReply *get(const QNetworkRequest &request);
QNetworkReply *post(const QNetworkRequest &request, QIODevice *data);
QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data);
QNetworkReply *post(const QNetworkRequest &request, QHttpMultiPart *multiPart);
QNetworkReply *put(const QNetworkRequest &request, QIODevice *data);
QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data);
QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *multiPart);
signals:
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
void finished(QNetworkReply *reply);
%If (Qt_5_1_0 -)
%If (PyQt_SSL)
void encrypted(QNetworkReply *reply);
%End
%End
%If (PyQt_SSL)
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
%End
void networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible);
%If (Qt_5_5_0 -)
%If (PyQt_SSL)
void preSharedKeyAuthenticationRequired(QNetworkReply *reply, QSslPreSharedKeyAuthenticator *authenticator);
%End
%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);
enum NetworkAccessibility
{
UnknownAccessibility,
NotAccessible,
Accessible,
};
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = 0);
%If (Qt_5_8_0 -)
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, const QByteArray &data);
%End
%If (Qt_5_8_0 -)
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QHttpMultiPart *multiPart);
%End
void setConfiguration(const QNetworkConfiguration &config);
QNetworkConfiguration configuration() const;
QNetworkConfiguration activeConfiguration() const;
void setNetworkAccessible(QNetworkAccessManager::NetworkAccessibility accessible);
QNetworkAccessManager::NetworkAccessibility networkAccessible() const;
void clearAccessCache();
%If (Qt_5_2_0 -)
QStringList supportedSchemes() const;
%End
%If (Qt_5_2_0 -)
%If (PyQt_SSL)
void connectToHostEncrypted(const QString &hostName, quint16 port = 443, const QSslConfiguration &sslConfiguration = QSslConfiguration::defaultConfiguration());
%End
%End
%If (Qt_5_13_0 -)
%If (PyQt_SSL)
void connectToHostEncrypted(const QString &hostName, quint16 port, const QSslConfiguration &sslConfiguration, const QString &peerName);
%End
%End
%If (Qt_5_2_0 -)
void connectToHost(const QString &hostName, quint16 port = 80);
%End
protected slots:
%If (Qt_5_2_0 -)
QStringList supportedSchemesImplementation() const;
%End
public:
%If (Qt_5_9_0 -)
void clearConnectionCache();
%End
%If (Qt_5_9_0 -)
void setStrictTransportSecurityEnabled(bool enabled);
%End
%If (Qt_5_9_0 -)
bool isStrictTransportSecurityEnabled() const;
%End
%If (Qt_5_9_0 -)
void addStrictTransportSecurityHosts(const QVector<QHstsPolicy> &knownHosts);
%End
%If (Qt_5_9_0 -)
QVector<QHstsPolicy> strictTransportSecurityHosts() const;
%End
%If (Qt_5_9_0 -)
void setRedirectPolicy(QNetworkRequest::RedirectPolicy policy);
%End
%If (Qt_5_9_0 -)
QNetworkRequest::RedirectPolicy redirectPolicy() const;
%End
%If (Qt_5_10_0 -)
void enableStrictTransportSecurityStore(bool enabled, const QString &storeDir = QString());
%End
%If (Qt_5_10_0 -)
bool isStrictTransportSecurityStoreEnabled() const;
%End
%If (Qt_5_14_0 -)
bool autoDeleteReplies() const;
%End
%If (Qt_5_14_0 -)
void setAutoDeleteReplies(bool autoDelete);
%End
%If (Qt_5_15_0 -)
int transferTimeout() const;
%End
%If (Qt_5_15_0 -)
void setTransferTimeout(int timeout = QNetworkRequest::TransferTimeoutConstant::DefaultTransferTimeoutConstant);
%End
};

View File

@@ -0,0 +1,60 @@
// qnetworkconfigmanager.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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 QNetworkConfigurationManager : public QObject
{
%TypeHeaderCode
#include <qnetworkconfigmanager.h>
%End
public:
enum Capability
{
CanStartAndStopInterfaces,
DirectConnectionRouting,
SystemSessionSupport,
ApplicationLevelRoaming,
ForcedRoaming,
DataStatistics,
NetworkSessionRequired,
};
typedef QFlags<QNetworkConfigurationManager::Capability> Capabilities;
explicit QNetworkConfigurationManager(QObject *parent /TransferThis/ = 0);
virtual ~QNetworkConfigurationManager();
QNetworkConfigurationManager::Capabilities capabilities() const;
QNetworkConfiguration defaultConfiguration() const;
QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = QNetworkConfiguration::StateFlags()) const;
QNetworkConfiguration configurationFromIdentifier(const QString &identifier) const;
void updateConfigurations();
bool isOnline() const;
signals:
void configurationAdded(const QNetworkConfiguration &config);
void configurationRemoved(const QNetworkConfiguration &config);
void configurationChanged(const QNetworkConfiguration &config);
void onlineStateChanged(bool isOnline);
void updateCompleted();
};
QFlags<QNetworkConfigurationManager::Capability> operator|(QNetworkConfigurationManager::Capability f1, QFlags<QNetworkConfigurationManager::Capability> f2);
QFlags<QNetworkConfigurationManager::Capability> operator|(QNetworkConfigurationManager::Capability f1, QNetworkConfigurationManager::Capability f2);

View File

@@ -0,0 +1,107 @@
// qnetworkconfiguration.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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 QNetworkConfiguration
{
%TypeHeaderCode
#include <qnetworkconfiguration.h>
%End
public:
QNetworkConfiguration();
QNetworkConfiguration(const QNetworkConfiguration &other);
~QNetworkConfiguration();
bool operator==(const QNetworkConfiguration &cp) const;
bool operator!=(const QNetworkConfiguration &cp) const;
enum Type
{
InternetAccessPoint,
ServiceNetwork,
UserChoice,
Invalid,
};
enum Purpose
{
UnknownPurpose,
PublicPurpose,
PrivatePurpose,
ServiceSpecificPurpose,
};
enum StateFlag
{
Undefined,
Defined,
Discovered,
Active,
};
typedef QFlags<QNetworkConfiguration::StateFlag> StateFlags;
enum BearerType
{
BearerUnknown,
BearerEthernet,
BearerWLAN,
Bearer2G,
BearerCDMA2000,
BearerWCDMA,
BearerHSPA,
BearerBluetooth,
BearerWiMAX,
%If (Qt_5_2_0 -)
BearerEVDO,
%End
%If (Qt_5_2_0 -)
BearerLTE,
%End
%If (Qt_5_2_0 -)
Bearer3G,
%End
%If (Qt_5_2_0 -)
Bearer4G,
%End
};
QNetworkConfiguration::StateFlags state() const;
QNetworkConfiguration::Type type() const;
QNetworkConfiguration::Purpose purpose() const;
QNetworkConfiguration::BearerType bearerType() const;
QString bearerTypeName() const;
%If (Qt_5_2_0 -)
QNetworkConfiguration::BearerType bearerTypeFamily() const;
%End
QString identifier() const;
bool isRoamingAvailable() const;
QList<QNetworkConfiguration> children() const;
QString name() const;
bool isValid() const;
void swap(QNetworkConfiguration &other /Constrained/);
%If (Qt_5_9_0 -)
int connectTimeout() const;
%End
%If (Qt_5_9_0 -)
bool setConnectTimeout(int timeout);
%End
};

View File

@@ -0,0 +1,61 @@
// qnetworkcookie.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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;
static QList<QNetworkCookie> parseCookies(const QByteArray &cookieString);
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);
};

View File

@@ -0,0 +1,42 @@
// qnetworkcookiejar.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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;
};

View File

@@ -0,0 +1,55 @@
// qnetworkdatagram.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_8_0 -)
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;
};
%End

View File

@@ -0,0 +1,50 @@
// qnetworkdiskcache.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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();
};

View File

@@ -0,0 +1,152 @@
// qnetworkinterface.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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/);
%If (Qt_5_11_0 -)
enum DnsEligibilityStatus
{
DnsEligibilityUnknown,
DnsIneligible,
DnsEligible,
};
%End
%If (Qt_5_11_0 -)
QNetworkAddressEntry::DnsEligibilityStatus dnsEligibility() const;
%End
%If (Qt_5_11_0 -)
void setDnsEligibility(QNetworkAddressEntry::DnsEligibilityStatus status);
%End
%If (Qt_5_11_0 -)
bool isLifetimeKnown() const;
%End
%If (Qt_5_11_0 -)
QDeadlineTimer preferredLifetime() const;
%End
%If (Qt_5_11_0 -)
QDeadlineTimer validityLifetime() const;
%End
%If (Qt_5_11_0 -)
void setAddressLifetime(QDeadlineTimer preferred, QDeadlineTimer validity);
%End
%If (Qt_5_11_0 -)
void clearAddressLifetime();
%End
%If (Qt_5_11_0 -)
bool isPermanent() const;
%End
%If (Qt_5_11_0 -)
bool isTemporary() const;
%End
};
class QNetworkInterface
{
%TypeHeaderCode
#include <qnetworkinterface.h>
%End
public:
enum InterfaceFlag
{
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/);
%If (Qt_5_7_0 -)
static int interfaceIndexFromName(const QString &name);
%End
%If (Qt_5_7_0 -)
static QString interfaceNameFromIndex(int index);
%End
%If (Qt_5_11_0 -)
enum InterfaceType
{
Unknown,
Loopback,
Virtual,
Ethernet,
Slip,
CanBus,
Ppp,
Fddi,
Wifi,
Ieee80211,
Phonet,
Ieee802154,
SixLoWPAN,
Ieee80216,
Ieee1394,
};
%End
%If (Qt_5_11_0 -)
QNetworkInterface::InterfaceType type() const;
%End
%If (Qt_5_11_0 -)
int maximumTransmissionUnit() const;
%End
};
QFlags<QNetworkInterface::InterfaceFlag> operator|(QNetworkInterface::InterfaceFlag f1, QFlags<QNetworkInterface::InterfaceFlag> f2);

View File

@@ -0,0 +1,154 @@
// qnetworkproxy.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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
{
TunnelingCapability,
ListeningCapability,
UdpTunnelingCapability,
CachingCapability,
HostNameLookupCapability,
%If (Qt_5_8_0 -)
SctpTunnelingCapability,
%End
%If (Qt_5_8_0 -)
SctpListeningCapability,
%End
};
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);
};
class QNetworkProxyQuery
{
%TypeHeaderCode
#include <qnetworkproxy.h>
%End
public:
enum QueryType
{
TcpSocket,
UdpSocket,
TcpServer,
UrlRequest,
%If (Qt_5_8_0 -)
SctpSocket,
%End
%If (Qt_5_8_0 -)
SctpServer,
%End
};
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 QNetworkConfiguration &networkConfiguration, const QUrl &requestUrl, QNetworkProxyQuery::QueryType queryType = QNetworkProxyQuery::UrlRequest);
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration, const QString &hostname, int port, const QString &protocolTag = QString(), QNetworkProxyQuery::QueryType type = QNetworkProxyQuery::TcpSocket);
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration, 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);
QNetworkConfiguration networkConfiguration() const;
void setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration);
void swap(QNetworkProxyQuery &other /Constrained/);
};
class QNetworkProxyFactory /Supertype=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);
%If (Qt_5_8_0 -)
static bool usesSystemConfiguration();
%End
};

View File

@@ -0,0 +1,169 @@
// qnetworkreply.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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,
%If (Qt_5_3_0 -)
ContentConflictError,
%End
%If (Qt_5_3_0 -)
ContentGoneError,
%End
%If (Qt_5_3_0 -)
InternalServerError,
%End
%If (Qt_5_3_0 -)
OperationNotImplementedError,
%End
%If (Qt_5_3_0 -)
ServiceUnavailableError,
%End
%If (Qt_5_3_0 -)
UnknownServerError,
%End
%If (Qt_5_6_0 -)
TooManyRedirectsError,
%End
%If (Qt_5_6_0 -)
InsecureRedirectError,
%End
};
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;
bool hasRawHeader(const QByteArray &headerName) const;
QList<QByteArray> rawHeaderList() const;
QByteArray rawHeader(const QByteArray &headerName) const;
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 (Qt_5_1_0 -)
%If (PyQt_SSL)
void encrypted();
%End
%End
void error(QNetworkReply::NetworkError);
%If (Qt_5_15_0 -)
void errorOccurred(QNetworkReply::NetworkError);
%End
%If (PyQt_SSL)
void sslErrors(const QList<QSslError> &errors);
%End
void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
%If (Qt_5_5_0 -)
%If (PyQt_SSL)
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
%End
%End
%If (Qt_5_6_0 -)
void redirected(const QUrl &url);
%End
%If (Qt_5_9_0 -)
void redirectAllowed();
%End
protected:
explicit QNetworkReply(QObject *parent /TransferThis/ = 0);
virtual qint64 writeData(const char *data /Array/, qint64 len /ArraySize/) /ReleaseGIL/;
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
const QList<QPair<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
};

View File

@@ -0,0 +1,202 @@
// qnetworkrequest.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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,
%If (Qt_5_12_0 -)
IfModifiedSinceHeader,
%End
%If (Qt_5_12_0 -)
ETagHeader,
%End
%If (Qt_5_12_0 -)
IfMatchHeader,
%End
%If (Qt_5_12_0 -)
IfNoneMatchHeader,
%End
};
enum Attribute
{
HttpStatusCodeAttribute,
HttpReasonPhraseAttribute,
RedirectionTargetAttribute,
ConnectionEncryptedAttribute,
CacheLoadControlAttribute,
CacheSaveControlAttribute,
SourceIsFromCacheAttribute,
DoNotBufferUploadDataAttribute,
HttpPipeliningAllowedAttribute,
HttpPipeliningWasUsedAttribute,
CustomVerbAttribute,
CookieLoadControlAttribute,
AuthenticationReuseAttribute,
CookieSaveControlAttribute,
BackgroundRequestAttribute,
%If (Qt_5_3_0 -)
SpdyAllowedAttribute,
%End
%If (Qt_5_3_0 -)
SpdyWasUsedAttribute,
%End
%If (Qt_5_5_0 -)
EmitAllUploadProgressSignalsAttribute,
%End
%If (Qt_5_6_0 -)
FollowRedirectsAttribute,
%End
%If (Qt_5_8_0 -)
HTTP2AllowedAttribute,
%End
%If (Qt_5_15_0 -)
Http2AllowedAttribute,
%End
%If (Qt_5_8_0 -)
HTTP2WasUsedAttribute,
%End
%If (Qt_5_15_0 -)
Http2WasUsedAttribute,
%End
%If (Qt_5_9_0 -)
OriginalContentLengthAttribute,
%End
%If (Qt_5_9_0 -)
RedirectPolicyAttribute,
%End
%If (Qt_5_11_0 -)
Http2DirectAttribute,
%End
%If (Qt_5_14_0 -)
AutoDeleteReplyOnFinishAttribute,
%End
User,
UserMax,
};
enum CacheLoadControl
{
AlwaysNetwork,
PreferNetwork,
PreferCache,
AlwaysCache,
};
enum LoadControl
{
Automatic,
Manual,
};
enum Priority
{
HighPriority,
NormalPriority,
LowPriority,
};
explicit QNetworkRequest(const QUrl &url = QUrl());
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);
bool hasRawHeader(const QByteArray &headerName) const;
QList<QByteArray> rawHeaderList() const;
QByteArray rawHeader(const QByteArray &headerName) const;
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/);
%If (Qt_5_6_0 -)
int maximumRedirectsAllowed() const;
%End
%If (Qt_5_6_0 -)
void setMaximumRedirectsAllowed(int maximumRedirectsAllowed);
%End
%If (Qt_5_9_0 -)
enum RedirectPolicy
{
ManualRedirectPolicy,
NoLessSafeRedirectPolicy,
SameOriginRedirectPolicy,
UserVerifiedRedirectPolicy,
};
%End
%If (Qt_5_13_0 -)
QString peerVerifyName() const;
%End
%If (Qt_5_13_0 -)
void setPeerVerifyName(const QString &peerName);
%End
%If (Qt_5_14_0 -)
QHttp2Configuration http2Configuration() const;
%End
%If (Qt_5_14_0 -)
void setHttp2Configuration(const QHttp2Configuration &configuration);
%End
%If (Qt_5_15_0 -)
enum TransferTimeoutConstant
{
DefaultTransferTimeoutConstant,
};
%End
%If (Qt_5_15_0 -)
int transferTimeout() const;
%End
%If (Qt_5_15_0 -)
void setTransferTimeout(int timeout = QNetworkRequest::TransferTimeoutConstant::DefaultTransferTimeoutConstant);
%End
};

View File

@@ -0,0 +1,98 @@
// qnetworksession.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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 QNetworkSession : public QObject
{
%TypeHeaderCode
#include <qnetworksession.h>
%End
public:
enum State
{
Invalid,
NotAvailable,
Connecting,
Connected,
Closing,
Disconnected,
Roaming,
};
enum SessionError
{
UnknownSessionError,
SessionAbortedError,
RoamingError,
OperationNotSupportedError,
InvalidConfigurationError,
};
QNetworkSession(const QNetworkConfiguration &connConfig, QObject *parent /TransferThis/ = 0);
virtual ~QNetworkSession();
bool isOpen() const;
QNetworkConfiguration configuration() const;
QNetworkInterface interface() const;
QNetworkSession::State state() const;
QNetworkSession::SessionError error() const;
QString errorString() const;
QVariant sessionProperty(const QString &key) const;
void setSessionProperty(const QString &key, const QVariant &value);
quint64 bytesWritten() const;
quint64 bytesReceived() const;
quint64 activeTime() const;
bool waitForOpened(int msecs = 30000) /ReleaseGIL/;
public slots:
void open();
void close();
void stop();
void migrate();
void ignore();
void accept();
void reject();
signals:
void stateChanged(QNetworkSession::State);
void opened();
void closed();
void error(QNetworkSession::SessionError);
void preferredConfigurationChanged(const QNetworkConfiguration &config, bool isSeamless);
void newConfigurationActivated();
protected:
virtual void connectNotify(const QMetaMethod &signal);
virtual void disconnectNotify(const QMetaMethod &signal);
public:
enum UsagePolicy
{
NoPolicy,
NoBackgroundTrafficPolicy,
};
typedef QFlags<QNetworkSession::UsagePolicy> UsagePolicies;
QNetworkSession::UsagePolicies usagePolicies() const;
signals:
void usagePoliciesChanged(QNetworkSession::UsagePolicies usagePolicies);
};

View File

@@ -0,0 +1,96 @@
// qocspresponse.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_13_0 -)
%If (PyQt_SSL)
%ModuleCode
#include <qocspresponse.h>
%End
%End
%End
%If (Qt_5_13_0 -)
%If (PyQt_SSL)
enum class QOcspCertificateStatus
{
Good,
Revoked,
Unknown,
};
%End
%End
%If (Qt_5_13_0 -)
%If (PyQt_SSL)
enum class QOcspRevocationReason
{
None /PyName=None_/,
Unspecified,
KeyCompromise,
CACompromise,
AffiliationChanged,
Superseded,
CessationOfOperation,
CertificateHold,
RemoveFromCRL,
};
%End
%End
%If (Qt_5_13_0 -)
%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);
long __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
%End
%End
%If (Qt_5_13_0 -)
%If (PyQt_SSL)
bool operator==(const QOcspResponse &lhs, const QOcspResponse &rhs);
%End
%End
%If (Qt_5_13_0 -)
%If (PyQt_SSL)
bool operator!=(const QOcspResponse &lhs, const QOcspResponse &rhs);
%End
%End

View File

@@ -0,0 +1,37 @@
// qpassworddigestor.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_12_0 -)
%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
%End

View File

@@ -0,0 +1,132 @@
// This is the SIP interface definition for the QHash based mapped types
// specific to the QtNetwork module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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
};

View File

@@ -0,0 +1,214 @@
// This is the SIP interface definition for the QMap and QMultiMap based mapped
// types specific to the QtNetwork module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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 = PyObject_GetAttrString(
(PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), "EmailEntry");
if (!email_entry)
return 0;
}
static PyObject *dns_entry = 0;
if (!dns_entry)
{
dns_entry = PyObject_GetAttrString(
(PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), "DnsEntry");
if (!dns_entry)
return 0;
}
#if QT_VERSION >= 0x050d00
static PyObject *ip_address_entry = 0;
if (!ip_address_entry)
{
ip_address_entry = PyObject_GetAttrString(
(PyObject *)sipTypeAsPyTypeObject(sipType_QSsl), "IpAddressEntry");
if (!ip_address_entry)
return 0;
}
#endif
// 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);
}
}
#if QT_VERSION >= 0x050d00
// 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);
}
}
#endif
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

View File

@@ -0,0 +1,129 @@
// qssl.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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,
%If (Qt_5_5_0 -)
Ec,
%End
%If (Qt_5_13_0 -)
Dh,
%End
};
enum AlternativeNameEntryType
{
EmailEntry,
DnsEntry,
%If (Qt_5_13_0 -)
IpAddressEntry,
%End
};
enum SslProtocol
{
UnknownProtocol,
SslV3,
SslV2,
TlsV1_0,
%If (Qt_5_5_0 -)
TlsV1_0OrLater,
%End
TlsV1_1,
%If (Qt_5_5_0 -)
TlsV1_1OrLater,
%End
TlsV1_2,
%If (Qt_5_5_0 -)
TlsV1_2OrLater,
%End
AnyProtocol,
TlsV1SslV3,
SecureProtocols,
%If (Qt_5_12_0 -)
DtlsV1_0,
%End
%If (Qt_5_12_0 -)
DtlsV1_0OrLater,
%End
%If (Qt_5_12_0 -)
DtlsV1_2,
%End
%If (Qt_5_12_0 -)
DtlsV1_2OrLater,
%End
%If (Qt_5_12_0 -)
TlsV1_3,
%End
%If (Qt_5_12_0 -)
TlsV1_3OrLater,
%End
};
enum SslOption
{
SslOptionDisableEmptyFragments,
SslOptionDisableSessionTickets,
SslOptionDisableCompression,
SslOptionDisableServerNameIndication,
SslOptionDisableLegacyRenegotiation,
%If (Qt_5_2_0 -)
SslOptionDisableSessionSharing,
%End
%If (Qt_5_2_0 -)
SslOptionDisableSessionPersistence,
%End
%If (Qt_5_6_0 -)
SslOptionDisableServerCipherPreference,
%End
};
typedef QFlags<QSsl::SslOption> SslOptions;
};
%End
%If (PyQt_SSL)
QFlags<QSsl::SslOption> operator|(QSsl::SslOption f1, QFlags<QSsl::SslOption> f2);
%End

View File

@@ -0,0 +1,108 @@
// qsslcertificate.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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, QRegExp::PatternSyntax syntax = QRegExp::FixedString);
static QList<QSslCertificate> fromDevice(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
static QList<QSslCertificate> fromData(const QByteArray &data, QSsl::EncodingFormat format = QSsl::Pem);
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(QList<QSslCertificate> certificateChain, const QString &hostName = QString());
%If (Qt_5_4_0 -)
bool isSelfSigned() const;
%End
%If (Qt_5_4_0 -)
long __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%End
%If (Qt_5_4_0 -)
static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *certificate, QList<QSslCertificate> *caCertificates = 0, const QByteArray &passPhrase = QByteArray()) /ReleaseGIL/;
%End
%If (Qt_5_12_0 -)
QString issuerDisplayName() const;
%End
%If (Qt_5_12_0 -)
QString subjectDisplayName() const;
%End
%If (Qt_5_15_0 -)
enum class PatternSyntax
{
RegularExpression,
Wildcard,
FixedString,
};
%End
};
%End

View File

@@ -0,0 +1,43 @@
// qsslcertificateextension.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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

View File

@@ -0,0 +1,53 @@
// qsslcipher.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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();
%If (Qt_5_3_0 -)
explicit QSslCipher(const QString &name);
%End
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

View File

@@ -0,0 +1,162 @@
// qsslconfiguration.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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 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/);
%If (Qt_5_1_0 -)
QList<QSslCertificate> localCertificateChain() const;
%End
%If (Qt_5_1_0 -)
void setLocalCertificateChain(const QList<QSslCertificate> &localChain);
%End
%If (Qt_5_2_0 -)
QByteArray sessionTicket() const;
%End
%If (Qt_5_2_0 -)
void setSessionTicket(const QByteArray &sessionTicket);
%End
%If (Qt_5_2_0 -)
int sessionTicketLifeTimeHint() const;
%End
%If (Qt_5_3_0 -)
enum NextProtocolNegotiationStatus
{
NextProtocolNegotiationNone,
NextProtocolNegotiationNegotiated,
NextProtocolNegotiationUnsupported,
};
%End
%If (Qt_5_3_0 -)
void setAllowedNextProtocols(QList<QByteArray> protocols);
%End
%If (Qt_5_3_0 -)
QList<QByteArray> allowedNextProtocols() const;
%End
%If (Qt_5_3_0 -)
QByteArray nextNegotiatedProtocol() const;
%End
%If (Qt_5_3_0 -)
QSslConfiguration::NextProtocolNegotiationStatus nextProtocolNegotiationStatus() const;
%End
%If (Qt_5_3_0 -)
static const char *NextProtocolSpdy3_0 /Encoding="None",NoSetter/;
%End
%If (Qt_5_3_0 -)
static const char *NextProtocolHttp1_1 /Encoding="None",NoSetter/;
%End
%If (Qt_5_4_0 -)
QSsl::SslProtocol sessionProtocol() const;
%End
%If (Qt_5_5_0 -)
static QList<QSslCipher> supportedCiphers();
%End
%If (Qt_5_5_0 -)
static QList<QSslCertificate> systemCaCertificates();
%End
%If (Qt_5_5_0 -)
QVector<QSslEllipticCurve> ellipticCurves() const;
%End
%If (Qt_5_5_0 -)
void setEllipticCurves(const QVector<QSslEllipticCurve> &curves);
%End
%If (Qt_5_5_0 -)
static QVector<QSslEllipticCurve> supportedEllipticCurves();
%End
%If (Qt_5_7_0 -)
QSslKey ephemeralServerKey() const;
%End
%If (Qt_5_8_0 -)
QByteArray preSharedKeyIdentityHint() const;
%End
%If (Qt_5_8_0 -)
void setPreSharedKeyIdentityHint(const QByteArray &hint);
%End
%If (Qt_5_8_0 -)
QSslDiffieHellmanParameters diffieHellmanParameters() const;
%End
%If (Qt_5_8_0 -)
void setDiffieHellmanParameters(const QSslDiffieHellmanParameters &dhparams);
%End
%If (Qt_5_11_0 -)
QMap<QByteArray, QVariant> backendConfiguration() const;
%End
%If (Qt_5_11_0 -)
void setBackendConfigurationOption(const QByteArray &name, const QVariant &value);
%End
%If (Qt_5_11_0 -)
void setBackendConfiguration(const QMap<QByteArray, QVariant> &backendConfiguration = QMap<QByteArray, QVariant>());
%End
%If (Qt_5_13_0 -)
void setOcspStaplingEnabled(bool enable);
%End
%If (Qt_5_13_0 -)
bool ocspStaplingEnabled() const;
%End
%If (Qt_5_15_0 -)
void addCaCertificate(const QSslCertificate &certificate);
%End
%If (Qt_5_15_0 -)
bool addCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QSslCertificate::PatternSyntax syntax = QSslCertificate::PatternSyntax::FixedString);
%End
%If (Qt_5_15_0 -)
void addCaCertificates(const QList<QSslCertificate> &certificates);
%End
};
%End

View File

@@ -0,0 +1,68 @@
// qssldiffiehellmanparameters.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_8_0 -)
%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::EncodingFormat::Pem);
static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::EncodingFormat::Pem) /ReleaseGIL/;
bool isEmpty() const;
bool isValid() const;
QSslDiffieHellmanParameters::Error error() const;
QString errorString() const;
long __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
%End
%End
%If (Qt_5_8_0 -)
%If (PyQt_SSL)
bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs);
%End
%End
%If (Qt_5_8_0 -)
%If (PyQt_SSL)
bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs);
%End
%End

View File

@@ -0,0 +1,57 @@
// qsslellipticcurve.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_5_0 -)
%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;
long __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
%End
%End
%If (Qt_5_5_0 -)
%If (PyQt_SSL)
bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs);
%End
%End
%If (Qt_5_5_0 -)
%If (PyQt_SSL)
bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs);
%End
%End

View File

@@ -0,0 +1,118 @@
// qsslerror.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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,
%If (Qt_5_13_0 -)
CertificateStatusUnknown,
%End
%If (Qt_5_13_0 -)
OcspNoResponseFound,
%End
%If (Qt_5_13_0 -)
OcspMalformedRequest,
%End
%If (Qt_5_13_0 -)
OcspMalformedResponse,
%End
%If (Qt_5_13_0 -)
OcspInternalError,
%End
%If (Qt_5_13_0 -)
OcspTryLater,
%End
%If (Qt_5_13_0 -)
OcspSigRequred,
%End
%If (Qt_5_13_0 -)
OcspUnauthorized,
%End
%If (Qt_5_13_0 -)
OcspResponseCannotBeTrusted,
%End
%If (Qt_5_13_0 -)
OcspResponseCertIdUnknown,
%End
%If (Qt_5_13_0 -)
OcspResponseExpired,
%End
%If (Qt_5_13_0 -)
OcspStatusUnknown,
%End
};
QSslError();
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/);
%If (Qt_5_4_0 -)
long __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%End
};
%End

View File

@@ -0,0 +1,51 @@
// qsslkey.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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

View File

@@ -0,0 +1,57 @@
// qsslpresharedkeyauthenticator.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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_5_5_0 -)
%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
%End
%If (Qt_5_5_0 -)
%If (PyQt_SSL)
bool operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs);
%End
%End
%If (Qt_5_5_0 -)
%If (PyQt_SSL)
bool operator!=(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs);
%End
%End

View File

@@ -0,0 +1,205 @@
// qsslsocket.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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, QIODevice::OpenMode mode = QIODevice::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
void connectToHostEncrypted(const QString &hostName, quint16 port, const QString &sslPeerName, QIODevice::OpenMode mode = QIODevice::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
virtual bool setSocketDescriptor(qintptr socketDescriptor, QAbstractSocket::SocketState state = QAbstractSocket::ConnectedState, QIODevice::OpenMode mode = QIODevice::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;
bool flush();
void abort();
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;
QList<QSslCipher> ciphers() const;
void setCiphers(const QList<QSslCipher> &ciphers);
void setCiphers(const QString &ciphers);
static void setDefaultCiphers(const QList<QSslCipher> &ciphers);
static QList<QSslCipher> defaultCiphers();
static QList<QSslCipher> supportedCiphers();
bool addCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString);
void addCaCertificate(const QSslCertificate &certificate);
void addCaCertificates(const QList<QSslCertificate> &certificates);
void setCaCertificates(const QList<QSslCertificate> &certificates);
QList<QSslCertificate> caCertificates() const;
static bool addDefaultCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString);
static void addDefaultCaCertificate(const QSslCertificate &certificate);
static void addDefaultCaCertificates(const QList<QSslCertificate> &certificates);
static void setDefaultCaCertificates(const QList<QSslCertificate> &certificates);
static QList<QSslCertificate> defaultCaCertificates();
static QList<QSslCertificate> systemCaCertificates();
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/;
QList<QSslError> sslErrors() const;
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);
%If (Qt_5_5_0 -)
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
%End
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="Py_v3:bytes;str",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 = SIPBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(const char *data /Array/, qint64 len /ArraySize/) /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);
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, QIODevice::OpenMode mode = QIODevice::ReadWrite, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::AnyIPProtocol) /ReleaseGIL/;
virtual void disconnectFromHost() /ReleaseGIL/;
static long sslLibraryVersionNumber();
static QString sslLibraryVersionString();
%If (Qt_5_1_0 -)
void setLocalCertificateChain(const QList<QSslCertificate> &localChain);
%End
%If (Qt_5_1_0 -)
QList<QSslCertificate> localCertificateChain() const;
%End
%If (Qt_5_4_0 -)
QSsl::SslProtocol sessionProtocol() const;
%End
%If (Qt_5_4_0 -)
static long sslLibraryBuildVersionNumber();
%End
%If (Qt_5_4_0 -)
static QString sslLibraryBuildVersionString();
%End
%If (Qt_5_13_0 -)
QVector<QOcspResponse> ocspResponses() const;
%End
%If (Qt_5_15_0 -)
QList<QSslError> sslHandshakeErrors() const;
%End
signals:
%If (Qt_5_15_0 -)
void newSessionTicketReceived();
%End
};
%End

View File

@@ -0,0 +1,58 @@
// qtcpserver.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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);
};

View File

@@ -0,0 +1,32 @@
// qtcpsocket.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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();
};

View File

@@ -0,0 +1,82 @@
// qudpsocket.sip generated by MetaSIP
//
// This file is part of the QtNetwork Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// 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="Py_v3:bytes;str",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 = SIPBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
qint64 writeDatagram(const char *data /Array/, qint64 len /ArraySize/, const QHostAddress &host, quint16 port) /ReleaseGIL/;
qint64 writeDatagram(const QByteArray &datagram, const QHostAddress &host, quint16 port) /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);
%If (Qt_5_8_0 -)
QNetworkDatagram receiveDatagram(qint64 maxSize = -1) /ReleaseGIL/;
%End
%If (Qt_5_8_0 -)
qint64 writeDatagram(const QNetworkDatagram &datagram) /ReleaseGIL/;
%End
};