File indexing completed on 2025-01-05 04:49:35

0001 /*
0002   This file is part of KOrganizer.
0003 
0004   SPDX-FileCopyrightText: 2003 Jonathan Singer <jsinger@leeta.net>
0005   SPDX-FileCopyrightText: 2007 Loïc Corbasson <loic.corbasson@gmail.com>
0006 
0007   Calendar routines from Hebrew Calendar by Frank Yellin.
0008   Based on some GNU Emacs code (lisp/calendar/cal-hebrew.el),
0009   SPDX-FileCopyrightText: 1995, 1997 Free Software Foundation, Inc.
0010   SPDX-FileContributor: Nachum Dershowitz <nachum@cs.uiuc.edu>
0011   SPDX-FileContributor: Edward M. Reingold <reingold@cs.uiuc.edu>
0012 
0013   SPDX-License-Identifier: GPL-2.0-or-later
0014 */
0015 
0016 #pragma once
0017 
0018 #include "converter.h"
0019 
0020 #include <QStringList>
0021 
0022 /**
0023   @author Jonathan Singer
0024 */
0025 class Holiday
0026 {
0027 public:
0028     /**
0029       Given a day of a Hebrew month, figures out all the interesting holidays
0030       that correspond to that date.
0031       @p showParsha, @p showOmer, and @p showChol determine respectively whether
0032       we should give information about the Parsha of the week, the Sfira, and
0033       Chol Hamoed.
0034 
0035       We are also influenced by the @p useIsraelSettings flag, which determines
0036       whether we will use the settings corresponding to Israel or to the
0037       diaspora.
0038     */
0039     static QStringList findHoliday(const HebrewDate &hd, bool useIsraelSettings, bool showParsha, bool showChol, bool showOmer);
0040 
0041 private:
0042     /**
0043       Return a string corresponding to the nth day of the Omer (the seven weeks
0044       from the end of Passover to Shavuot).
0045     */
0046     static QString sfirah(int);
0047 
0048     enum HebrewMonths {
0049         Nissan = 1,
0050         Iyar = 2,
0051         Sivan = 3,
0052         Tamuz = 4,
0053         Ab = 5,
0054         Elul = 6,
0055         Tishrei = 7,
0056         Cheshvan = 8,
0057         Kislev = 9,
0058         Tevet = 10,
0059         Shvat = 11,
0060         Adar = 12,
0061         AdarII = 13,
0062         AdarI = 12,
0063     };
0064 
0065     static QStringList findHoliday(int month,
0066                                    int day,
0067                                    int weekday,
0068                                    int kvia,
0069                                    bool leap_year_p,
0070                                    bool useIsraelSettings,
0071                                    int day_number,
0072                                    int year,
0073                                    bool showParsha,
0074                                    bool showChol,
0075                                    bool showOmer);
0076 };