qcalendar.sip 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // qcalendar.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 QCalendar
  22. {
  23. %TypeHeaderCode
  24. #include <qcalendar.h>
  25. %End
  26. public:
  27. enum
  28. {
  29. Unspecified,
  30. };
  31. struct YearMonthDay
  32. {
  33. %TypeHeaderCode
  34. #include <qcalendar.h>
  35. %End
  36. YearMonthDay();
  37. YearMonthDay(int year, int month = 1, int day = 1);
  38. bool isValid() const;
  39. int year;
  40. int month;
  41. int day;
  42. };
  43. enum class System
  44. {
  45. Gregorian,
  46. Julian,
  47. Milankovic,
  48. Jalali,
  49. IslamicCivil,
  50. };
  51. QCalendar();
  52. explicit QCalendar(QCalendar::System system);
  53. %If (Qt_6_4_0 -)
  54. explicit QCalendar(QAnyStringView name);
  55. %End
  56. %If (- Qt_6_4_0)
  57. explicit QCalendar(const char *name /Encoding="Latin-1"/) [(QLatin1String name)];
  58. %MethodCode
  59. // This is currently the only occurence of a QLatin1String argument.
  60. sipCpp = new QCalendar(QLatin1String(a0));
  61. %End
  62. %End
  63. int daysInMonth(int month, int year = QCalendar::Unspecified) const;
  64. int daysInYear(int year) const;
  65. int monthsInYear(int year) const;
  66. bool isDateValid(int year, int month, int day) const;
  67. bool isLeapYear(int year) const;
  68. bool isGregorian() const;
  69. bool isLunar() const;
  70. bool isLuniSolar() const;
  71. bool isSolar() const;
  72. bool isProleptic() const;
  73. bool hasYearZero() const;
  74. int maximumDaysInMonth() const;
  75. int minimumDaysInMonth() const;
  76. int maximumMonthsInYear() const;
  77. QString name() const;
  78. QDate dateFromParts(int year, int month, int day) const;
  79. QDate dateFromParts(const QCalendar::YearMonthDay &parts) const;
  80. QCalendar::YearMonthDay partsFromDate(QDate date) const;
  81. int dayOfWeek(QDate date) const;
  82. QString monthName(const QLocale &locale, int month, int year = QCalendar::Unspecified, QLocale::FormatType format = QLocale::LongFormat) const;
  83. QString standaloneMonthName(const QLocale &locale, int month, int year = QCalendar::Unspecified, QLocale::FormatType format = QLocale::LongFormat) const;
  84. QString weekDayName(const QLocale &locale, int day, QLocale::FormatType format = QLocale::LongFormat) const;
  85. QString standaloneWeekDayName(const QLocale &locale, int day, QLocale::FormatType format = QLocale::LongFormat) const;
  86. QString dateTimeToString(QStringView format, const QDateTime &datetime, QDate dateOnly, QTime timeOnly, const QLocale &locale) const;
  87. static QStringList availableCalendars();
  88. %If (Qt_6_7_0 -)
  89. QDate matchCenturyToWeekday(const QCalendar::YearMonthDay &parts, int dow) const;
  90. %End
  91. };