1// qhostinfo.sip generated by MetaSIP
2//
3// This file is part of the QtNetwork Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QHostInfo
24{
25%TypeHeaderCode
26#include <qhostinfo.h>
27%End
28
29public:
30    enum HostInfoError
31    {
32        NoError,
33        HostNotFound,
34        UnknownError,
35    };
36
37    explicit QHostInfo(int id = -1);
38    QHostInfo(const QHostInfo &d);
39    ~QHostInfo();
40    QString hostName() const;
41    void setHostName(const QString &name);
42    QList<QHostAddress> addresses() const;
43    void setAddresses(const QList<QHostAddress> &addresses);
44    QHostInfo::HostInfoError error() const;
45    void setError(QHostInfo::HostInfoError error);
46    QString errorString() const;
47    void setErrorString(const QString &errorString);
48    void setLookupId(int id);
49    int lookupId() const;
50    static int lookupHost(const QString &name, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
51%MethodCode
52        QObject *receiver;
53        QByteArray slot_signature;
54
55        if ((sipError = pyqt5_qtnetwork_get_connection_parts(a1, 0, "(QHostInfo)", true, &receiver, slot_signature)) == sipErrorNone)
56        {
57            QHostInfo::lookupHost(*a0, receiver, slot_signature.constData());
58        }
59        else if (sipError == sipErrorContinue)
60        {
61            sipError = sipBadCallableArg(1, a1);
62        }
63%End
64
65    static void abortHostLookup(int lookupId);
66    static QHostInfo fromName(const QString &name);
67    static QString localHostName();
68    static QString localDomainName();
69%If (Qt_5_10_0 -)
70    void swap(QHostInfo &other /Constrained/);
71%End
72};
73
74%ModuleHeaderCode
75// Imports from QtCore.
76typedef sipErrorState (*pyqt5_qtnetwork_get_connection_parts_t)(PyObject *, QObject *, const char *, bool, QObject **, QByteArray &);
77extern pyqt5_qtnetwork_get_connection_parts_t pyqt5_qtnetwork_get_connection_parts;
78%End
79
80%ModuleCode
81// Imports from QtCore.
82pyqt5_qtnetwork_get_connection_parts_t pyqt5_qtnetwork_get_connection_parts;
83%End
84
85%PostInitialisationCode
86// Imports from QtCore.
87pyqt5_qtnetwork_get_connection_parts = (pyqt5_qtnetwork_get_connection_parts_t)sipImportSymbol("pyqt5_get_connection_parts");
88Q_ASSERT(pyqt5_qtnetwork_get_connection_parts);
89%End
90