KDECore
kcalendarsystem.h
Go to the documentation of this file.
83 KDE_DEPRECATED static KCalendarSystem *create(const QString & calType = QLatin1String("gregorian"),
101 KDE_DEPRECATED static KCalendarSystem *create(const QString & calType, KSharedConfig::Ptr config,
129 static KCalendarSystem *create(KLocale::CalendarSystem calendarSystem, KSharedConfig::Ptr config,
177 static QString calendarLabel(KLocale::CalendarSystem calendarSystem, const KLocale *locale = KGlobal::locale());
190 KDE_DEPRECATED static KLocale::CalendarSystem calendarSystemForCalendarType(const QString &calendarType);
796 int week(const QDate &date, KLocale::WeekNumberSystem weekNumberSystem, int *yearNum = 0) 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;
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;
1169 virtual QString formatDate(const QDate &fromDate, KLocale::DateFormat toFormat = KLocale::LongDate) const;
Definition kcalendarera_p.h:44
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
Definition kcalendarsystem.h:41
QString daysInWeekString(const QDate &date) const
Definition kcalendarsystem.cpp:2013
int yearsDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in completed calendar years.
Definition kcalendarsystem.cpp:1530
friend class KCalendarSystemJapanese
Definition kcalendarsystem.h:1672
friend class KCalendarSystemThai
Definition kcalendarsystem.h:1676
virtual QDate earliestValidDate() const
Returns the earliest date valid in this calendar system implementation.
Definition kcalendarsystem.cpp:1120
StringFormat
Format for returned year number / month number / day number as string.
Definition kcalendarsystem.h:47
virtual int dayOfWeek(const QDate &date) const
Returns the weekday number for the given date.
Definition kcalendarsystem.cpp:1686
virtual int day(const QDate &date) const
Returns the day portion of a given date in the current calendar system.
Definition kcalendarsystem.cpp:1357
friend class KCalendarSystemQDate
Definition kcalendarsystem.h:1675
virtual QString monthName(int month, int year, MonthNameFormat format=LongName) const =0
Gets specific calendar type month name for a given month number If an invalid month is specified,...
Definition kcalendarsystem.cpp:1842
virtual int weekStartDay() const
Use this to determine which day is the first day of the week.
Definition kcalendarsystem.cpp:2405
QString yearInEraString(const QDate &date, StringFormat format=ShortFormat) const
Definition kcalendarsystem.cpp:1937
virtual QString monthString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1918
virtual int year(const QDate &date) const
Returns the year portion of a given date in the current calendar system.
Definition kcalendarsystem.cpp:1331
QString eraName(const QDate &date, StringFormat format=ShortFormat) const
Definition kcalendarsystem.cpp:1371
KCalendarSystem(const KLocale *locale=0)
Constructor of abstract calendar class.
Definition kcalendarsystem.cpp:1073
virtual int monthStringToInteger(const QString &sNum, int &iLength) const
Definition kcalendarsystem.cpp:2036
QString dayOfYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1947
virtual bool isLunisolar() const =0
Returns whether the calendar is lunisolar based.
friend class KCalendarSystemCoptic
Definition kcalendarsystem.h:1665
virtual int daysInMonth(const QDate &date) const
Returns the number of days in the given month.
Definition kcalendarsystem.cpp:1643
QDate firstDayOfMonth(int year, int month) const
Definition kcalendarsystem.cpp:1791
virtual int weekDayOfPray() const =0
QDate firstDayOfYear(int year) const
Definition kcalendarsystem.cpp:1743
virtual bool isLeapYear(int year) const =0
Returns whether a given year is a leap year.
Definition kcalendarsystem.cpp:1720
friend class KCalendarSystemIslamicCivil
Definition kcalendarsystem.h:1670
friend class KCalendarSystemGregorian
Definition kcalendarsystem.h:1667
const KLocale * locale() const
Returns the locale used for translations and formats for this calendar system instance.
Definition kcalendarsystem.cpp:2479
int daysDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in days The returned value will be negative if fromDate > to...
Definition kcalendarsystem.cpp:1554
void setMaxDaysInWeek(int maxDays)
Definition kcalendarsystem.cpp:2493
friend class KLocalizedDatePrivate
Definition kcalendarsystem.h:1679
virtual QString dayString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1927
virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const =0
Internal method to convert a Julian Day number into the YMD values for this calendar system.
Definition kcalendarsystem.cpp:2416
virtual QString calendarType() const =0
QString monthsInYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1973
virtual QDate latestValidDate() const
Returns the latest date valid in this calendar system implementation.
Definition kcalendarsystem.cpp:1127
friend class KCalendarSystemEthiopian
Definition kcalendarsystem.h:1666
virtual int weekNumber(const QDate &date, int *yearNum=0) const
Definition kcalendarsystem.cpp:1697
static KLocale::CalendarSystem calendarSystem(const QString &calendarType)
Definition kcalendarsystem.cpp:183
virtual QDate readDate(const QString &str, bool *ok=0) const
Converts a localized date string to a QDate.
Definition kcalendarsystem.cpp:2333
virtual int yearStringToInteger(const QString &sNum, int &iLength) const
Definition kcalendarsystem.cpp:2018
virtual QString formatDate(const QDate &fromDate, KLocale::DateFormat toFormat=KLocale::LongDate) const
Returns a string formatted to the current locale's conventions regarding dates.
Definition kcalendarsystem.cpp:2048
QDate lastDayOfYear(int year) const
Definition kcalendarsystem.cpp:1755
void dateDifference(const QDate &fromDate, const QDate &toDate, int *yearsDiff, int *monthsDiff, int *daysDiff, int *direction) const
Returns the difference between two dates in years, months and days.
Definition kcalendarsystem.cpp:1519
int week(const QDate &date, int *yearNum=0) const
Returns the localized Week Number for the date.
Definition kcalendarsystem.cpp:1703
virtual bool isValid(int year, int month, int day) const =0
Returns whether a given date is valid in this calendar system.
Definition kcalendarsystem.cpp:1133
void getDate(const QDate date, int *year, int *month, int *day) const
Definition kcalendarsystem.cpp:1307
virtual int dayStringToInteger(const QString &sNum, int &iLength) const
Definition kcalendarsystem.cpp:2042
virtual int dayOfYear(const QDate &date) const
Returns the day number of year for the given date.
Definition kcalendarsystem.cpp:1675
int monthsDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in completed calendar months The returned value will be nega...
Definition kcalendarsystem.cpp:1542
QDate lastDayOfMonth(int year, int month) const
Definition kcalendarsystem.cpp:1803
virtual QDate addMonths(const QDate &date, int nmonths) const
Returns a QDate containing a date nmonths months later.
Definition kcalendarsystem.cpp:1463
virtual QString yearString(const QDate &date, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1909
virtual bool setYMD(QDate &date, int y, int m, int d) const
Definition kcalendarsystem.cpp:1301
friend class KCalendarSystemJalali
Definition kcalendarsystem.h:1671
friend class KCalendarSystemJulian
Definition kcalendarsystem.h:1673
virtual QString weekDayName(int weekDay, WeekDayNameFormat format=LongDayName) const =0
Gets specific calendar type week day name.
Definition kcalendarsystem.cpp:1881
void setMaxMonthsInYear(int maxMonths)
Definition kcalendarsystem.cpp:2487
virtual int daysInYear(const QDate &date) const
Returns the number of days in the given year.
Definition kcalendarsystem.cpp:1620
int shortYearWindowStartYear() const
Definition kcalendarsystem.cpp:2390
static QString calendarLabel(const QString &calendarType)
Definition kcalendarsystem.cpp:78
virtual QDate epoch() const
Returns a QDate holding the epoch of the calendar system.
Definition kcalendarsystem.cpp:1115
virtual bool dateToJulianDay(int year, int month, int day, int &jd) const =0
Internal method to convert YMD values for this calendar system into a Julian Day number.
Definition kcalendarsystem.cpp:2448
virtual int monthsInYear(const QDate &date) const
Returns number of months in the given year.
Definition kcalendarsystem.cpp:1563
bool isValidIsoWeekDate(int year, int isoWeekNumber, int dayOfIsoWeek) const
Definition kcalendarsystem.cpp:1171
virtual QDate addDays(const QDate &date, int ndays) const
Returns a QDate containing a date ndays days later.
Definition kcalendarsystem.cpp:1502
virtual bool isProleptic() const =0
Returns whether the calendar system is proleptic, i.e.
QString eraYear(const QDate &date, StringFormat format=ShortFormat) const
Definition kcalendarsystem.cpp:1387
friend class KCalendarSystemIndianNational
Definition kcalendarsystem.h:1669
QString daysInYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1993
bool setDateIsoWeek(QDate &date, int year, int isoWeekNumber, int dayOfIsoWeek) const
Definition kcalendarsystem.cpp:1272
virtual int weeksInYear(const QDate &date) const
Returns the number of localized weeks in the given year.
Definition kcalendarsystem.cpp:1586
QString daysInMonthString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:2003
QString weeksInYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1983
virtual QDate addYears(const QDate &date, int nyears) const
Returns a QDate containing a date nyears years later.
Definition kcalendarsystem.cpp:1435
virtual int month(const QDate &date) const
Returns the month portion of a given date in the current calendar system.
Definition kcalendarsystem.cpp:1344
QString weekNumberString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1963
virtual bool setDate(QDate &date, int year, int month, int day) const
Changes the date's year, month and day.
Definition kcalendarsystem.cpp:1222
QString dayOfWeekString(const QDate &pDate) const
Definition kcalendarsystem.cpp:1957
friend class KCalendarSystemHebrew
Definition kcalendarsystem.h:1668
virtual int daysInWeek(const QDate &date) const
Returns the number of days in the given week.
Definition kcalendarsystem.cpp:1668
int applyShortYearWindow(int inputYear) const
Definition kcalendarsystem.cpp:2398
friend class KCalendarSystemMinguo
Definition kcalendarsystem.h:1674
KLocale provides support for country specific stuff like the national language.
Definition klocale.h:70
Definition kaboutdata.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.