diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /korganizer/plugins/hebrew/converter.h | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/plugins/hebrew/converter.h')
-rw-r--r-- | korganizer/plugins/hebrew/converter.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/korganizer/plugins/hebrew/converter.h b/korganizer/plugins/hebrew/converter.h new file mode 100644 index 000000000..8a3bc8baf --- /dev/null +++ b/korganizer/plugins/hebrew/converter.h @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (C) 2003 by Jonathan Singer * + * jsinger@leeta.net * + * Calendar routines from Hebrew Calendar by Frank Yellin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef CONVERTER_H +#define CONVERTER_H + +#include <qstring.h> +#include <qstringlist.h> + +struct DateResult +{ + int year; + int month; + int day; + int day_of_week; + + int hebrew_month_length, secular_month_length; + bool hebrew_leap_year_p, secular_leap_year_p; + int kvia; + int hebrew_day_number; +}; + +/** +@author Jonathan Singer +*/ +class Converter +{ +public: + + Converter(); + ~Converter(); + + static bool hebrew_leap_year_p(int year); + static bool gregorian_leap_year_p(int year); + + static long absolute_from_gregorian(int year, int month, int day); + static long absolute_from_hebrew(int year, int month, int day); + + static void gregorian_from_absolute(long date, int *yearp, + int *monthp, int *dayp); + static void hebrew_from_absolute(long date, int *yearp, int *monthp, + int *dayp); + + static int hebrew_months_in_year(int year); + static int hebrew_month_length(int year, int month); + static int secular_month_length(int year, int month); + + static long hebrew_elapsed_days(int year); + static long hebrew_elapsed_days2(int year); + static int hebrew_year_length(int year); + + static void finish_up(long absolute, int hyear, int hmonth, + int syear, int smonth, + struct DateResult *result); + + static void SecularToHebrewConversion(int year, int month, int day, + struct DateResult *result); + static void HebrewToSecularConversion(int year, int month, int day, + struct DateResult *result); + +private: + + static QStringList HebrewMonthNames; + static QStringList SecularMonthNames; + +}; + +#endif |