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

0001 /*
0002     Copyright 2010 John Layt <john@layt.net>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License as published by the Free Software Foundation; either
0007     version 2 of the License, or (at your option) any later version.
0008 
0009     This library is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012     Library General Public License for more details.
0013 
0014     You should have received a copy of the GNU Library General Public License
0015     along with this library; see the file COPYING.LIB.  If not, write to
0016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017     Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KCALENDARSYSTEMTHAI_H
0021 #define KCALENDARSYSTEMTHAI_H
0022 
0023 #include "kcalendarsystemgregorian_p.h"
0024 
0025 class KCalendarSystemThaiPrivate;
0026 
0027 /**
0028  * @internal
0029  * This is the Thai calendar implementation which is the Gregorian calendar
0030  * but using a different Epoch
0031  *
0032  * @b license GNU-LGPL v.2 or later
0033  *
0034  * @see KLocale,KCalendarSystem
0035  *
0036  * @author John Layt <john@layt.net>
0037  */
0038 class KCalendarSystemThai: public KCalendarSystemGregorian
0039 {
0040 public:
0041     KDELIBS4SUPPORT_DEPRECATED explicit KCalendarSystemThai(const KSharedConfig::Ptr config, const KLocale *locale);
0042     ~KCalendarSystemThai() override;
0043 
0044     QString calendarType() const override;
0045     KLocale::CalendarSystem calendarSystem() const override;
0046 
0047     QDate epoch() const override;
0048     QDate earliestValidDate() const override;
0049     QDate latestValidDate() 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     KCalendarSystemThai(KCalendarSystemThaiPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
0060 
0061 private:
0062     Q_DECLARE_PRIVATE(KCalendarSystemThai)
0063 };
0064 
0065 #endif // KCALENDARSYSTEMTHAI_H