72867c53e4a3b28674be6581be1f471fa840a54a
[lichviet] / lunarcalendar.h
1 /*
2 Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>
16 */
17
18
19 #ifndef LUNARCALENDAR_H
20 #define LUNARCALENDAR_H
21
22 #include <QtCore/QObject>
23
24 class LunarCalendar : public QObject
25 {
26     Q_OBJECT
27
28     int curDayA;
29     int curMonthA;
30     int curYearA;
31
32     int jdn();
33
34 public:
35     explicit LunarCalendar(QObject *parent = 0);
36
37      Q_INVOKABLE QString nextDay();
38      Q_INVOKABLE QString prevDay();
39
40      Q_INVOKABLE int curDay();
41      Q_INVOKABLE int curMonth();
42      Q_INVOKABLE int curYear();
43
44     Q_INVOKABLE int curHour();
45         Q_INVOKABLE int curMinute();
46
47         Q_INVOKABLE void reset(int,int,int);
48
49        Q_INVOKABLE int calDays(int, int);
50
51
52 signals:
53
54 public slots:
55
56 };
57
58 #endif // LUNARCALENDAR_H