qtimezone.sip 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. // qtimezone.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtCore 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 QTimeZone
  22. {
  23. %TypeHeaderCode
  24. #include <qtimezone.h>
  25. %End
  26. public:
  27. enum TimeType
  28. {
  29. StandardTime,
  30. DaylightTime,
  31. GenericTime,
  32. };
  33. enum NameType
  34. {
  35. DefaultName,
  36. LongName,
  37. ShortName,
  38. OffsetName,
  39. };
  40. struct OffsetData
  41. {
  42. %TypeHeaderCode
  43. #include <qtimezone.h>
  44. %End
  45. QString abbreviation;
  46. QDateTime atUtc;
  47. int offsetFromUtc;
  48. int standardTimeOffset;
  49. int daylightTimeOffset;
  50. };
  51. typedef QList<QTimeZone::OffsetData> OffsetDataList;
  52. %If (Qt_6_5_0 -)
  53. QTimeZone(QTimeZone::Initialization spec);
  54. %End
  55. %If (Qt_6_2_0 -)
  56. QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name, const QString &abbreviation, QLocale::Territory territory = QLocale::AnyTerritory, const QString &comment = QString());
  57. %End
  58. %If (- Qt_6_2_0)
  59. QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name, const QString &abbreviation, QLocale::Country country = QLocale::AnyCountry, const QString &comment = QString());
  60. %End
  61. explicit QTimeZone(const QByteArray &ianaId);
  62. explicit QTimeZone(int offsetSeconds);
  63. QTimeZone(const QTimeZone &other);
  64. QTimeZone();
  65. ~QTimeZone();
  66. void swap(QTimeZone &other /Constrained/);
  67. %If (- Qt_6_7_0)
  68. bool operator==(const QTimeZone &other) const;
  69. %End
  70. %If (- Qt_6_7_0)
  71. bool operator!=(const QTimeZone &other) const;
  72. %End
  73. bool isValid() const;
  74. QByteArray id() const;
  75. QLocale::Country country() const;
  76. %If (Qt_6_2_0 -)
  77. QLocale::Territory territory() const;
  78. %End
  79. QString comment() const;
  80. QString displayName(const QDateTime &atDateTime, QTimeZone::NameType nameType = QTimeZone::DefaultName, const QLocale &locale = QLocale()) const;
  81. QString displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType = QTimeZone::DefaultName, const QLocale &locale = QLocale()) const;
  82. QString abbreviation(const QDateTime &atDateTime) const;
  83. int offsetFromUtc(const QDateTime &atDateTime) const;
  84. int standardTimeOffset(const QDateTime &atDateTime) const;
  85. int daylightTimeOffset(const QDateTime &atDateTime) const;
  86. bool hasDaylightTime() const;
  87. bool isDaylightTime(const QDateTime &atDateTime) const;
  88. QTimeZone::OffsetData offsetData(const QDateTime &forDateTime) const;
  89. bool hasTransitions() const;
  90. QTimeZone::OffsetData nextTransition(const QDateTime &afterDateTime) const;
  91. QTimeZone::OffsetData previousTransition(const QDateTime &beforeDateTime) const;
  92. QTimeZone::OffsetDataList transitions(const QDateTime &fromDateTime, const QDateTime &toDateTime) const;
  93. static QByteArray systemTimeZoneId();
  94. static bool isTimeZoneIdAvailable(const QByteArray &ianaId);
  95. %If (Qt_6_2_0 -)
  96. static QList<QByteArray> availableTimeZoneIds(QLocale::Territory territory /Constrained/);
  97. %End
  98. %If (- Qt_6_2_0)
  99. static QList<QByteArray> availableTimeZoneIds(QLocale::Country country /Constrained/);
  100. %End
  101. static QList<QByteArray> availableTimeZoneIds(int offsetSeconds);
  102. static QList<QByteArray> availableTimeZoneIds();
  103. static QByteArray ianaIdToWindowsId(const QByteArray &ianaId);
  104. static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId);
  105. %If (Qt_6_2_0 -)
  106. static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId, QLocale::Territory territory);
  107. %End
  108. %If (- Qt_6_2_0)
  109. static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId, QLocale::Country country);
  110. %End
  111. static QList<QByteArray> windowsIdToIanaIds(const QByteArray &windowsId);
  112. %If (Qt_6_2_0 -)
  113. static QList<QByteArray> windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Territory territory);
  114. %End
  115. %If (- Qt_6_2_0)
  116. static QList<QByteArray> windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Country country);
  117. %End
  118. static QTimeZone systemTimeZone();
  119. static QTimeZone utc();
  120. %If (Qt_6_5_0 -)
  121. enum Initialization
  122. {
  123. LocalTime,
  124. UTC,
  125. };
  126. %End
  127. %If (Qt_6_5_0 -)
  128. static QTimeZone fromSecondsAheadOfUtc(int offset);
  129. %End
  130. %If (Qt_6_5_0 -)
  131. Qt::TimeSpec timeSpec() const;
  132. %End
  133. %If (Qt_6_5_0 -)
  134. int fixedSecondsAheadOfUtc() const;
  135. %End
  136. %If (Qt_6_5_0 -)
  137. bool isUtcOrFixedOffset() const;
  138. %End
  139. %If (Qt_6_5_0 -)
  140. static bool isUtcOrFixedOffset(Qt::TimeSpec spec);
  141. %End
  142. %If (Qt_6_5_0 -)
  143. QTimeZone asBackendZone() const;
  144. %End
  145. %If (Qt_6_6_0 -)
  146. static const int MinUtcOffsetSecs;
  147. %End
  148. %If (Qt_6_6_0 -)
  149. static const int MaxUtcOffsetSecs;
  150. %End
  151. %If (Qt_6_8_0 -)
  152. bool hasAlternativeName(QByteArrayView alias) const;
  153. %End
  154. };
  155. QDataStream &operator<<(QDataStream &ds, const QTimeZone &tz) /ReleaseGIL/;
  156. QDataStream &operator>>(QDataStream &ds, QTimeZone &tz /Constrained/) /ReleaseGIL/;
  157. %If (Qt_6_7_0 -)
  158. bool operator==(const QTimeZone &lhs, const QTimeZone &rhs);
  159. %End
  160. %If (Qt_6_7_0 -)
  161. bool operator!=(const QTimeZone &lhs, const QTimeZone &rhs);
  162. %End