KDECore
kcalendarsystem.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KCALENDARSYSTEM_H
00022 #define KCALENDARSYSTEM_H
00023
00024 #include <qdatetime.h>
00025 #include <qstring.h>
00026 #include "kdelibs_export.h"
00027
00028 class KLocale;
00029
00030 class KCalendarSystemPrivate;
00031
00042 class KDECORE_EXPORT KCalendarSystem
00043 {
00044 public:
00050 KCalendarSystem(const KLocale * locale = 0);
00051
00055 virtual ~KCalendarSystem();
00056
00063 virtual int year (const QDate & date) const = 0;
00064
00072 virtual QString yearString(const QDate & pDate, bool bShort) const;
00073
00081 virtual int yearStringToInteger(const QString & sNum, int & iLength) const;
00082
00089 virtual int month (const QDate & date) const = 0;
00090
00098 virtual QString monthString(const QDate & pDate, bool bShort) const;
00099
00107 virtual int monthStringToInteger(const QString & sNum, int & iLength) const;
00108
00115 virtual int day (const QDate & date) const = 0;
00116
00124 virtual QString dayString(const QDate & pDate, bool bShort) const;
00125
00133 virtual int dayStringToInteger(const QString & sNum, int & iLength) const;
00134
00142 virtual int dayOfWeek (const QDate & date) const = 0;
00143
00150 virtual int dayOfYear (const QDate & date) const = 0;
00151
00162 virtual bool setYMD(QDate & date, int y, int m, int d) const = 0;
00163
00171 virtual QDate addYears(const QDate & date, int nyears) const = 0;
00172
00180 virtual QDate addMonths(const QDate & date, int nmonths) const = 0;
00181
00189 virtual QDate addDays(const QDate & date, int ndays) const = 0;
00190
00197 virtual int monthsInYear (const QDate & date) const = 0;
00198
00205 virtual int daysInYear (const QDate & date) const = 0;
00206
00213 virtual int daysInMonth (const QDate & date) const = 0;
00214
00221 virtual int weeksInYear(int year) const = 0;
00222
00230 virtual int weekNumber(const QDate& date, int * yearNum = 0) const = 0;
00231
00241 virtual QString monthName (int month, int year, bool shortName = false) const = 0;
00242
00250 virtual QString monthName (const QDate & date, bool shortName = false ) const = 0;
00251
00264 virtual QString monthNamePossessive(int month, int year, bool shortName = false) const = 0;
00265
00276 virtual QString monthNamePossessive(const QDate & date, bool shortName = false) const = 0;
00277
00286 virtual QString weekDayName (int weekDay, bool shortName = false) const = 0;
00287
00295 virtual QString weekDayName (const QDate & date, bool shortName = false) const = 0;
00296
00303 virtual int minValidYear () const = 0;
00304
00311 virtual int maxValidYear () const = 0;
00312
00318 virtual int weekDayOfPray () const = 0;
00319
00323 virtual QString calendarName() const = 0;
00324
00330 virtual bool isLunar() const = 0;
00331
00337 virtual bool isLunisolar() const = 0;
00338
00344 virtual bool isSolar() const = 0;
00345
00346 protected:
00351 const KLocale * locale() const;
00352
00353 private:
00354 KCalendarSystemPrivate * d;
00355 };
00356
00357 #endif