kdecore Library API Documentation

kcalendarsystem.h

00001 /*
00002    Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
00003    Copyright (c) 2002-2003 Hans Petter Bieker <bieker@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
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 
00043 class KDECORE_EXPORT KCalendarSystem
00044 {
00045 public:
00051   KCalendarSystem(const KLocale * locale = 0);
00052 
00056   virtual ~KCalendarSystem();
00057 
00064   virtual int year (const QDate & date) const = 0;
00065 
00073   virtual QString yearString(const QDate & pDate, bool bShort) const;
00074 
00082   virtual int yearStringToInteger(const QString & sNum, int & iLength) const;
00083 
00090   virtual int month (const QDate & date) const = 0;
00091 
00099   virtual QString monthString(const QDate & pDate, bool bShort) const;
00100 
00108   virtual int monthStringToInteger(const QString & sNum, int & iLength) const;
00109 
00116   virtual int day (const QDate & date) const = 0;
00117 
00125   virtual QString dayString(const QDate & pDate, bool bShort) const;
00126 
00134   virtual int dayStringToInteger(const QString & sNum, int & iLength) const;
00135 
00143   virtual int dayOfWeek (const QDate & date) const = 0;
00144 
00151   virtual int dayOfYear (const QDate & date) const = 0;
00152 
00163   virtual bool setYMD(QDate & date, int y, int m, int d) const = 0;
00164 
00172   virtual QDate addYears(const QDate & date, int nyears) const = 0;
00173 
00181   virtual QDate addMonths(const QDate & date, int nmonths) const = 0;
00182 
00190   virtual QDate addDays(const QDate & date, int ndays) const = 0;
00191 
00198   virtual int monthsInYear (const QDate & date) const = 0;
00199 
00206   virtual int daysInYear (const QDate & date) const = 0;
00207 
00214   virtual int daysInMonth (const QDate & date) const = 0;
00215 
00222   virtual int weeksInYear(int year) const = 0;
00223 
00231   virtual int weekNumber(const QDate& date, int * yearNum = 0) const = 0;
00232 
00242   virtual QString monthName (int month, int year, bool shortName = false) const = 0;
00243 
00251   virtual QString monthName (const QDate & date, bool shortName = false ) const = 0;
00252 
00265   virtual QString monthNamePossessive(int month, int year, bool shortName = false) const = 0;
00266 
00277   virtual QString monthNamePossessive(const QDate & date, bool shortName = false) const = 0;
00278 
00287   virtual QString weekDayName (int weekDay, bool shortName = false) const = 0;
00288 
00296   virtual QString weekDayName (const QDate & date, bool shortName = false) const = 0;
00297 
00304   virtual int minValidYear () const = 0;
00305 
00312   virtual int maxValidYear () const = 0;
00313 
00319   virtual int weekDayOfPray () const = 0;
00320 
00324   virtual QString calendarName() const = 0;
00325 
00331   virtual bool isLunar() const = 0;
00332 
00338   virtual bool isLunisolar() const = 0;
00339 
00345   virtual bool isSolar() const = 0;
00346 
00347 protected:
00348   const KLocale * locale() const;
00349 
00350 private:
00351   KCalendarSystemPrivate * d;
00352 };
00353 
00354 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:09:38 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003