KDECore
kcalendarsystemjalali_p.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2002-2003 Arash Bijanzadeh and FarsiKDE Project <www.farsikde.org> 00003 Contact: Arash Bijanzadeh <a.bijanzadeh@linuxiran.org> 00004 Copyright 2007, 2010 John Layt <john@layt.net> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KCALENDARSYSTEMJALALI_H 00023 #define KCALENDARSYSTEMJALALI_H 00024 00025 #include "kcalendarsystem.h" 00026 00027 class KCalendarSystemJalaliPrivate; 00028 00032 class KCalendarSystemJalali : public KCalendarSystem 00033 { 00034 public: 00035 explicit KCalendarSystemJalali( const KLocale * locale = 0 ); 00036 explicit KCalendarSystemJalali( const KSharedConfig::Ptr config, const KLocale *locale = 0 ); 00037 virtual ~KCalendarSystemJalali(); 00038 00039 virtual QString calendarType() const; 00040 00041 virtual QDate epoch() const; 00042 virtual QDate earliestValidDate() const; 00043 virtual QDate latestValidDate() const; 00044 virtual bool isValid( int year, int month, int day ) const; 00045 virtual bool isValid( const QDate &date ) const; 00046 00047 virtual bool setDate( QDate &date, int year, int month, int day ) const; 00049 virtual bool setYMD( QDate &date, int year, int month, int day ) const; 00050 00051 virtual int year( const QDate &date ) const; 00052 virtual int month( const QDate &date ) const; 00053 virtual int day( const QDate &date ) const; 00054 00055 virtual QDate addYears( const QDate &date, int nyears ) const; 00056 virtual QDate addMonths( const QDate &date, int nmonths ) const; 00057 virtual QDate addDays( const QDate &date, int ndays ) const; 00058 00059 virtual int monthsInYear( const QDate &date ) const; 00060 virtual int weeksInYear( const QDate &date ) const; 00061 virtual int weeksInYear( int year ) const; 00062 virtual int daysInYear( const QDate &date ) const; 00063 virtual int daysInMonth( const QDate &date ) const; 00064 virtual int daysInWeek( const QDate &date ) const; 00065 00066 virtual int dayOfYear( const QDate &date ) const; 00067 virtual int dayOfWeek( const QDate &date ) const; 00068 00069 virtual int weekNumber( const QDate &date, int *yearNum = 0 ) const; 00070 00071 virtual bool isLeapYear( int year ) const; 00072 virtual bool isLeapYear( const QDate &date ) const; 00073 00074 virtual QString monthName( int month, int year, MonthNameFormat format = LongName ) const; 00075 virtual QString monthName( const QDate &date, MonthNameFormat format = LongName ) const; 00076 00077 virtual QString weekDayName( int weekDay, WeekDayNameFormat format = LongDayName ) const; 00078 virtual QString weekDayName( const QDate &date, WeekDayNameFormat format = LongDayName ) const; 00079 00080 virtual QString yearString( const QDate & pDate, StringFormat format = LongFormat ) const; 00081 virtual QString monthString( const QDate &pDate, StringFormat format = LongFormat ) const; 00082 virtual QString dayString( const QDate &pDate, StringFormat format = LongFormat ) const; 00083 00084 virtual int yearStringToInteger( const QString &sNum, int &iLength ) const; 00085 virtual int monthStringToInteger( const QString &sNum, int &iLength ) const; 00086 virtual int dayStringToInteger( const QString &sNum, int &iLength ) const; 00087 00088 virtual QString formatDate( const QDate &fromDate, KLocale::DateFormat toFormat = KLocale::LongDate ) const; 00089 00090 virtual QDate readDate( const QString &str, bool *ok = 0 ) const; 00091 virtual QDate readDate( const QString &dateString, const QString &dateFormat, bool *ok = 0 ) const; 00092 virtual QDate readDate( const QString &str, KLocale::ReadDateFlags flags, bool *ok = 0 ) const; 00093 00094 virtual int weekStartDay() const; 00095 virtual int weekDayOfPray () const; 00096 00097 virtual bool isLunar() const; 00098 virtual bool isLunisolar() const; 00099 virtual bool isSolar() const; 00100 virtual bool isProleptic() const; 00101 00102 protected: 00103 virtual bool julianDayToDate( int jd, int &year, int &month, int &day ) const; 00104 virtual bool dateToJulianDay( int year, int month, int day, int &jd ) const; 00105 KCalendarSystemJalali( KCalendarSystemJalaliPrivate &dd, 00106 const KSharedConfig::Ptr config = KSharedConfig::Ptr(), 00107 const KLocale *locale = 0 ); 00108 00109 private: 00110 Q_DECLARE_PRIVATE( KCalendarSystemJalali ) 00111 KCalendarSystemJalaliPrivate * const dont_use; // KDE5 remove, use shared d 00112 }; 00113 00114 #endif // KCALENDARSYSTEMJALALI_H
KDE 4.6 API Reference