KDECore
KCalendarSystem Class Reference
CalendarSystem abstract class, default derived kde gregorian class and factory class. More...
#include <kcalendarsystem.h>
Public Member Functions | |
virtual QDate | addDays (const QDate &date, int ndays) const =0 |
virtual QDate | addMonths (const QDate &date, int nmonths) const =0 |
virtual QDate | addYears (const QDate &date, int nyears) const =0 |
virtual QString | calendarName () const =0 |
virtual int | day (const QDate &date) const =0 |
virtual int | dayOfWeek (const QDate &date) const =0 |
virtual int | dayOfYear (const QDate &date) const =0 |
virtual int | daysInMonth (const QDate &date) const =0 |
virtual int | daysInYear (const QDate &date) const =0 |
virtual QString | dayString (const QDate &pDate, bool bShort) const |
virtual int | dayStringToInteger (const QString &sNum, int &iLength) const |
virtual bool | isLunar () const =0 |
virtual bool | isLunisolar () const =0 |
virtual bool | isSolar () const =0 |
KCalendarSystem (const KLocale *locale=0) | |
virtual int | maxValidYear () const =0 |
virtual int | minValidYear () const =0 |
virtual int | month (const QDate &date) const =0 |
virtual QString | monthName (const QDate &date, bool shortName=false) const =0 |
virtual QString | monthName (int month, int year, bool shortName=false) const =0 |
virtual QString | monthNamePossessive (const QDate &date, bool shortName=false) const =0 |
virtual QString | monthNamePossessive (int month, int year, bool shortName=false) const =0 |
virtual int | monthsInYear (const QDate &date) const =0 |
virtual QString | monthString (const QDate &pDate, bool bShort) const |
virtual int | monthStringToInteger (const QString &sNum, int &iLength) const |
virtual bool | setYMD (QDate &date, int y, int m, int d) const =0 |
virtual QString | weekDayName (const QDate &date, bool shortName=false) const =0 |
virtual QString | weekDayName (int weekDay, bool shortName=false) const =0 |
virtual int | weekDayOfPray () const =0 |
virtual int | weekNumber (const QDate &date, int *yearNum=0) const =0 |
virtual int | weeksInYear (int year) const =0 |
virtual int | year (const QDate &date) const =0 |
virtual QString | yearString (const QDate &pDate, bool bShort) const |
virtual int | yearStringToInteger (const QString &sNum, int &iLength) const |
virtual | ~KCalendarSystem () |
Protected Member Functions | |
const KLocale * | locale () const |
Detailed Description
CalendarSystem abstract class, default derived kde gregorian class and factory class.Provides support for different calendar types for kde calendar widget and related stuff.
Derived classes must be created through KCalendarFactory class
- Since:
- 3.2
Definition at line 42 of file kcalendarsystem.h.
Constructor & Destructor Documentation
KCalendarSystem::KCalendarSystem | ( | const KLocale * | locale = 0 |
) |
Constructor of abstract calendar class.
This will be called by the derived classes.
- Parameters:
-
locale It will use this locale for translations, 0 means global.
Definition at line 36 of file kcalendarsystem.cpp.
KCalendarSystem::~KCalendarSystem | ( | ) | [virtual] |
Member Function Documentation
Returns a QDate object containing a date ndays later.
- Parameters:
-
date The old date ndays The number of days to add
- Returns:
- The new date
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Returns a QDate object containing a date nmonths later.
- Parameters:
-
date The old date nmonths The number of months to add
- Returns:
- The new date
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Returns a QDate object containing a date nyears later.
- Parameters:
-
date The old date nyears The number of years to add
- Returns:
- The new date
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual QString KCalendarSystem::calendarName | ( | ) | const [pure virtual] |
Gets the string representing the calendar.
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::day | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type day number of month for a given date.
- Parameters:
-
date gregorian date equivalent to the specific one
- Returns:
- day of the month
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::dayOfWeek | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type number of day of week number for a given date.
- Parameters:
-
date gregorian date
- Returns:
- day of week
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::dayOfYear | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type day number of year for a given date.
- Parameters:
-
date gregorian date equivalent to the specific one
- Returns:
- day number
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::daysInMonth | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type number of days in month for a given date.
- Parameters:
-
date gregorian date
- Returns:
- number of days for month in date
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::daysInYear | ( | const QDate & | date | ) | const [pure virtual] |
Gets the number of days in date whose years specified.
- Parameters:
-
date Gregorian date equivalent to the specific one
- Returns:
- The number of days in year
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Converts a date into a day literal.
- Parameters:
-
pDate The date to convert bShort If the short version of should be used
- Returns:
- The day literal of the date
Reimplemented in KCalendarSystemHebrew.
Definition at line 55 of file kcalendarsystem.cpp.
int KCalendarSystem::dayStringToInteger | ( | const QString & | sNum, | |
int & | iLength | |||
) | const [virtual] |
Converts a day literal of a part of a string into a integer starting at the beginning of the string.
- Parameters:
-
sNum The string to parse iLength The number of QChars used, and 0 if no valid symbols was found in the string
- Returns:
- An integer corresponding to the day
Reimplemented in KCalendarSystemHebrew.
Definition at line 104 of file kcalendarsystem.cpp.
virtual bool KCalendarSystem::isLunar | ( | ) | const [pure virtual] |
Gets if the calendar is lunar based.
- Returns:
- if the calendar is lunar based
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual bool KCalendarSystem::isLunisolar | ( | ) | const [pure virtual] |
Gets if the calendar is lunisolar based.
- Returns:
- if the calendar is lunisolar based
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual bool KCalendarSystem::isSolar | ( | ) | const [pure virtual] |
Gets if the calendar is solar based.
- Returns:
- if the calendar is solar based
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
const KLocale * KCalendarSystem::locale | ( | ) | const [protected] |
Gets the locale the calendar uses for translations.
Set in the constructor.
Definition at line 47 of file kcalendarsystem.cpp.
virtual int KCalendarSystem::maxValidYear | ( | ) | const [pure virtual] |
Gets the maximum year value supported by specific calendar type algorithms (QDate, 8000).
- Returns:
- maximum year supported
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::minValidYear | ( | ) | const [pure virtual] |
Gets the first year value supported by specific calendar type algorithms.
- Returns:
- first year supported
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::month | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type month for a given gregorian date.
- Parameters:
-
date gregorian date
- Returns:
- month number
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual QString KCalendarSystem::monthName | ( | const QDate & | date, | |
bool | shortName = false | |||
) | const [pure virtual] |
Gets specific calendar type month name for a given gregorian date.
- Parameters:
-
date Gregorian date shortName Specifies if the short month name should be used
- Returns:
- The name of the month
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual QString KCalendarSystem::monthName | ( | int | month, | |
int | year, | |||
bool | shortName = false | |||
) | const [pure virtual] |
Gets specific calendar type month name for a given month number If an invalid month is specified, QString::null is returned.
- Parameters:
-
month The month number year The year the month belongs to shortName Specifies if the short month name should be used
- Returns:
- The name of the month
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual QString KCalendarSystem::monthNamePossessive | ( | const QDate & | date, | |
bool | shortName = false | |||
) | const [pure virtual] |
Returns a string containing the possessive form of the month name.
("of January", "of February", etc.) It's needed in long format dates in some languages.
- Parameters:
-
date Gregorian date shortName Specifies if the short month name should be used
- Returns:
- The possessive form of the name of the month
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual QString KCalendarSystem::monthNamePossessive | ( | int | month, | |
int | year, | |||
bool | shortName = false | |||
) | const [pure virtual] |
Returns a string containing the possessive form of the month name.
("of January", "of February", etc.) It's needed in long format dates in some languages. If an invalid month is specified, QString::null is returned.
- Parameters:
-
month The month number year The year the month belongs to shortName Specifies if the short month name should be used
- Returns:
- The possessive form of the name of the month
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::monthsInYear | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type number of month for a given year.
- Parameters:
-
date The date whose year to use
- Returns:
- The number of months in that year
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Converts a date into a month literal.
- Parameters:
-
pDate The date to convert bShort If the short version of should be used
- Returns:
- The month literal of the date
Definition at line 66 of file kcalendarsystem.cpp.
int KCalendarSystem::monthStringToInteger | ( | const QString & | sNum, | |
int & | iLength | |||
) | const [virtual] |
Converts a month literal of a part of a string into a integer starting at the beginning of the string.
- Parameters:
-
sNum The string to parse iLength The number of QChars used, and 0 if no valid symbols was found in the string
- Returns:
- An integer corresponding to the month
Definition at line 109 of file kcalendarsystem.cpp.
Changes the date's year, month and day.
The range of the year, month and day depends on which calendar is being used.
- Parameters:
-
date Date to change y Year m Month number d Day of month
- Returns:
- true if the date is valid; otherwise returns false.
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual QString KCalendarSystem::weekDayName | ( | const QDate & | date, | |
bool | shortName = false | |||
) | const [pure virtual] |
Gets specific calendar type week day name.
- Parameters:
-
date the date shortName short or complete day name
- Returns:
- day name
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Gets specific calendar type week day name If an invalid week day is specified, QString::null is returned.
- Parameters:
-
weekDay number of day in week (1 -> Monday) shortName short or complete day name
- Returns:
- day name
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Definition at line 119 of file kcalendarsystem.cpp.
virtual int KCalendarSystem::weekDayOfPray | ( | ) | const [pure virtual] |
Gets the day of the week traditionaly associated with pray.
- Returns:
- day number
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::weekNumber | ( | const QDate & | date, | |
int * | yearNum = 0 | |||
) | const [pure virtual] |
Gets specific calendar type week number for a given date.
- Parameters:
-
date gregorian date yearNum The year the date belongs to
- Returns:
- week number
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::weeksInYear | ( | int | year | ) | const [pure virtual] |
Gets the number of weeks in a specified year.
- Parameters:
-
year the year
- Returns:
- number of weeks in year
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
virtual int KCalendarSystem::year | ( | const QDate & | date | ) | const [pure virtual] |
Gets specific calendar type year for a given gregorian date.
- Parameters:
-
date gregorian date
- Returns:
- year
Implemented in KCalendarSystemGregorian, KCalendarSystemHebrew, KCalendarSystemHijri, and KCalendarSystemJalali.
Converts a date into a year literal.
- Parameters:
-
pDate The date to convert bShort If the short version of should be used
- Returns:
- The year literal of the date
Reimplemented in KCalendarSystemHebrew.
Definition at line 77 of file kcalendarsystem.cpp.
int KCalendarSystem::yearStringToInteger | ( | const QString & | sNum, | |
int & | iLength | |||
) | const [virtual] |
Converts a year literal of a part of a string into a integer starting at the beginning of the string.
- Parameters:
-
sNum The string to parse iLength The number of QChars used, and 0 if no valid symbols was found in the string
- Returns:
- An integer corresponding to the year
Reimplemented in KCalendarSystemGregorian, and KCalendarSystemHebrew.
Definition at line 114 of file kcalendarsystem.cpp.
The documentation for this class was generated from the following files: