kcalendarsystemgregorian.h
/*
Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
Copyright (c) 2002 Hans Petter Bieker <bieker@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KCALENDARSYSTEMGREGORIAN_H
#define KCALENDARSYSTEMGREGORIAN_H
#include <qdatetime.h>
#include <qstring.h>
#include "kcalendarsystem.h"
class KCalendarSystemGregorianPrivate;
class KDECORE_EXPORT KCalendarSystemGregorian: public KCalendarSystem
{
public:
KCalendarSystemGregorian (const KLocale * locale = 0);
virtual ~KCalendarSystemGregorian ();
virtual int year (const QDate & date) const;
virtual int month (const QDate & date) const;
virtual int day (const QDate & date) const;
virtual int dayOfWeek (const QDate & date) const;
virtual int dayOfYear (const QDate & date) const;
virtual bool setYMD(QDate & date, int y, int m, int d) const;
virtual QDate addYears(const QDate & date, int nyears) const;
virtual QDate addMonths(const QDate & date, int nmonths) const;
virtual QDate addDays(const QDate & date, int ndays) const;
virtual int monthsInYear (const QDate & date) const;
virtual int daysInYear (const QDate & date) const;
virtual int daysInMonth (const QDate & date) const;
virtual int weeksInYear(int year) const;
virtual int weekNumber(const QDate& date, int * yearNum = 0) const;
virtual int yearStringToInteger(const QString & sNum, int & iLength) const;
virtual QString monthName (int month, int year, bool shortName = false) const;
virtual QString monthName (const QDate & date, bool shortName = false ) const;
virtual QString monthNamePossessive(int month, int year, bool shortName = false) const;
virtual QString monthNamePossessive(const QDate & date, bool shortName = false ) const;
virtual QString weekDayName (int weekDay, bool shortName = false) const;
virtual QString weekDayName (const QDate & date, bool shortName = false) const;
virtual int minValidYear () const;
virtual int maxValidYear () const;
virtual int weekDayOfPray () const;
virtual QString calendarName() const;
virtual bool isLunar() const;
virtual bool isLunisolar() const;
virtual bool isSolar() const;
private:
KCalendarSystemGregorianPrivate * d;
};
#endif
KCalendarSystem::daysInMonth
virtual int daysInMonth(const QDate &date) const =0
Gets specific calendar type number of days in month for a given date.
KCalendarSystem::daysInYear
virtual int daysInYear(const QDate &date) const =0
Gets the number of days in date whose years specified.
KCalendarSystem::month
virtual int month(const QDate &date) const =0
Gets specific calendar type month for a given gregorian date.
KCalendarSystem::addYears
virtual QDate addYears(const QDate &date, int nyears) const =0
Returns a QDate object containing a date nyears later.
KCalendarSystem::weekDayName
virtual QString weekDayName(int weekDay, bool shortName=false) const =0
Gets specific calendar type week day name If an invalid week day is specified, QString::null is retur...
Definition: kcalendarsystem.cpp:119
KCalendarSystem::maxValidYear
virtual int maxValidYear() const =0
Gets the maximum year value supported by specific calendar type algorithms (QDate, 8000)
KCalendarSystem::isLunar
virtual bool isLunar() const =0
Gets if the calendar is lunar based.
KCalendarSystem::dayOfWeek
virtual int dayOfWeek(const QDate &date) const =0
Gets specific calendar type number of day of week number for a given date.
KCalendarSystem::monthNamePossessive
virtual QString monthNamePossessive(int month, int year, bool shortName=false) const =0
Returns a string containing the possessive form of the month name.
KCalendarSystem::addDays
virtual QDate addDays(const QDate &date, int ndays) const =0
Returns a QDate object containing a date ndays later.
KCalendarSystem::monthsInYear
virtual int monthsInYear(const QDate &date) const =0
Gets specific calendar type number of month for a given year.
KCalendarSystem
CalendarSystem abstract class, default derived kde gregorian class and factory class.
Definition: kcalendarsystem.h:42
KCalendarSystem::dayOfYear
virtual int dayOfYear(const QDate &date) const =0
Gets specific calendar type day number of year for a given date.
KCalendarSystem::calendarName
virtual QString calendarName() const =0
Gets the string representing the calendar.
KCalendarSystem::monthName
virtual QString monthName(int month, int year, bool shortName=false) const =0
Gets specific calendar type month name for a given month number If an invalid month is specified...
KCalendarSystem::weekNumber
virtual int weekNumber(const QDate &date, int *yearNum=0) const =0
Gets specific calendar type week number for a given date.
KCalendarSystem::day
virtual int day(const QDate &date) const =0
Gets specific calendar type day number of month for a given date.
KCalendarSystem::weeksInYear
virtual int weeksInYear(int year) const =0
Gets the number of weeks in a specified year.
KCalendarSystem::yearStringToInteger
virtual int yearStringToInteger(const QString &sNum, int &iLength) const
Converts a year literal of a part of a string into a integer starting at the beginning of the string...
Definition: kcalendarsystem.cpp:114
KCalendarSystem::minValidYear
virtual int minValidYear() const =0
Gets the first year value supported by specific calendar type algorithms.
KLocale
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:124
KCalendarSystem::addMonths
virtual QDate addMonths(const QDate &date, int nmonths) const =0
Returns a QDate object containing a date nmonths later.
KCalendarSystem::isLunisolar
virtual bool isLunisolar() const =0
Gets if the calendar is lunisolar based.
KCalendarSystem::weekDayOfPray
virtual int weekDayOfPray() const =0
Gets the day of the week traditionaly associated with pray.
KCalendarSystem::year
virtual int year(const QDate &date) const =0
Gets specific calendar type year for a given gregorian date.
KCalendarSystem::isSolar
virtual bool isSolar() const =0
Gets if the calendar is solar based.
KCalendarSystem::setYMD
virtual bool setYMD(QDate &date, int y, int m, int d) const =0
Changes the date's year, month and day.

KDE Home | KDE Accessibility Home | Description of Access Keys