2022-03-17 04:33:13 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2022 by Devin Lin <devin@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
#include "kscreeninterface.h"
|
|
|
|
|
|
|
|
|
|
class ScreenRotationUtil : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PROPERTY(bool screenRotationEnabled READ screenRotation WRITE setScreenRotation NOTIFY screenRotationChanged);
|
2023-02-10 07:00:45 +00:00
|
|
|
Q_PROPERTY(bool available READ isAvailable NOTIFY availableChanged);
|
2022-03-17 04:33:13 +00:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ScreenRotationUtil(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
bool screenRotation();
|
|
|
|
|
void setScreenRotation(bool value);
|
|
|
|
|
|
2022-10-04 15:09:18 +00:00
|
|
|
bool isAvailable();
|
|
|
|
|
|
2022-03-17 04:33:13 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
|
void screenRotationChanged(bool value);
|
2023-02-10 07:00:45 +00:00
|
|
|
void availableChanged(bool value);
|
2022-03-17 04:33:13 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
org::kde::KScreen *m_kscreenInterface;
|
2023-02-10 07:00:45 +00:00
|
|
|
|
|
|
|
|
bool m_available;
|
2022-03-17 04:33:13 +00:00
|
|
|
};
|