File indexing completed on 2024-04-21 03:44:57

0001 /*
0002     SPDX-FileCopyrightText: 2008 Jason Harris <kstars@30doradus.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QDialog>
0010 #include <QMutex>
0011 
0012 #include "ui_skycalendar.h"
0013 
0014 class GeoLocation;
0015 
0016 class SkyCalendarUI : public QFrame, public Ui::SkyCalendar
0017 {
0018     Q_OBJECT
0019 
0020   public:
0021     explicit SkyCalendarUI(QWidget *p = nullptr);
0022 };
0023 
0024 /**
0025  * @class SkyCalendar
0026  *
0027  * Draws Rise/Set/Transit curves for major solar system planets for any calendar year.
0028  */
0029 class SkyCalendar : public QDialog
0030 {
0031     Q_OBJECT
0032 
0033     friend class CalendarWidget;
0034 
0035   public:
0036     explicit SkyCalendar(QWidget *parent = nullptr);
0037     ~SkyCalendar() = default;
0038 
0039     int year();
0040     GeoLocation *get_geo();
0041 
0042   public slots:
0043     void slotFillCalendar();
0044     void slotPrint();
0045     void slotLocation();
0046     //void slotCalculating();
0047 
0048   private:
0049     void addPlanetEvents(int nPlanet);
0050     void drawEventLabel(float x1, float y1, float x2, float y2, QString LabelText);
0051 
0052     SkyCalendarUI *scUI { nullptr };
0053     GeoLocation *geo { nullptr };
0054     QMutex calculationMutex;
0055     QString plotButtonText;
0056     bool calculating { false };
0057 };