File indexing completed on 2024-05-19 13:23:19
0001 /* 0002 * SPDX-FileCopyrightText: 2022 by Devin Lin <devin@kde.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 0011 #include "kscreeninterface.h" 0012 0013 class ScreenRotationUtil : public QObject 0014 { 0015 Q_OBJECT 0016 Q_PROPERTY(bool screenRotationEnabled READ screenRotation WRITE setScreenRotation NOTIFY screenRotationChanged); 0017 Q_PROPERTY(bool available READ isAvailable NOTIFY availableChanged); 0018 0019 public: 0020 ScreenRotationUtil(QObject *parent = nullptr); 0021 0022 bool screenRotation(); 0023 void setScreenRotation(bool value); 0024 0025 bool isAvailable(); 0026 0027 Q_SIGNALS: 0028 void screenRotationChanged(bool value); 0029 void availableChanged(bool value); 0030 0031 private: 0032 org::kde::KScreen *m_kscreenInterface; 0033 0034 bool m_available; 0035 };