diff options
author | Soroush Rabiei <soroush@ametisco.ir> | 2019-08-08 20:15:09 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-08-21 22:18:45 +0200 |
commit | 3e771a8b09cd5e46c4aff0e8bd28b946dd4e3fa5 (patch) | |
tree | dbb63086372aba40b5a7ad7ee46ee776bbea6f8c /src/corelib/time/qmilankoviccalendar_p.h | |
parent | 6743b174c036b7ad79cf55e98c917e9a5f4e19ef (diff) |
Add support for Julian and Milankovic calendars
These share their locale data with the Gregorian calendar, making them
virtually free to add. Still leave them out of the boot-strap build,
though.
[ChangeLog][QtCore][QCalendar] Added support for Julian and Milankovic
calendars. These are enabled by default, except in bootstrap builds.
Change-Id: I585045ed9e78c1e959957f6772b3e144093b701c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/time/qmilankoviccalendar_p.h')
-rw-r--r-- | src/corelib/time/qmilankoviccalendar_p.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/corelib/time/qmilankoviccalendar_p.h b/src/corelib/time/qmilankoviccalendar_p.h new file mode 100644 index 0000000000..ebff7e7f39 --- /dev/null +++ b/src/corelib/time/qmilankoviccalendar_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMILANKOVICCALENDAR_CALENDAR_P_H +#define QMILANKOVICCALENDAR_CALENDAR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of calendar implementations. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qromancalendar_p.h" + +QT_BEGIN_NAMESPACE + +class Q_CORE_EXPORT QMilankovicCalendar : public QRomanCalendar +{ +public: + QMilankovicCalendar(); + // Calendar properties: + QString name() const override; + QCalendar::System calendarSystem() const override; + // Date queries: + bool isLeapYear(int year) const override; + // Julian Day conversions: + bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override; + QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override; +}; + +QT_END_NAMESPACE + +#endif // QMILANKOVICCALENDAR_CALENDAR_P_H |