• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • date
kcalendarsystem.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
3 Copyright (c) 2002-2003 Hans Petter Bieker <bieker@kde.org>
4 Copyright 2007, 2009, 2010 John Layt <john@layt.net>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KCALENDARSYSTEM_H
23#define KCALENDARSYSTEM_H
24
25#include <kdecore_export.h>
26#include "klocale.h" // needed for enums
27#include "kglobal.h"
28
29#include <QtCore/QStringList>
30#include <QtCore/QDate>
31
32class KCalendarSystemPrivate;
33class KCalendarEra;
34
40class KDECORE_EXPORT KCalendarSystem
41{
42public:
43
47 enum StringFormat {
48 ShortFormat,
49 LongFormat
50 };
51
55 enum MonthNameFormat {
56 ShortName,
57 LongName,
58 ShortNamePossessive,
59 LongNamePossessive,
60 NarrowName
61 };
62
66 enum WeekDayNameFormat {
67 ShortDayName,
68 LongDayName,
69 NarrowDayName
70 };
71
72 //KDE5 remove
83 KDE_DEPRECATED static KCalendarSystem *create(const QString & calType = QLatin1String("gregorian"),
84 const KLocale * locale = 0);
85
86 //KDE5 remove
101 KDE_DEPRECATED static KCalendarSystem *create(const QString & calType, KSharedConfig::Ptr config,
102 const KLocale * locale = 0);
103
104 //KDE5 add default value to calendarSystem
114 static KCalendarSystem *create(KLocale::CalendarSystem calendarSystem,
115 const KLocale *locale = 0);
116
129 static KCalendarSystem *create(KLocale::CalendarSystem calendarSystem, KSharedConfig::Ptr config,
130 const KLocale *locale = 0);
131
132 //KDE5 remove
140 KDE_DEPRECATED static QStringList calendarSystems();
141
149 static QList<KLocale::CalendarSystem> calendarSystemsList();
150
151 //KDE5 remove
163 KDE_DEPRECATED static QString calendarLabel(const QString &calendarType);
164
177 static QString calendarLabel(KLocale::CalendarSystem calendarSystem, const KLocale *locale = KGlobal::locale());
178
179 //KDE5 Remove
190 KDE_DEPRECATED static KLocale::CalendarSystem calendarSystemForCalendarType(const QString &calendarType);
191
192 //KDE5 Remove
202 static KLocale::CalendarSystem calendarSystem(const QString &calendarType);
203
204 //KDE5 remove
214 static QString calendarType(KLocale::CalendarSystem calendarSystem);
215
221 explicit KCalendarSystem(const KLocale *locale = 0);
222
231 explicit KCalendarSystem(const KSharedConfig::Ptr config, const KLocale *locale = 0);
232
236 virtual ~KCalendarSystem();
237
245 KDE_DEPRECATED virtual QString calendarType() const = 0;
246
247 //KDE5 make virtual?
255 KLocale::CalendarSystem calendarSystem() const;
256
257 //KDE5 make virtual?
265 QString calendarLabel() const;
266
282 virtual QDate epoch() const;
283
294 virtual QDate earliestValidDate() const;
295
304 virtual QDate latestValidDate() const;
305
314 virtual bool isValid(int year, int month, int day) const = 0;
315
316 //KDE5 make virtual?
326 bool isValid(int year, int dayOfYear) const;
327
328 //KDE5 make virtual?
340 bool isValid(const QString &eraName, int yearInEra, int month, int day) const;
341
342 //KDE5 make virtual?
353 bool isValidIsoWeekDate(int year, int isoWeekNumber, int dayOfIsoWeek) const;
354
361 virtual bool isValid(const QDate &date) const;
362
375 virtual bool setDate(QDate &date, int year, int month, int day) const;
376
377 //KDE5 make virtual?
388 bool setDate(QDate &date, int year, int dayOfYear) const;
389
390 //KDE5 make virtual?
403 bool setDate(QDate &date, QString eraName, int yearInEra, int month, int day) const;
404
405 //KDE5 make virtual?
417 bool setDateIsoWeek(QDate &date, int year, int isoWeekNumber, int dayOfIsoWeek) const;
418
435 KDE_DEPRECATED virtual bool setYMD(QDate &date, int y, int m, int d) const;
436
437 //KDE5 make virtual?
448 void getDate(const QDate date, int *year, int *month, int *day) const;
449
456 virtual int year(const QDate &date) const;
457
464 virtual int month(const QDate &date) const;
465
472 virtual int day(const QDate &date) const;
473
474 //KDE5 make virtual?
485 QString eraName(const QDate &date, StringFormat format = ShortFormat) const;
486
487 //KDE5 make virtual?
498 QString eraYear(const QDate &date, StringFormat format = ShortFormat) const;
499
500 //KDE5 make virtual?
510 int yearInEra(const QDate &date) const;
511
519 virtual QDate addYears(const QDate &date, int nyears) const;
520
528 virtual QDate addMonths(const QDate &date, int nmonths) const;
529
537 virtual QDate addDays(const QDate &date, int ndays) const;
538
539 //KDE5 make virtual?
558 void dateDifference(const QDate &fromDate, const QDate &toDate,
559 int *yearsDiff, int *monthsDiff, int *daysDiff, int *direction) const;
560
561 //KDE5 make virtual?
572 int yearsDifference(const QDate &fromDate, const QDate &toDate) const;
573
574 //KDE5 make virtual?
587 int monthsDifference(const QDate &fromDate, const QDate &toDate) const;
588
589 //KDE5 make virtual?
598 int daysDifference(const QDate &fromDate, const QDate &toDate) const;
599
606 virtual int monthsInYear(const QDate &date) const;
607
608 //KDE5 make virtual?
617 int monthsInYear(int year) const;
618
625 virtual int weeksInYear(const QDate &date) const;
626
627 //KDE5 Merge with virtual weeksInYear with default
642 int weeksInYear(const QDate &date, KLocale::WeekNumberSystem weekNumberSystem) const;
643
650 virtual int weeksInYear(int year) const;
651
652 //KDE5 Merge with virtual weeksInYear with default
667 int weeksInYear(int year, KLocale::WeekNumberSystem weekNumberSystem) const;
668
675 virtual int daysInYear(const QDate &date) const;
676
677 //KDE5 make virtual?
686 int daysInYear(int year) const;
687
694 virtual int daysInMonth(const QDate &date) const;
695
696 //KDE5 make virtual?
706 int daysInMonth(int year, int month) const;
707
714 virtual int daysInWeek(const QDate &date) const;
715
724 virtual int dayOfYear(const QDate &date) const;
725
736 virtual int dayOfWeek(const QDate &date) const;
737
753 KDE_DEPRECATED virtual int weekNumber(const QDate &date, int *yearNum = 0) const;
754
755 //KDE5 Make virtual?
773 int week(const QDate &date, int *yearNum = 0) const;
774
775 //KDE5 Make virtual?
796 int week(const QDate &date, KLocale::WeekNumberSystem weekNumberSystem, int *yearNum = 0) const;
797
807 virtual bool isLeapYear(int year) const = 0;
808
818 virtual bool isLeapYear(const QDate &date) const;
819
820 //KDE5 Make virtual?
829 QDate firstDayOfYear(int year) const;
830
831 //KDE5 Make virtual?
840 QDate lastDayOfYear(int year) const;
841
842 //KDE5 Make virtual?
851 QDate firstDayOfYear(const QDate &date = QDate::currentDate()) const;
852
853 //KDE5 Make virtual?
862 QDate lastDayOfYear(const QDate &date = QDate::currentDate()) const;
863
864 //KDE5 Make virtual?
874 QDate firstDayOfMonth(int year, int month) const;
875
876 //KDE5 Make virtual?
886 QDate lastDayOfMonth(int year, int month) const;
887
888 //KDE5 Make virtual?
897 QDate firstDayOfMonth(const QDate &date = QDate::currentDate()) const;
898
899 //KDE5 Make virtual?
908 QDate lastDayOfMonth(const QDate &date = QDate::currentDate()) const;
909
919 virtual QString monthName(int month, int year, MonthNameFormat format = LongName) const = 0;
920
928 virtual QString monthName(const QDate &date, MonthNameFormat format = LongName) const;
929
938 virtual QString weekDayName(int weekDay, WeekDayNameFormat format = LongDayName) const = 0;
939
947 virtual QString weekDayName(const QDate &date, WeekDayNameFormat format = LongDayName) const;
948
959 KDE_DEPRECATED virtual QString yearString(const QDate &date, StringFormat format = LongFormat) const;
960
971 KDE_DEPRECATED virtual QString monthString(const QDate &pDate, StringFormat format = LongFormat) const;
972
983 KDE_DEPRECATED virtual QString dayString(const QDate &pDate, StringFormat format = LongFormat) const;
984
985 //KDE5 make virtual?
997 KDE_DEPRECATED QString yearInEraString(const QDate &date, StringFormat format = ShortFormat) const;
998
999 //KDE5 make virtual?
1012 KDE_DEPRECATED QString dayOfYearString(const QDate &pDate, StringFormat format = LongFormat) const;
1013
1014 //KDE5 make virtual?
1026 KDE_DEPRECATED QString dayOfWeekString(const QDate &pDate) const;
1027
1028 //KDE5 make virtual?
1041 KDE_DEPRECATED QString weekNumberString(const QDate &pDate, StringFormat format = LongFormat) const;
1042
1043 //KDE5 make virtual?
1056 KDE_DEPRECATED QString monthsInYearString(const QDate &pDate, StringFormat format = LongFormat) const;
1057
1058 //KDE5 make virtual?
1071 KDE_DEPRECATED QString weeksInYearString(const QDate &pDate, StringFormat format = LongFormat) const;
1072
1073 //KDE5 make virtual?
1086 KDE_DEPRECATED QString daysInYearString(const QDate &pDate, StringFormat format = LongFormat) const;
1087
1088 //KDE5 make virtual?
1101 KDE_DEPRECATED QString daysInMonthString(const QDate &pDate, StringFormat format = LongFormat) const;
1102
1103 //KDE5 make virtual?
1115 KDE_DEPRECATED QString daysInWeekString(const QDate &date) const;
1116
1117 //KDE5 make protected or remove?
1127 virtual int yearStringToInteger(const QString &sNum, int &iLength) const;
1128
1129 //KDE5 make protected or remove?
1139 virtual int monthStringToInteger(const QString &sNum, int &iLength) const;
1140
1141 //KDE5 make protected or remove?
1151 virtual int dayStringToInteger(const QString &sNum, int &iLength) const;
1152
1169 virtual QString formatDate(const QDate &fromDate, KLocale::DateFormat toFormat = KLocale::LongDate) const;
1170
1171 //KDE5 Make virtual
1288 QString formatDate(const QDate &fromDate, const QString &toFormat,
1289 KLocale::DateTimeFormatStandard formatStandard = KLocale::KdeFormat) const;
1290
1291 //KDE5 Make virtual
1308 QString formatDate(const QDate &fromDate, const QString &toFormat, KLocale::DigitSet digitSet,
1309 KLocale::DateTimeFormatStandard formatStandard = KLocale::KdeFormat) const;
1310
1311 //KDE5 Make virtual
1330 QString formatDate(const QDate &date, KLocale::DateTimeComponent component,
1331 KLocale::DateTimeComponentFormat format = KLocale::DefaultComponentFormat,
1332 KLocale::WeekNumberSystem weekNumberSystem = KLocale::DefaultWeekNumber) const;
1333
1350 virtual QDate readDate(const QString &str, bool *ok = 0) const;
1351
1370 virtual QDate readDate(const QString &str, KLocale::ReadDateFlags flags, bool *ok = 0) const;
1371
1385 virtual QDate readDate(const QString &dateString, const QString &dateFormat, bool *ok = 0) const;
1386
1387 //KDE5 Make virtual
1447 QDate readDate(const QString &dateString, const QString &dateFormat, bool *ok,
1448 KLocale::DateTimeFormatStandard formatStandard) const;
1449
1450 //KDE5 Make virtual
1480 int shortYearWindowStartYear() const;
1481
1482 //KDE5 Make virtual
1499 int applyShortYearWindow(int inputYear) const;
1500
1513 virtual int weekStartDay() const;
1514
1526 KDE_DEPRECATED virtual int weekDayOfPray() const = 0;
1527
1533 virtual bool isLunar() const = 0;
1534
1540 virtual bool isLunisolar() const = 0;
1541
1547 virtual bool isSolar() const = 0;
1548
1557 virtual bool isProleptic() const = 0;
1558
1559protected:
1560
1577 virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const = 0;
1578
1595 virtual bool dateToJulianDay(int year, int month, int day, int &jd) const = 0;
1596
1619 const KLocale *locale() const;
1620
1628 KDE_DEPRECATED void setMaxMonthsInYear(int maxMonths);
1629
1637 KDE_DEPRECATED void setMaxDaysInWeek(int maxDays);
1638
1648 KDE_DEPRECATED void setHasYear0(bool hasYear0);
1649
1659 KCalendarSystem(KCalendarSystemPrivate &dd,
1660 const KSharedConfig::Ptr config = KSharedConfig::Ptr(),
1661 const KLocale *locale = 0);
1662
1663private:
1664 //Required for shared d-pointer as already private, remove in KDE5
1665 friend class KCalendarSystemCoptic;
1666 friend class KCalendarSystemEthiopian;
1667 friend class KCalendarSystemGregorian;
1668 friend class KCalendarSystemHebrew;
1669 friend class KCalendarSystemIndianNational;
1670 friend class KCalendarSystemIslamicCivil;
1671 friend class KCalendarSystemJalali;
1672 friend class KCalendarSystemJapanese;
1673 friend class KCalendarSystemJulian;
1674 friend class KCalendarSystemMinguo;
1675 friend class KCalendarSystemQDate;
1676 friend class KCalendarSystemThai;
1677 //Other friends that need access to protected/private functions
1678 friend class KLocalizedDate;
1679 friend class KLocalizedDatePrivate;
1680 friend class KDateTimeParser;
1681 friend class KDateTable;
1682
1683 // Era functions needed by friends, may be made public later if needed in KCM
1684 QList<KCalendarEra> *eraList() const;
1685 KCalendarEra era(const QDate &eraDate) const;
1686 KCalendarEra era(const QString &eraName, int yearInEra) const;
1687
1688 Q_DISABLE_COPY(KCalendarSystem)
1689 KCalendarSystemPrivate * const d_ptr; // KDE5 make protected
1690 Q_DECLARE_PRIVATE(KCalendarSystem)
1691};
1692
1693#endif
KCalendarEra
Definition kcalendarera_p.h:44
KCalendarSystemPrivate
Definition kcalendarsystemprivate_p.h:32
KCalendarSystem
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
Definition kcalendarsystem.h:41
KCalendarSystem::daysInWeekString
QString daysInWeekString(const QDate &date) const
Definition kcalendarsystem.cpp:2013
KCalendarSystem::setHasYear0
void setHasYear0(bool hasYear0)
Definition kcalendarsystem.cpp:2499
KCalendarSystem::yearsDifference
int yearsDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in completed calendar years.
Definition kcalendarsystem.cpp:1530
KCalendarSystem::KCalendarSystemJapanese
friend class KCalendarSystemJapanese
Definition kcalendarsystem.h:1672
KCalendarSystem::KCalendarSystemThai
friend class KCalendarSystemThai
Definition kcalendarsystem.h:1676
KCalendarSystem::earliestValidDate
virtual QDate earliestValidDate() const
Returns the earliest date valid in this calendar system implementation.
Definition kcalendarsystem.cpp:1120
KCalendarSystem::StringFormat
StringFormat
Format for returned year number / month number / day number as string.
Definition kcalendarsystem.h:47
KCalendarSystem::ShortFormat
@ ShortFormat
Short string format, e.g.
Definition kcalendarsystem.h:48
KCalendarSystem::LongFormat
@ LongFormat
Long string format, e.g.
Definition kcalendarsystem.h:49
KCalendarSystem::dayOfWeek
virtual int dayOfWeek(const QDate &date) const
Returns the weekday number for the given date.
Definition kcalendarsystem.cpp:1686
KCalendarSystem::day
virtual int day(const QDate &date) const
Returns the day portion of a given date in the current calendar system.
Definition kcalendarsystem.cpp:1357
KCalendarSystem::KCalendarSystemQDate
friend class KCalendarSystemQDate
Definition kcalendarsystem.h:1675
KCalendarSystem::monthName
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
KCalendarSystem::weekStartDay
virtual int weekStartDay() const
Use this to determine which day is the first day of the week.
Definition kcalendarsystem.cpp:2405
KCalendarSystem::yearInEraString
QString yearInEraString(const QDate &date, StringFormat format=ShortFormat) const
Definition kcalendarsystem.cpp:1937
KCalendarSystem::monthString
virtual QString monthString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1918
KCalendarSystem::year
virtual int year(const QDate &date) const
Returns the year portion of a given date in the current calendar system.
Definition kcalendarsystem.cpp:1331
KCalendarSystem::eraName
QString eraName(const QDate &date, StringFormat format=ShortFormat) const
Definition kcalendarsystem.cpp:1371
KCalendarSystem::KCalendarSystem
KCalendarSystem(const KLocale *locale=0)
Constructor of abstract calendar class.
Definition kcalendarsystem.cpp:1073
KCalendarSystem::monthStringToInteger
virtual int monthStringToInteger(const QString &sNum, int &iLength) const
Definition kcalendarsystem.cpp:2036
KCalendarSystem::dayOfYearString
QString dayOfYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1947
KCalendarSystem::isLunisolar
virtual bool isLunisolar() const =0
Returns whether the calendar is lunisolar based.
KCalendarSystem::KCalendarSystemCoptic
friend class KCalendarSystemCoptic
Definition kcalendarsystem.h:1665
KCalendarSystem::daysInMonth
virtual int daysInMonth(const QDate &date) const
Returns the number of days in the given month.
Definition kcalendarsystem.cpp:1643
KCalendarSystem::firstDayOfMonth
QDate firstDayOfMonth(int year, int month) const
Definition kcalendarsystem.cpp:1791
KCalendarSystem::weekDayOfPray
virtual int weekDayOfPray() const =0
KCalendarSystem::firstDayOfYear
QDate firstDayOfYear(int year) const
Definition kcalendarsystem.cpp:1743
KCalendarSystem::isLeapYear
virtual bool isLeapYear(int year) const =0
Returns whether a given year is a leap year.
Definition kcalendarsystem.cpp:1720
KCalendarSystem::KCalendarSystemIslamicCivil
friend class KCalendarSystemIslamicCivil
Definition kcalendarsystem.h:1670
KCalendarSystem::KCalendarSystemGregorian
friend class KCalendarSystemGregorian
Definition kcalendarsystem.h:1667
KCalendarSystem::locale
const KLocale * locale() const
Returns the locale used for translations and formats for this calendar system instance.
Definition kcalendarsystem.cpp:2479
KCalendarSystem::daysDifference
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
KCalendarSystem::setMaxDaysInWeek
void setMaxDaysInWeek(int maxDays)
Definition kcalendarsystem.cpp:2493
KCalendarSystem::KLocalizedDatePrivate
friend class KLocalizedDatePrivate
Definition kcalendarsystem.h:1679
KCalendarSystem::MonthNameFormat
MonthNameFormat
Format for returned month / day name.
Definition kcalendarsystem.h:55
KCalendarSystem::ShortName
@ ShortName
Short name format, e.g.
Definition kcalendarsystem.h:56
KCalendarSystem::LongNamePossessive
@ LongNamePossessive
Long name possessive format, e.g.
Definition kcalendarsystem.h:59
KCalendarSystem::ShortNamePossessive
@ ShortNamePossessive
Short name possessive format, e.g.
Definition kcalendarsystem.h:58
KCalendarSystem::NarrowName
@ NarrowName
Narrow name format, e.g.
Definition kcalendarsystem.h:60
KCalendarSystem::LongName
@ LongName
Long name format, e.g.
Definition kcalendarsystem.h:57
KCalendarSystem::isSolar
virtual bool isSolar() const =0
Returns whether the calendar is solar based.
KCalendarSystem::WeekDayNameFormat
WeekDayNameFormat
Format for returned month / day name.
Definition kcalendarsystem.h:66
KCalendarSystem::ShortDayName
@ ShortDayName
Short name format, e.g.
Definition kcalendarsystem.h:67
KCalendarSystem::NarrowDayName
@ NarrowDayName
Narrow name format, e.g.
Definition kcalendarsystem.h:69
KCalendarSystem::LongDayName
@ LongDayName
Long name format, e.g.
Definition kcalendarsystem.h:68
KCalendarSystem::dayString
virtual QString dayString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1927
KCalendarSystem::julianDayToDate
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
KCalendarSystem::calendarType
virtual QString calendarType() const =0
KCalendarSystem::monthsInYearString
QString monthsInYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1973
KCalendarSystem::latestValidDate
virtual QDate latestValidDate() const
Returns the latest date valid in this calendar system implementation.
Definition kcalendarsystem.cpp:1127
KCalendarSystem::KCalendarSystemEthiopian
friend class KCalendarSystemEthiopian
Definition kcalendarsystem.h:1666
KCalendarSystem::weekNumber
virtual int weekNumber(const QDate &date, int *yearNum=0) const
Definition kcalendarsystem.cpp:1697
KCalendarSystem::calendarSystem
static KLocale::CalendarSystem calendarSystem(const QString &calendarType)
Definition kcalendarsystem.cpp:183
KCalendarSystem::KDateTable
friend class KDateTable
Definition kcalendarsystem.h:1681
KCalendarSystem::readDate
virtual QDate readDate(const QString &str, bool *ok=0) const
Converts a localized date string to a QDate.
Definition kcalendarsystem.cpp:2333
KCalendarSystem::yearInEra
int yearInEra(const QDate &date) const
Definition kcalendarsystem.cpp:1400
KCalendarSystem::yearStringToInteger
virtual int yearStringToInteger(const QString &sNum, int &iLength) const
Definition kcalendarsystem.cpp:2018
KCalendarSystem::formatDate
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
KCalendarSystem::lastDayOfYear
QDate lastDayOfYear(int year) const
Definition kcalendarsystem.cpp:1755
KCalendarSystem::KLocalizedDate
friend class KLocalizedDate
Definition kcalendarsystem.h:1678
KCalendarSystem::dateDifference
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
KCalendarSystem::week
int week(const QDate &date, int *yearNum=0) const
Returns the localized Week Number for the date.
Definition kcalendarsystem.cpp:1703
KCalendarSystem::isValid
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
KCalendarSystem::getDate
void getDate(const QDate date, int *year, int *month, int *day) const
Definition kcalendarsystem.cpp:1307
KCalendarSystem::dayStringToInteger
virtual int dayStringToInteger(const QString &sNum, int &iLength) const
Definition kcalendarsystem.cpp:2042
KCalendarSystem::dayOfYear
virtual int dayOfYear(const QDate &date) const
Returns the day number of year for the given date.
Definition kcalendarsystem.cpp:1675
KCalendarSystem::monthsDifference
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
KCalendarSystem::lastDayOfMonth
QDate lastDayOfMonth(int year, int month) const
Definition kcalendarsystem.cpp:1803
KCalendarSystem::addMonths
virtual QDate addMonths(const QDate &date, int nmonths) const
Returns a QDate containing a date nmonths months later.
Definition kcalendarsystem.cpp:1463
KCalendarSystem::yearString
virtual QString yearString(const QDate &date, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1909
KCalendarSystem::setYMD
virtual bool setYMD(QDate &date, int y, int m, int d) const
Definition kcalendarsystem.cpp:1301
KCalendarSystem::KCalendarSystemJalali
friend class KCalendarSystemJalali
Definition kcalendarsystem.h:1671
KCalendarSystem::KCalendarSystemJulian
friend class KCalendarSystemJulian
Definition kcalendarsystem.h:1673
KCalendarSystem::weekDayName
virtual QString weekDayName(int weekDay, WeekDayNameFormat format=LongDayName) const =0
Gets specific calendar type week day name.
Definition kcalendarsystem.cpp:1881
KCalendarSystem::setMaxMonthsInYear
void setMaxMonthsInYear(int maxMonths)
Definition kcalendarsystem.cpp:2487
KCalendarSystem::KDateTimeParser
friend class KDateTimeParser
Definition kcalendarsystem.h:1680
KCalendarSystem::daysInYear
virtual int daysInYear(const QDate &date) const
Returns the number of days in the given year.
Definition kcalendarsystem.cpp:1620
KCalendarSystem::shortYearWindowStartYear
int shortYearWindowStartYear() const
Definition kcalendarsystem.cpp:2390
KCalendarSystem::calendarLabel
static QString calendarLabel(const QString &calendarType)
Definition kcalendarsystem.cpp:78
KCalendarSystem::isLunar
virtual bool isLunar() const =0
Returns whether the calendar is lunar based.
KCalendarSystem::epoch
virtual QDate epoch() const
Returns a QDate holding the epoch of the calendar system.
Definition kcalendarsystem.cpp:1115
KCalendarSystem::dateToJulianDay
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
KCalendarSystem::monthsInYear
virtual int monthsInYear(const QDate &date) const
Returns number of months in the given year.
Definition kcalendarsystem.cpp:1563
KCalendarSystem::isValidIsoWeekDate
bool isValidIsoWeekDate(int year, int isoWeekNumber, int dayOfIsoWeek) const
Definition kcalendarsystem.cpp:1171
KCalendarSystem::addDays
virtual QDate addDays(const QDate &date, int ndays) const
Returns a QDate containing a date ndays days later.
Definition kcalendarsystem.cpp:1502
KCalendarSystem::isProleptic
virtual bool isProleptic() const =0
Returns whether the calendar system is proleptic, i.e.
KCalendarSystem::eraYear
QString eraYear(const QDate &date, StringFormat format=ShortFormat) const
Definition kcalendarsystem.cpp:1387
KCalendarSystem::KCalendarSystemIndianNational
friend class KCalendarSystemIndianNational
Definition kcalendarsystem.h:1669
KCalendarSystem::daysInYearString
QString daysInYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1993
KCalendarSystem::setDateIsoWeek
bool setDateIsoWeek(QDate &date, int year, int isoWeekNumber, int dayOfIsoWeek) const
Definition kcalendarsystem.cpp:1272
KCalendarSystem::weeksInYear
virtual int weeksInYear(const QDate &date) const
Returns the number of localized weeks in the given year.
Definition kcalendarsystem.cpp:1586
KCalendarSystem::daysInMonthString
QString daysInMonthString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:2003
KCalendarSystem::weeksInYearString
QString weeksInYearString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1983
KCalendarSystem::addYears
virtual QDate addYears(const QDate &date, int nyears) const
Returns a QDate containing a date nyears years later.
Definition kcalendarsystem.cpp:1435
KCalendarSystem::month
virtual int month(const QDate &date) const
Returns the month portion of a given date in the current calendar system.
Definition kcalendarsystem.cpp:1344
KCalendarSystem::weekNumberString
QString weekNumberString(const QDate &pDate, StringFormat format=LongFormat) const
Definition kcalendarsystem.cpp:1963
KCalendarSystem::setDate
virtual bool setDate(QDate &date, int year, int month, int day) const
Changes the date's year, month and day.
Definition kcalendarsystem.cpp:1222
KCalendarSystem::dayOfWeekString
QString dayOfWeekString(const QDate &pDate) const
Definition kcalendarsystem.cpp:1957
KCalendarSystem::KCalendarSystemHebrew
friend class KCalendarSystemHebrew
Definition kcalendarsystem.h:1668
KCalendarSystem::daysInWeek
virtual int daysInWeek(const QDate &date) const
Returns the number of days in the given week.
Definition kcalendarsystem.cpp:1668
KCalendarSystem::applyShortYearWindow
int applyShortYearWindow(int inputYear) const
Definition kcalendarsystem.cpp:2398
KCalendarSystem::KCalendarSystemMinguo
friend class KCalendarSystemMinguo
Definition kcalendarsystem.h:1674
KLocale
KLocale provides support for country specific stuff like the national language.
Definition klocale.h:70
KLocale::WeekNumberSystem
WeekNumberSystem
Definition klocale.h:815
KLocale::DefaultWeekNumber
@ DefaultWeekNumber
The system locale default.
Definition klocale.h:816
KLocale::DigitSet
DigitSet
Definition klocale.h:309
KLocale::DateTimeFormatStandard
DateTimeFormatStandard
Definition klocale.h:829
KLocale::KdeFormat
@ KdeFormat
KDE Standard.
Definition klocale.h:830
KLocale::ReadDateFlags
ReadDateFlags
Flags for readDate()
Definition klocale.h:1249
KLocale::DateTimeComponent
DateTimeComponent
Definition klocale.h:865
KLocale::DateFormat
DateFormat
Format for date string.
Definition klocale.h:922
KLocale::LongDate
@ LongDate
Locale Long date format, e.g.
Definition klocale.h:924
KLocale::CalendarSystem
CalendarSystem
Definition klocale.h:780
KLocale::DateTimeComponentFormat
DateTimeComponentFormat
Definition klocale.h:908
KLocale::DefaultComponentFormat
@ DefaultComponentFormat
The system locale default for the componant.
Definition klocale.h:909
KSharedConfig::Ptr
KSharedPtr< KSharedConfig > Ptr
Definition ksharedconfig.h:43
QList
Definition kaboutdata.h:33
QStringList
QString
kdecore_export.h
kglobal.h
klocale.h
KGlobal::locale
KLocale * locale()
Returns the global locale object.
Definition kglobal.cpp:170
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal