qnetworkinformation.sip 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // qnetworkinformation.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. %If (Qt_6_1_0 -)
  22. class QNetworkInformation : public QObject /NoDefaultCtors/
  23. {
  24. %TypeHeaderCode
  25. #include <qnetworkinformation.h>
  26. %End
  27. public:
  28. enum class Reachability
  29. {
  30. Unknown,
  31. Disconnected,
  32. Local,
  33. Site,
  34. Online,
  35. };
  36. enum class Feature
  37. {
  38. Reachability,
  39. %If (Qt_6_2_0 -)
  40. CaptivePortal,
  41. %End
  42. %If (Qt_6_3_0 -)
  43. TransportMedium,
  44. %End
  45. %If (Qt_6_3_0 -)
  46. Metered,
  47. %End
  48. };
  49. typedef QFlags<QNetworkInformation::Feature> Features;
  50. QNetworkInformation::Reachability reachability() const;
  51. QString backendName() const;
  52. bool supports(QNetworkInformation::Features features) const;
  53. static bool load(QStringView backend);
  54. static bool load(QNetworkInformation::Features features);
  55. static QStringList availableBackends();
  56. static QNetworkInformation *instance();
  57. signals:
  58. %If (Qt_6_8_0 -)
  59. void reachabilityChanged(QNetworkInformation::Reachability newReachability);
  60. %End
  61. %If (- Qt_6_8_0)
  62. void reachabilityChanged(QNetworkInformation::Reachability newReachability /ScopesStripped=1/);
  63. %End
  64. public:
  65. %If (Qt_6_2_0 -)
  66. bool isBehindCaptivePortal() const;
  67. %End
  68. signals:
  69. %If (Qt_6_2_0 -)
  70. void isBehindCaptivePortalChanged(bool state);
  71. %End
  72. public:
  73. %If (Qt_6_3_0 -)
  74. enum class TransportMedium
  75. {
  76. Unknown,
  77. Ethernet,
  78. Cellular,
  79. WiFi,
  80. Bluetooth,
  81. };
  82. %End
  83. %If (Qt_6_3_0 -)
  84. QNetworkInformation::TransportMedium transportMedium() const;
  85. %End
  86. %If (Qt_6_3_0 -)
  87. bool isMetered() const;
  88. %End
  89. %If (Qt_6_3_0 -)
  90. QNetworkInformation::Features supportedFeatures() const;
  91. %End
  92. %If (Qt_6_3_0 -)
  93. static bool loadDefaultBackend();
  94. %End
  95. signals:
  96. %If (Qt_6_8_0 -)
  97. void transportMediumChanged(QNetworkInformation::TransportMedium current);
  98. %End
  99. %If (Qt_6_3_0 - Qt_6_8_0)
  100. void transportMediumChanged(QNetworkInformation::TransportMedium current /ScopesStripped=1/);
  101. %End
  102. %If (Qt_6_3_0 -)
  103. void isMeteredChanged(bool isMetered);
  104. %End
  105. public:
  106. %If (Qt_6_4_0 -)
  107. static bool loadBackendByName(QStringView backend);
  108. %End
  109. %If (Qt_6_4_0 -)
  110. static bool loadBackendByFeatures(QNetworkInformation::Features features);
  111. %End
  112. private:
  113. virtual ~QNetworkInformation();
  114. };
  115. %End