shift-shell/quicksettings/screenrotation/screenrotationutil.h
Luca Weiss f8aeffa56d quicksettings/screenrotation: hide when not available
On devices where auto-rotate is not (yet) available, make sure not to
show an auto-rotate toggle with no functionality.
2023-02-10 06:28:59 +00:00

32 lines
670 B
C++

/*
* 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);
Q_PROPERTY(bool available READ isAvailable);
public:
ScreenRotationUtil(QObject *parent = nullptr);
bool screenRotation();
void setScreenRotation(bool value);
bool isAvailable();
Q_SIGNALS:
void screenRotationChanged(bool value);
private:
org::kde::KScreen *m_kscreenInterface;
};