-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmhdate.h
More file actions
87 lines (61 loc) · 2.18 KB
/
Copy pathmhdate.h
File metadata and controls
87 lines (61 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Moshe Wagner. <moshe.wagner@gmail.com>
*/
/*
Simple class I wrote that improves the basic Hdate class.
It adds safe date movments, taking leap months and years into account.
It also emmits a "month_changed()" Signall every time a month was changed, directly or indirectly.
*/
#ifndef MHDATE_H
#define MHDATE_H
#include <QtWidgets/QMainWindow>
#include <QtCore/QObject>
#include <hdatepp.h>
#include "functions.h"
class mHdate : public QObject, public hdate::Hdate
{
Q_OBJECT
public:
mHdate();
//mHdate(Hdate *d);
void removeDay();
void addDay();
void removeMonth();
void addMonth();
//Goes back the given number of years (default 1)
void removeYear(int i=1);
//Goes forward the given number of years (default 1)
void addYear(int i=1);
//Sets the hebrew date
void set_hd(int hd, int hm, int hy);
//Returns the Hebrew date's month length (29 or 30)
int getMonthLength();
//Return The day in the omer, starting from 1
int getOmerDay();
bool isErevYomTov(bool hool);
bool isYomTov(bool hool);
//Returns the holiday type (see inside for details)
int holidayType();
//Function to replace 'get_hebrew_day_string' because the real one has a bug in some versions,
// and to force a always-hebrew result.
// Returns a QString with the string representing the hebrew day of the month
QString hebday();
signals:
//Emmited every time a month was changed, directly or indirectly.
void month_changed();
private:
int month_length;
};
#endif // MHDATE_H