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

0001 /*
0002     Copyright (C) 2002-2003 Arash Bijanzadeh  and FarsiKDE Project <www.farsikde.org>
0003     Contact: Arash Bijanzadeh <a.bijanzadeh@linuxiran.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 KCALENDARSYSTEMJALALI_H
0023 #define KCALENDARSYSTEMJALALI_H
0024 
0025 #include "kcalendarsystem.h"
0026 
0027 class KCalendarSystemJalaliPrivate;
0028 
0029 /**
0030  Jalali calendar type implementation
0031 */
0032 class KCalendarSystemJalali : public KCalendarSystem
0033 {
0034 public:
0035     KDELIBS4SUPPORT_DEPRECATED explicit KCalendarSystemJalali(const KSharedConfig::Ptr config, const KLocale *locale);
0036     ~KCalendarSystemJalali() override;
0037 
0038     QString calendarType() const override;
0039     KLocale::CalendarSystem calendarSystem() const override;
0040 
0041     QDate epoch() const override;
0042     QDate earliestValidDate() const override;
0043     QDate latestValidDate() const override;
0044 
0045     QString monthName(int month, int year, MonthNameFormat format = LongName) const override;
0046     QString monthName(const QDate &date, MonthNameFormat format = LongName) const override;
0047 
0048     QString weekDayName(int weekDay, WeekDayNameFormat format = LongDayName) const override;
0049     QString weekDayName(const QDate &date, WeekDayNameFormat format = LongDayName) const override;
0050 
0051     bool isLunar() const override;
0052     bool isLunisolar() const override;
0053     bool isSolar() const override;
0054     bool isProleptic() const override;
0055 
0056 protected:
0057     bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const override;
0058     bool dateToJulianDay(int year, int month, int day, qint64 &jd) const override;
0059     KCalendarSystemJalali(KCalendarSystemJalaliPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
0060 
0061 private:
0062     Q_DECLARE_PRIVATE(KCalendarSystemJalali)
0063 };
0064 
0065 #endif // KCALENDARSYSTEMJALALI_H