1/*
2 * SPDX-FileCopyrightText: 2021 Nicolas Fella <nicolas.fella@gmx.de>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KCOLORSCHEMEWATCHER_H
8#define KCOLORSCHEMEWATCHER_H
9
10#include "kguiaddons_export.h"
11
12#include <QObject>
13
14#include <memory>
15
16class KColorSchemeWatcherPrivate;
17
18/**
19 * Information about system-wide color preferences.
20 * @since 5.100
21 */
22class KGUIADDONS_EXPORT KColorSchemeWatcher : public QObject
23{
24 Q_OBJECT
25public:
26 enum ColorPreference {
27 NoPreference = 0, /** No preference available */
28 PreferDark, /** The user prefers a dark color scheme */
29 PreferLight, /** The user prefers a light color scheme */
30 };
31 Q_ENUM(ColorPreference)
32
33 KColorSchemeWatcher(QObject *parent = nullptr);
34 ~KColorSchemeWatcher() override;
35
36 /**
37 * The system-wide color preference.
38 */
39 ColorPreference systemPreference() const;
40
41Q_SIGNALS:
42 /**
43 * Emitted when systemPreference changes.
44 */
45 void systemPreferenceChanged();
46
47private:
48 std::unique_ptr<KColorSchemeWatcherPrivate> const d;
49};
50
51#endif
52

source code of kguiaddons/src/colors/kcolorschemewatcher.h