Changeset View
Changeset View
Standalone View
Standalone View
colorcorrection/colorcorrectdbusinterface.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright 2017 Roman Gilg <subdiff@gmail.com> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #ifndef KWIN_NIGHTCOLOR_DBUS_INTERFACE_H | ||||
22 | #define KWIN_NIGHTCOLOR_DBUS_INTERFACE_H | ||||
23 | | ||||
24 | #include <QObject> | ||||
25 | #include <QtDBus/QtDBus> | ||||
26 | | ||||
27 | namespace KWin | ||||
28 | { | ||||
29 | | ||||
30 | namespace ColorCorrect | ||||
31 | { | ||||
32 | | ||||
33 | class Manager; | ||||
34 | | ||||
35 | class ColorCorrectDBusInterface : public QObject | ||||
36 | { | ||||
37 | Q_OBJECT | ||||
38 | Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.ColorCorrect") | ||||
39 | | ||||
40 | public: | ||||
41 | explicit ColorCorrectDBusInterface(Manager *parent); | ||||
42 | virtual ~ColorCorrectDBusInterface() = default; | ||||
43 | | ||||
44 | public Q_SLOTS: | ||||
45 | /** | ||||
46 | * @brief Gives information about the current state of Night Color. | ||||
47 | * | ||||
48 | * The returned variant hash has always the fields: | ||||
49 | * - ActiveEnabled | ||||
50 | * - Active | ||||
51 | * - Mode | ||||
52 | * - NightTemperatureEnabled | ||||
53 | * - NightTemperature | ||||
54 | * - Running | ||||
55 | * - CurrentColorTemperature | ||||
56 | * - LatitudeAuto | ||||
57 | * - LongitudeAuto | ||||
58 | * - LocationEnabled | ||||
59 | * - LatitudeFixed | ||||
60 | * - LongitudeFixed | ||||
61 | * - TimingsEnabled | ||||
62 | * - MorningBeginFixed | ||||
63 | * - EveningBeginFixed | ||||
64 | * - TransitionTime | ||||
65 | * | ||||
66 | * @return QHash<QString, QVariant> | ||||
67 | * @see nightColorConfigChange | ||||
68 | * @see signalNightColorConfigChange | ||||
69 | * @since 5.12 | ||||
70 | **/ | ||||
71 | QHash<QString, QVariant> nightColorInfo(); | ||||
72 | /** | ||||
73 | * @brief Allows changing the Night Color configuration. | ||||
74 | * | ||||
75 | * The provided variant hash can have the following fields: | ||||
76 | * - Active | ||||
77 | * - Mode | ||||
78 | * - NightTemperature | ||||
79 | * - LatitudeAuto | ||||
80 | * - LongitudeAuto | ||||
81 | * - LatitudeFixed | ||||
82 | * - LongitudeFixed | ||||
83 | * - MorningBeginFixed | ||||
84 | * - EveningBeginFixed | ||||
85 | * - TransitionTime | ||||
86 | * | ||||
87 | * It returns true if the configuration change was succesful, otherwise false. | ||||
88 | * A change request for the location or timings needs to provide all relevant fields at the same time | ||||
89 | * to be succesful. Otherwise the whole change request will get ignored. A change request will be ignored | ||||
90 | * as a whole as well, if one of the provided informations has been sent in a wrong format. | ||||
91 | * | ||||
92 | * @return bool | ||||
93 | * @see nightColorInfo | ||||
94 | * @see signalNightColorConfigChange | ||||
95 | * @since 5.12 | ||||
96 | **/ | ||||
97 | bool setNightColorConfig(QHash<QString, QVariant> data); | ||||
98 | /** | ||||
99 | * @brief For receiving auto location updates, primarily through the KDE Daemon | ||||
100 | * @return void | ||||
101 | * @since 5.12 | ||||
102 | **/ | ||||
103 | void nightColorAutoLocationUpdate(double latitude, double longitude); | ||||
104 | | ||||
105 | Q_SIGNALS: | ||||
106 | /** | ||||
107 | * @brief Emits that the Night Color configuration has been changed. | ||||
108 | * | ||||
109 | * The provided variant hash provides the same fields as @link nightColorInfo | ||||
110 | * | ||||
111 | * @return void | ||||
112 | * @see nightColorInfo | ||||
113 | * @see nightColorConfigChange | ||||
114 | * @since 5.12 | ||||
115 | **/ | ||||
116 | void nightColorConfigChanged(QHash<QString, QVariant> data); | ||||
117 | | ||||
118 | private: | ||||
119 | Manager *m_manager; | ||||
120 | }; | ||||
121 | | ||||
122 | } | ||||
123 | | ||||
124 | } | ||||
125 | | ||||
126 | #endif // KWIN_NIGHTCOLOR_DBUS_INTERFACE_H |