qhostinfo.sip 2.9 KB

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