KDECore
Go to the documentation of this file.
22 #ifndef KCALENDARSYSTEM_H
23 #define KCALENDARSYSTEM_H
29 #include <QtCore/QStringList>
30 #include <QtCore/QDate>
140 KDE_DEPRECATED
static QStringList calendarSystems();
163 KDE_DEPRECATED
static QString calendarLabel(
const QString &calendarType);
245 KDE_DEPRECATED
virtual QString calendarType()
const = 0;
282 virtual QDate epoch()
const;
294 virtual QDate earliestValidDate()
const;
304 virtual QDate latestValidDate()
const;
314 virtual bool isValid(
int year,
int month,
int day)
const = 0;
326 bool isValid(
int year,
int dayOfYear)
const;
340 bool isValid(
const QString &eraName,
int yearInEra,
int month,
int day)
const;
353 bool isValidIsoWeekDate(
int year,
int isoWeekNumber,
int dayOfIsoWeek)
const;
361 virtual bool isValid(
const QDate &date)
const;
375 virtual bool setDate(QDate &date,
int year,
int month,
int day)
const;
388 bool setDate(QDate &date,
int year,
int dayOfYear)
const;
403 bool setDate(QDate &date,
QString eraName,
int yearInEra,
int month,
int day)
const;
417 bool setDateIsoWeek(QDate &date,
int year,
int isoWeekNumber,
int dayOfIsoWeek)
const;
435 KDE_DEPRECATED
virtual bool setYMD(QDate &date,
int y,
int m,
int d)
const;
448 void getDate(
const QDate date,
int *year,
int *month,
int *day)
const;
456 virtual int year(
const QDate &date)
const;
464 virtual int month(
const QDate &date)
const;
472 virtual int day(
const QDate &date)
const;
485 QString eraName(
const QDate &date, StringFormat format = ShortFormat)
const;
498 QString eraYear(
const QDate &date, StringFormat format = ShortFormat)
const;
510 int yearInEra(
const QDate &date)
const;
519 virtual QDate addYears(
const QDate &date,
int nyears)
const;
528 virtual QDate addMonths(
const QDate &date,
int nmonths)
const;
537 virtual QDate addDays(
const QDate &date,
int ndays)
const;
558 void dateDifference(
const QDate &fromDate,
const QDate &toDate,
559 int *yearsDiff,
int *monthsDiff,
int *daysDiff,
int *direction)
const;
572 int yearsDifference(
const QDate &fromDate,
const QDate &toDate)
const;
587 int monthsDifference(
const QDate &fromDate,
const QDate &toDate)
const;
598 int daysDifference(
const QDate &fromDate,
const QDate &toDate)
const;
606 virtual int monthsInYear(
const QDate &date)
const;
617 int monthsInYear(
int year)
const;
625 virtual int weeksInYear(
const QDate &date)
const;
650 virtual int weeksInYear(
int year)
const;
675 virtual int daysInYear(
const QDate &date)
const;
686 int daysInYear(
int year)
const;
694 virtual int daysInMonth(
const QDate &date)
const;
706 int daysInMonth(
int year,
int month)
const;
714 virtual int daysInWeek(
const QDate &date)
const;
724 virtual int dayOfYear(
const QDate &date)
const;
736 virtual int dayOfWeek(
const QDate &date)
const;
753 KDE_DEPRECATED
virtual int weekNumber(
const QDate &date,
int *yearNum = 0)
const;
773 int week(
const QDate &date,
int *yearNum = 0)
const;
807 virtual bool isLeapYear(
int year)
const = 0;
818 virtual bool isLeapYear(
const QDate &date)
const;
829 QDate firstDayOfYear(
int year)
const;
840 QDate lastDayOfYear(
int year)
const;
851 QDate firstDayOfYear(
const QDate &date = QDate::currentDate())
const;
862 QDate lastDayOfYear(
const QDate &date = QDate::currentDate())
const;
874 QDate firstDayOfMonth(
int year,
int month)
const;
886 QDate lastDayOfMonth(
int year,
int month)
const;
897 QDate firstDayOfMonth(
const QDate &date = QDate::currentDate())
const;
908 QDate lastDayOfMonth(
const QDate &date = QDate::currentDate())
const;
919 virtual QString monthName(
int month,
int year, MonthNameFormat format = LongName)
const = 0;
928 virtual QString monthName(
const QDate &date, MonthNameFormat format = LongName)
const;
938 virtual QString weekDayName(
int weekDay, WeekDayNameFormat format = LongDayName)
const = 0;
947 virtual QString weekDayName(
const QDate &date, WeekDayNameFormat format = LongDayName)
const;
959 KDE_DEPRECATED
virtual QString yearString(
const QDate &date, StringFormat format = LongFormat)
const;
971 KDE_DEPRECATED
virtual QString monthString(
const QDate &pDate, StringFormat format = LongFormat)
const;
983 KDE_DEPRECATED
virtual QString dayString(
const QDate &pDate, StringFormat format = LongFormat)
const;
997 KDE_DEPRECATED
QString yearInEraString(
const QDate &date, StringFormat format = ShortFormat)
const;
1012 KDE_DEPRECATED
QString dayOfYearString(
const QDate &pDate, StringFormat format = LongFormat)
const;
1026 KDE_DEPRECATED
QString dayOfWeekString(
const QDate &pDate)
const;
1041 KDE_DEPRECATED
QString weekNumberString(
const QDate &pDate, StringFormat format = LongFormat)
const;
1056 KDE_DEPRECATED
QString monthsInYearString(
const QDate &pDate, StringFormat format = LongFormat)
const;
1071 KDE_DEPRECATED
QString weeksInYearString(
const QDate &pDate, StringFormat format = LongFormat)
const;
1086 KDE_DEPRECATED
QString daysInYearString(
const QDate &pDate, StringFormat format = LongFormat)
const;
1101 KDE_DEPRECATED
QString daysInMonthString(
const QDate &pDate, StringFormat format = LongFormat)
const;
1115 KDE_DEPRECATED
QString daysInWeekString(
const QDate &date)
const;
1127 virtual int yearStringToInteger(
const QString &sNum,
int &iLength)
const;
1139 virtual int monthStringToInteger(
const QString &sNum,
int &iLength)
const;
1151 virtual int dayStringToInteger(
const QString &sNum,
int &iLength)
const;
1288 QString formatDate(
const QDate &fromDate,
const QString &toFormat,
1350 virtual QDate readDate(
const QString &str,
bool *ok = 0)
const;
1385 virtual QDate readDate(
const QString &dateString,
const QString &dateFormat,
bool *ok = 0)
const;
1447 QDate readDate(
const QString &dateString,
const QString &dateFormat,
bool *ok,
1480 int shortYearWindowStartYear()
const;
1499 int applyShortYearWindow(
int inputYear)
const;
1513 virtual int weekStartDay()
const;
1526 KDE_DEPRECATED
virtual int weekDayOfPray()
const = 0;
1533 virtual bool isLunar()
const = 0;
1540 virtual bool isLunisolar()
const = 0;
1547 virtual bool isSolar()
const = 0;
1557 virtual bool isProleptic()
const = 0;
1577 virtual bool julianDayToDate(
int jd,
int &year,
int &month,
int &day)
const = 0;
1595 virtual bool dateToJulianDay(
int year,
int month,
int day,
int &jd)
const = 0;
1628 KDE_DEPRECATED
void setMaxMonthsInYear(
int maxMonths);
1637 KDE_DEPRECATED
void setMaxDaysInWeek(
int maxDays);
1648 KDE_DEPRECATED
void setHasYear0(
bool hasYear0);
1679 friend class KLocalizedDatePrivate;
1681 friend class KDateTable;
@ ShortDayName
Short name format, e.g.
@ ShortFormat
Short string format, e.g.
Jalali calendar type implementation.
StringFormat
Format for returned year number / month number / day number as string.
@ LongNamePossessive
Long name possessive format, e.g.
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
KLocale * locale()
Returns the global locale object.
@ DefaultComponentFormat
The system locale default for the componant.
MonthNameFormat
Format for returned month / day name.
@ ShortName
Short name format, e.g.
@ LongDate
Locale Long date format, e.g.
KSharedConfigPtr config()
Returns the general config object.
ReadDateFlags
Flags for readDate()
@ ShortNamePossessive
Short name possessive format, e.g.
@ LongName
Long name format, e.g.
@ DefaultWeekNumber
The system locale default.
@ LongDayName
Long name format, e.g.
A class representing a date localized using the local calendar system, language and formats.
WeekDayNameFormat
Format for returned month / day name.
DateFormat
Format for date string.
KLocale provides support for country specific stuff like the national language.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jan 30 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.