2023-04-01 07:09:57 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 by Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-11-06 04:10:20 +00:00
|
|
|
#include <QDBusServiceWatcher>
|
2023-04-01 07:09:57 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2023-11-06 03:08:28 +00:00
|
|
|
#include <kscreen/config.h>
|
|
|
|
|
|
2023-11-09 07:22:14 +00:00
|
|
|
#include "colorssettings.h"
|
2023-11-06 04:10:20 +00:00
|
|
|
|
2023-04-01 07:09:57 +00:00
|
|
|
class PrepareUtil : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PROPERTY(int scaling READ scaling WRITE setScaling NOTIFY scalingChanged);
|
|
|
|
|
Q_PROPERTY(QStringList scalingOptions READ scalingOptions CONSTANT);
|
2023-11-09 07:22:14 +00:00
|
|
|
Q_PROPERTY(bool usingDarkTheme READ usingDarkTheme WRITE setUsingDarkTheme NOTIFY usingDarkThemeChanged)
|
2023-04-01 07:09:57 +00:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PrepareUtil(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
int scaling() const;
|
|
|
|
|
void setScaling(int scaling);
|
|
|
|
|
|
|
|
|
|
QStringList scalingOptions();
|
|
|
|
|
|
2023-11-09 07:22:14 +00:00
|
|
|
bool usingDarkTheme() const;
|
|
|
|
|
void setUsingDarkTheme(bool usingDarkTheme);
|
|
|
|
|
|
2023-04-01 07:09:57 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
|
void scalingChanged();
|
2023-11-09 07:22:14 +00:00
|
|
|
void usingDarkThemeChanged();
|
2023-11-06 04:10:20 +00:00
|
|
|
|
2023-04-01 07:09:57 +00:00
|
|
|
private:
|
|
|
|
|
int m_scaling;
|
2023-11-09 07:22:14 +00:00
|
|
|
bool m_usingDarkTheme;
|
2023-11-06 04:10:20 +00:00
|
|
|
|
2025-03-05 16:44:31 +00:00
|
|
|
int m_output{0};
|
|
|
|
|
|
2023-11-09 07:22:14 +00:00
|
|
|
ColorsSettings *m_colorsSettings;
|
2023-11-06 03:08:28 +00:00
|
|
|
KScreen::ConfigPtr m_config;
|
2023-04-01 07:09:57 +00:00
|
|
|
};
|