File indexing completed on 2024-04-21 14:55:28

0001 /*
0002     Copyright (c) 2002-2003 Carlos Moro <cfmoro@correo.uniovi.es>
0003     Copyright (c) 2002-2003 Hans Petter Bieker <bieker@kde.org>
0004     Copyright 2007, 2010 John Layt <john@layt.net>
0005         Calendar conversion routines based on Hdate v6, by Amos
0006         Shapir 1978 (rev. 1985, 1992)
0007 
0008     This library is free software; you can redistribute it and/or
0009     modify it under the terms of the GNU Library General Public
0010     License as published by the Free Software Foundation; either
0011     version 2 of the License, or (at your option) any later version.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Library General Public License for more details.
0017 
0018     You should have received a copy of the GNU Library General Public License
0019     along with this library; see the file COPYING.LIB.  If not, write to
0020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0021     Boston, MA 02110-1301, USA.
0022 */
0023 
0024 #ifndef KCALENDARSYSTEMHEBREW_H
0025 #define KCALENDARSYSTEMHEBREW_H
0026 
0027 #include "kcalendarsystem.h"
0028 
0029 class KCalendarSystemHebrewPrivate;
0030 
0031 /**
0032  * @internal
0033  * This is the Hebrew calendar implementation.
0034  *
0035  * The Hebrew calendar is the traditional calendar used by the Jewish faith
0036  *
0037  * @see KLocale,KCalendarSystem,KCalendarSystemFactory
0038  *
0039  * @author Hans Petter Bieker <bieker@kde.org>
0040  */
0041 class KCalendarSystemHebrew : public KCalendarSystem
0042 {
0043 public:
0044     KDELIBS4SUPPORT_DEPRECATED explicit KCalendarSystemHebrew(const KSharedConfig::Ptr config, const KLocale *locale);
0045     ~KCalendarSystemHebrew() override;
0046 
0047     QString calendarType() const override;
0048     KLocale::CalendarSystem calendarSystem() const override;
0049 
0050     QDate epoch() const override;
0051     QDate earliestValidDate() const override;
0052     QDate latestValidDate() const override;
0053 
0054     QString monthName(int month, int year, MonthNameFormat format = LongName) const override;
0055     QString monthName(const QDate &date, MonthNameFormat format = LongName) const override;
0056 
0057     QString weekDayName(int weekDay, WeekDayNameFormat format = LongDayName) const override;
0058     QString weekDayName(const QDate &date, WeekDayNameFormat format = LongDayName) const override;
0059 
0060     int yearStringToInteger(const QString &sNum, int &iLength) const override;
0061 
0062     bool isLunar() const override;
0063     bool isLunisolar() const override;
0064     bool isSolar() const override;
0065     bool isProleptic() const override;
0066 
0067 protected:
0068     bool julianDayToDate(qint64 js, int &year, int &month, int &day) const override;
0069     bool dateToJulianDay(int year, int month, int day, qint64 &jd) const override;
0070     KCalendarSystemHebrew(KCalendarSystemHebrewPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
0071 
0072 private:
0073     Q_DECLARE_PRIVATE(KCalendarSystemHebrew)
0074 };
0075 
0076 #endif // KCALENDARSYSTEMHEBREW_H