summaryrefslogtreecommitdiffabout
path: root/microkde/kcalendarsystemgregorian.h
Unidiff
Diffstat (limited to 'microkde/kcalendarsystemgregorian.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kcalendarsystemgregorian.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/microkde/kcalendarsystemgregorian.h b/microkde/kcalendarsystemgregorian.h
new file mode 100644
index 0000000..2eff625
--- a/dev/null
+++ b/microkde/kcalendarsystemgregorian.h
@@ -0,0 +1,90 @@
1/*
2 Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
3 Copyright (c) 2002 Hans Petter Bieker <bieker@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef KCALENDARSYSTEMGREGORIAN_H
22#define KCALENDARSYSTEMGREGORIAN_H
23
24#include <qdatetime.h>
25#include <qstring.h>
26
27#include "kcalendarsystem.h"
28
29class KCalendarSystemGregorianPrivate;
30
31/**
32 * This is the Gregorian calendar implementation.
33 *
34 * The Gregorian calender is the most used calendar today. The first year in
35 * the calendar is set to the birth of Christ.
36 *
37 * @see KLocale,KCalendarSystem,KCalendarSystemFactory
38 *
39 * @author Carlos Moro <cfmoro@correo.uniovi.es>
40 * @licence GNU-GPL v.2
41 * @version $Id$
42 * @since 3.2
43 */
44class KCalendarSystemGregorian: public KCalendarSystem
45{
46public:
47 KCalendarSystemGregorian (const KLocale * locale = 0);
48 virtual ~KCalendarSystemGregorian ();
49
50 virtual int year (const QDate & date) const;
51 virtual int month (const QDate & date) const;
52 virtual int day (const QDate & date) const;
53 virtual int dayOfWeek (const QDate & date) const;
54 virtual int dayOfYear (const QDate & date) const;
55
56 virtual bool setYMD(QDate & date, int y, int m, int d) const;
57
58 virtual QDate addYears(const QDate & date, int nyears) const;
59 virtual QDate addMonths(const QDate & date, int nmonths) const;
60 virtual QDate addDays(const QDate & date, int ndays) const;
61
62 virtual int monthsInYear (const QDate & date) const;
63
64 virtual int daysInYear (const QDate & date) const;
65 virtual int daysInMonth (const QDate & date) const;
66 virtual int weeksInYear(int year) const;
67 virtual int weekNumber(const QDate& date, int * yearNum = 0) const;
68
69 virtual QString monthName (int month, bool shortName = false) const;
70 virtual QString monthName (const QDate & date, bool shortName = false ) const;
71 virtual QString monthNamePossessive(int month, bool shortName = false) const;
72 virtual QString monthNamePossessive(const QDate & date, bool shortName = false ) const;
73 virtual QString weekDayName (int weekDay, bool shortName = false) const;
74 virtual QString weekDayName (const QDate & date, bool shortName = false) const;
75
76 virtual int minValidYear () const;
77 virtual int maxValidYear () const;
78 virtual int weekDayOfPray () const;
79
80 virtual QString calendarName() const;
81
82 virtual bool isLunar() const;
83 virtual bool isLunisolar() const;
84 virtual bool isSolar() const;
85
86private:
87 KCalendarSystemGregorianPrivate * d;
88};
89
90#endif