File indexing completed on 2024-05-05 05:38:23
0001 /* 0002 SPDX-FileCopyrightText: 2017 Roman Gilg <subdiff@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #pragma once 0007 0008 #include <QDate> 0009 #include <QObject> 0010 #include <QPair> 0011 #include <QTime> 0012 #include <QVariant> 0013 0014 #include <qqmlregistration.h> 0015 0016 #include "colorcorrect_export.h" 0017 0018 namespace ColorCorrect 0019 { 0020 /* 0021 * The purpose of this class is solely to enable workspace to present the 0022 * resulting timings of the current or requested configuration to the user. 0023 * The final calculations happen in similar functions in the compositor. 0024 * 0025 * The functions provided by this class here therefore needs to be hold in 0026 * sync with the functions in the compositor. 0027 */ 0028 0029 class COLORCORRECT_EXPORT SunCalc : public QObject 0030 { 0031 Q_OBJECT 0032 QML_ELEMENT 0033 0034 public: 0035 /** 0036 * Calculates for a given location and date two of the 0037 * following sun timings in their temporal order: 0038 * - Nautical dawn and sunrise for the morning 0039 * - Sunset and nautical dusk for the evening 0040 * @since 5.12 0041 **/ 0042 Q_INVOKABLE QVariantMap getMorningTimings(double latitude, double longitude); 0043 Q_INVOKABLE QVariantMap getEveningTimings(double latitude, double longitude); 0044 }; 0045 0046 }