//
//     Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2007 Jim Bublitz also apply

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 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 General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.


class KCalendarSystem
{
%TypeHeaderCode
#include <kcalendarsystem.h>
%End


public:

    enum StringFormat
    {
        ShortFormat,
        LongFormat
    };


    enum MonthNameFormat
    {
        ShortName,
        LongName,
        ShortNamePossessive,
        LongNamePossessive
    };


    enum WeekDayNameFormat
    {
        ShortDayName,
        LongDayName
    };

    static KCalendarSystem*  create (const QString& calType = QLatin1String("gregorian"), const KLocale* locale = 0);
    static QStringList      calendarSystems ();
    static QString          calendarLabel (const QString& calendarType);
    explicit                KCalendarSystem (const KLocale* locale = 0);
    virtual QString         calendarType () const = 0;
    virtual QDate           epoch () const;
    virtual QDate           earliestValidDate () const;
    virtual QDate           latestValidDate () const;
    virtual bool            isValid (int year, int month, int day) const = 0;
    virtual bool            isValid (const QDate& date) const;
    virtual bool            setDate (QDate& date, int year, int month, int day) const;
    virtual bool            setYMD (QDate& date, int y, int m, int d) const;
    virtual int             year (const QDate& date) const;
    virtual int             month (const QDate& date) const;
    virtual int             day (const QDate& date) 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             weeksInYear (const QDate& date) const;
    virtual int             weeksInYear (int year) const;
    virtual int             daysInYear (const QDate& date) const;
    virtual int             daysInMonth (const QDate& date) const;
    virtual int             daysInWeek (const QDate& date) const;
    virtual int             dayOfYear (const QDate& date) const;
    virtual int             dayOfWeek (const QDate& date) const;
    virtual int             weekNumber (const QDate& date, int* yearNum /In, Out/ = 0) const;
    virtual bool            isLeapYear (int year) const = 0;
    virtual bool            isLeapYear (const QDate& date) const;
    virtual QString         monthName (int month, int year, KCalendarSystem::MonthNameFormat format = KCalendarSystem::LongName) const = 0;
    virtual QString         monthName (const QDate& date, KCalendarSystem::MonthNameFormat format = KCalendarSystem::LongName) const;
    virtual QString         weekDayName (int weekDay, KCalendarSystem::WeekDayNameFormat format = KCalendarSystem::LongDayName) const = 0;
    virtual QString         weekDayName (const QDate& date, KCalendarSystem::WeekDayNameFormat format = KCalendarSystem::LongDayName) const;
    virtual QString         yearString (const QDate& date, KCalendarSystem::StringFormat format = KCalendarSystem::LongFormat) const;
    virtual QString         monthString (const QDate& pDate, KCalendarSystem::StringFormat format = KCalendarSystem::LongFormat) const;
    virtual QString         dayString (const QDate& pDate, KCalendarSystem::StringFormat format = KCalendarSystem::LongFormat) const;
    virtual int             yearStringToInteger (const QString& sNum, int& iLength /Out/) const;
    virtual int             monthStringToInteger (const QString& sNum, int& iLength /Out/) const;
    virtual int             dayStringToInteger (const QString& sNum, int& iLength /Out/) const;
    virtual QString         formatDate (const QDate& date, KLocale::DateFormat format = KLocale::LongDate) const;
    virtual QDate           readDate (const QString& str, bool* ok /Out/ = 0) const;
    virtual QDate           readDate (const QString& intstr, const QString& format, bool* ok /Out/ = 0) const;
    virtual QDate           readDate (const QString& str, KLocale::ReadDateFlags flags, bool* ok /Out/ = 0) const;
    virtual int             weekStartDay () const;
    virtual int             weekDayOfPray () const = 0;
    virtual bool            isLunar () const = 0;
    virtual bool            isLunisolar () const = 0;
    virtual bool            isSolar () const = 0;
    virtual bool            isProleptic () const = 0;

protected:
    virtual bool            julianDayToDate (int jd, int& year /Out/, int& month /Out/, int& day /Out/) const = 0;
    virtual bool            dateToJulianDay (int year, int month, int day, int& jd /Out/) const = 0;
    const KLocale*          locale () const;

private:
                            KCalendarSystem (const KCalendarSystem&);
};   // KCalendarSystem


