2022-01-04 17:12:46 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2022 by Devin Lin <devin@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
2025-04-18 20:02:54 +00:00
|
|
|
#include <qqmlregistration.h>
|
2022-01-04 17:12:46 +00:00
|
|
|
|
|
|
|
|
#include "nightcolorsettings.h"
|
2024-02-08 17:04:11 +00:00
|
|
|
#include "nightlightinterface.h"
|
2022-01-04 17:12:46 +00:00
|
|
|
|
|
|
|
|
class NightColorUtil : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2025-04-18 20:02:54 +00:00
|
|
|
QML_ELEMENT
|
|
|
|
|
QML_SINGLETON
|
|
|
|
|
|
2022-01-04 17:12:46 +00:00
|
|
|
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
NightColorUtil(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
bool enabled();
|
|
|
|
|
void setEnabled(bool enabled);
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
void enabledChanged();
|
|
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
2022-01-05 04:15:11 +00:00
|
|
|
void enabledUpdated(const QString &name, const QVariantMap &map, const QStringList &list);
|
2022-01-04 17:12:46 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool m_enabled;
|
2024-02-08 17:04:11 +00:00
|
|
|
OrgKdeKWinNightLightInterface *m_ccInterface;
|
2022-09-10 18:22:39 +00:00
|
|
|
NightColorSettings *m_settings;
|
2022-01-04 17:12:46 +00:00
|
|
|
};
|