1 /*
2     SPDX-FileCopyrightText: 2008 Jason Harris <kstars@30doradus.org>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QDialog>
10 #include <QMutex>
11 
12 #include "ui_skycalendar.h"
13 
14 class GeoLocation;
15 
16 class SkyCalendarUI : public QFrame, public Ui::SkyCalendar
17 {
18     Q_OBJECT
19 
20   public:
21     explicit SkyCalendarUI(QWidget *p = nullptr);
22 };
23 
24 /**
25  * @class SkyCalendar
26  *
27  * Draws Rise/Set/Transit curves for major solar system planets for any calendar year.
28  */
29 class SkyCalendar : public QDialog
30 {
31     Q_OBJECT
32 
33     friend class CalendarWidget;
34 
35   public:
36     explicit SkyCalendar(QWidget *parent = nullptr);
37     ~SkyCalendar() = default;
38 
39     int year();
40     GeoLocation *get_geo();
41 
42   public slots:
43     void slotFillCalendar();
44     void slotPrint();
45     void slotLocation();
46     //void slotCalculating();
47 
48   private:
49     void addPlanetEvents(int nPlanet);
50     void drawEventLabel(float x1, float y1, float x2, float y2, QString LabelText);
51 
52     SkyCalendarUI *scUI { nullptr };
53     GeoLocation *geo { nullptr };
54     QMutex calculationMutex;
55     QString plotButtonText;
56     bool calculating { false };
57 };
58