Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / i18npool / inc / calendar_hijri.hxx
blob240cc7b200955ea929329ae95ccc3acc8a68abd1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_I18NPOOL_INC_CALENDAR_HIJRI_HXX
20 #define INCLUDED_I18NPOOL_INC_CALENDAR_HIJRI_HXX
22 #include "calendar_gregorian.hxx"
25 // class Calendar_hijri
28 namespace i18npool {
30 class Calendar_hijri : public Calendar_gregorian
32 public:
34 // Constructors
35 Calendar_hijri();
37 protected:
38 void mapToGregorian() override;
39 void mapFromGregorian() override;
41 // radians per degree (pi/180)
42 static const double RadPerDeg;
44 // Synodic Period (mean time between 2 successive new moon: 29d, 12 hr, 44min, 3sec
45 static const double SynPeriod;
47 static const double SynMonth; // Solar days in a year/SynPeriod
49 // Julian day on Jan 1, 1900
50 static const double jd1900;
52 // Reference point: September 1984 25d 3h 10m UT. == 1405 Hijri == 1048 Synodial month from 1900
53 static const sal_Int32 SynRef;
54 static const sal_Int32 GregRef;
56 // Local time (Saudi Arabia)
57 static const double SA_TimeZone; // Time Zone
59 // Period between 1.30pm - 6:30pm
60 static const double EveningPeriod;
62 // "Leap" years
63 static const sal_Int32 LeapYear[];
65 private:
66 static double NewMoon(sal_Int32 n);
67 static void getHijri(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year);
68 static void ToGregorian(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year);
69 static void getGregorianDay(sal_Int32 jd, sal_Int32 *pnDay, sal_Int32 *pnMonth, sal_Int32 *pnYear);
70 static sal_Int32 getJulianDay(sal_Int32 day, sal_Int32 month, sal_Int32 year);
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */