2 Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
3 Copyright (c) 2002 Hans Petter Bieker <bieker@kde.org>
4 Copyright (c) 2004 Jason Harris <jharris@30doradus.org>
6 This class has been derived from KCalendarSystemGregorian;
7 the changesd made just replace QDate objects with ExtDate objects.
8 These changes by Jason Harris <jharris@30doradus.org>
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA.
26 #ifndef EXTCALENDARSYSTEMGREGORIAN_H
27 #define EXTCALENDARSYSTEMGREGORIAN_H
30 #include "extcalendarsystem.h"
32 class ExtCalendarSystemGregorianPrivate
;
36 * This is the Gregorian calendar implementation.
38 * The Gregorian calender is the most used calendar today. The first year in
39 * the calendar is set to the birth of Christ.
41 * @see KLocale,ExtCalendarSystem,ExtCalendarSystemFactory
43 * @author Carlos Moro <cfmoro@correo.uniovi.es>
44 * @license GNU-GPL v.2
48 class ExtCalendarSystemGregorian
: public ExtCalendarSystem
51 ExtCalendarSystemGregorian (const KLocale
* locale
= 0);
52 virtual ~ExtCalendarSystemGregorian ();
54 virtual int year (const ExtDate
& date
) const;
55 virtual int month (const ExtDate
& date
) const;
56 virtual int day (const ExtDate
& date
) const;
57 virtual int dayOfWeek (const ExtDate
& date
) const;
58 virtual int dayOfYear (const ExtDate
& date
) const;
60 virtual bool setYMD(ExtDate
& date
, int y
, int m
, int d
) const;
62 virtual ExtDate
addYears(const ExtDate
& date
, int nyears
) const;
63 virtual ExtDate
addMonths(const ExtDate
& date
, int nmonths
) const;
64 virtual ExtDate
addDays(const ExtDate
& date
, int ndays
) const;
66 virtual int monthsInYear (const ExtDate
& date
) const;
68 virtual int daysInYear (const ExtDate
& date
) const;
69 virtual int daysInMonth (const ExtDate
& date
) const;
70 virtual int weeksInYear(int year
) const;
71 virtual int weekNumber(const ExtDate
& date
, int * yearNum
= 0) const;
73 virtual int yearStringToInteger(const QString
& sNum
, int & iLength
) const;
75 virtual QString
monthName (int month
, int year
, bool shortName
= false) const;
76 virtual QString
monthName (const ExtDate
& date
, bool shortName
= false ) const;
77 virtual QString
monthNamePossessive(int month
, int year
, bool shortName
= false) const;
78 virtual QString
monthNamePossessive(const ExtDate
& date
, bool shortName
= false ) const;
79 virtual QString
weekDayName (int weekDay
, bool shortName
= false) const;
80 virtual QString
weekDayName (const ExtDate
& date
, bool shortName
= false) const;
82 virtual int minValidYear () const;
83 virtual int maxValidYear () const;
84 virtual int weekDayOfPray () const;
86 virtual QString
calendarName() const;
88 virtual bool isLunar() const;
89 virtual bool isLunisolar() const;
90 virtual bool isSolar() const;
93 ExtCalendarSystemGregorianPrivate
* d
;