File indexing completed on 2023-10-03 03:16:20
0001 /* 0002 Copyright (c) 2002 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 0006 This library is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU Library General Public 0008 License as published by the Free Software Foundation; either 0009 version 2 of the License, or (at your option) any later version. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Library General Public License for more details. 0015 0016 You should have received a copy of the GNU Library General Public License 0017 along with this library; see the file COPYING.LIB. If not, write to 0018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 Boston, MA 02110-1301, USA. 0020 */ 0021 0022 #ifndef KCALENDARSYSTEMISLAMICCIVIL_H 0023 #define KCALENDARSYSTEMISLAMICCIVIL_H 0024 0025 #include "kcalendarsystem.h" 0026 0027 class KCalendarSystemIslamicCivilPrivate; 0028 0029 /** 0030 * @internal 0031 * This is the Islamic Civil calendar implementation. 0032 * 0033 * The Islamic or Hijri calendar is the traditional calendar used in the Middle 0034 * East. This implementation is of the civil calculation that does not take 0035 * observed sunset into account and so may vary from actual dates by 1-2 days. 0036 * 0037 * @b license GNU-LGPL v2+ 0038 * 0039 * @see KLocale,KCalendarSystem 0040 * 0041 * @author Carlos Moro <cfmoro@correo.uniovi.es> 0042 */ 0043 class KCalendarSystemIslamicCivil : public KCalendarSystem 0044 { 0045 public: 0046 KDELIBS4SUPPORT_DEPRECATED explicit KCalendarSystemIslamicCivil(const KSharedConfig::Ptr config, const KLocale *locale); 0047 ~KCalendarSystemIslamicCivil() override; 0048 0049 QString calendarType() const override; 0050 KLocale::CalendarSystem calendarSystem() const override; 0051 0052 QDate epoch() const override; 0053 QDate earliestValidDate() const override; 0054 QDate latestValidDate() const override; 0055 0056 QString monthName(int month, int year, MonthNameFormat format = LongName) const override; 0057 QString monthName(const QDate &date, MonthNameFormat format = LongName) const override; 0058 0059 QString weekDayName(int weekDay, WeekDayNameFormat format = LongDayName) const override; 0060 QString weekDayName(const QDate &date, WeekDayNameFormat format = LongDayName) 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 jd, int &year, int &month, int &day) const override; 0069 bool dateToJulianDay(int year, int month, int day, qint64 &jd) const override; 0070 KCalendarSystemIslamicCivil(KCalendarSystemIslamicCivilPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale); 0071 0072 private: 0073 Q_DECLARE_PRIVATE(KCalendarSystemIslamicCivil) 0074 }; 0075 0076 #endif // KCALENDARSYSTEMISLAMICCIVIL_H