File indexing completed on 2024-05-12 05:32:16

0001 /*
0002     SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
0003     SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 #pragma once
0008 
0009 #include <QObject>
0010 #include <memory>
0011 
0012 class QOrientationSensor;
0013 class QOrientationReading;
0014 
0015 namespace KWin
0016 {
0017 
0018 class OrientationSensor : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit OrientationSensor();
0023     ~OrientationSensor();
0024 
0025     void setEnabled(bool enable);
0026     QOrientationReading *reading() const;
0027 
0028 Q_SIGNALS:
0029     void orientationChanged();
0030 
0031 private:
0032     void update();
0033 
0034     const std::unique_ptr<QOrientationSensor> m_sensor;
0035     const std::unique_ptr<QOrientationReading> m_reading;
0036 };
0037 
0038 }