update dev300-m58
[ooovba.git] / i18npool / inc / calendar_hijri.hxx
blob3455e347cfe635a9729e32c5e4207e4357f60a43
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: calendar_hijri.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _I18N_CALENDAR_HIJRI_HXX_
31 #define _I18N_CALENDAR_HIJRI_HXX_
33 #include "calendar_gregorian.hxx"
36 // ----------------------------------------------------
37 // class Calendar_hijri
38 // ----------------------------------------------------
40 namespace com { namespace sun { namespace star { namespace i18n {
42 class Calendar_hijri : public Calendar_gregorian
44 public:
46 // Constructors
47 Calendar_hijri();
49 protected:
50 void mapToGregorian() throw(com::sun::star::uno::RuntimeException);
51 void mapFromGregorian() throw(com::sun::star::uno::RuntimeException);
53 // radians per degree (pi/180)
54 static const double RadPerDeg;
56 // Synodic Period (mean time between 2 successive new moon: 29d, 12 hr, 44min, 3sec
57 static const double SynPeriod;
59 static const double SynMonth; // Solar days in a year/SynPeriod
61 // Julian day on Jan 1, 1900
62 static const double jd1900;
64 // Reference point: September 1984 25d 3h 10m UT. == 1405 Hijri == 1048 Synodial month from 1900
65 static const sal_Int32 SynRef;
66 static const sal_Int32 GregRef;
68 // Local time (Saudi Arabia)
69 static const double SA_TimeZone; // Time Zone
71 // Period between 1.30pm - 6:30pm
72 static const double EveningPeriod;
74 // "Leap" years
75 static const sal_Int32 LeapYear[];
77 private:
78 double NewMoon(sal_Int32 n);
79 void getHijri(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year);
80 void ToGregorian(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year);
81 void getGregorianDay(sal_Int32 jd, sal_Int32 *pnDay, sal_Int32 *pnMonth, sal_Int32 *pnYear);
82 double getJulianDay(sal_Int32 day, sal_Int32 month, sal_Int32 year);
85 } } } }
87 #endif