23class DeviceConfig:
public QObject
26 Q_PROPERTY(QString name READ name NOTIFY changed)
29 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY changed)
30 Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations NOTIFY changed)
31 Q_PROPERTY(Qt::ScreenOrientation landscapeOrientation READ landscapeOrientation NOTIFY changed)
32 Q_PROPERTY(Qt::ScreenOrientation invertedLandscapeOrientation READ invertedLandscapeOrientation NOTIFY changed)
33 Q_PROPERTY(Qt::ScreenOrientation portraitOrientation READ portraitOrientation NOTIFY changed)
34 Q_PROPERTY(Qt::ScreenOrientation invertedPortraitOrientation READ invertedPortraitOrientation NOTIFY changed)
35 Q_PROPERTY(QString category READ category NOTIFY changed)
36 Q_PROPERTY(
bool supportsMultiColorLed READ supportsMultiColorLed NOTIFY changed)
38 Q_PROPERTY(
bool foldable READ foldable NOTIFY changed)
39 Q_PROPERTY(QString foldableSysfsPath READ foldableSysfsPath NOTIFY changed)
40 Q_PROPERTY(
int innerGridUnit READ innerGridUnit NOTIFY changed)
41 Q_PROPERTY(
int coverGridUnit READ coverGridUnit NOTIFY changed)
42 Q_PROPERTY(
int coverOrientationAngle READ coverOrientationAngle NOTIFY changed)
44 Q_PROPERTY(quint8 sensorLocationX READ sensorLocationX FINAL)
45 Q_PROPERTY(quint8 sensorLocationY READ sensorLocationY FINAL)
46 Q_PROPERTY(quint8 sensorRadius READ sensorRadius FINAL)
49 DeviceConfig(QObject *parent =
nullptr);
54 Qt::ScreenOrientation primaryOrientation()
const;
55 Qt::ScreenOrientations supportedOrientations()
const;
56 Qt::ScreenOrientation landscapeOrientation()
const;
57 Qt::ScreenOrientation invertedLandscapeOrientation()
const;
58 Qt::ScreenOrientation portraitOrientation()
const;
59 Qt::ScreenOrientation invertedPortraitOrientation()
const;
60 QString category()
const;
61 bool supportsMultiColorLed()
const;
63 bool foldable()
const;
64 QString foldableSysfsPath()
const;
65 int innerGridUnit()
const;
66 int coverGridUnit()
const;
67 int coverOrientationAngle()
const;
69 quint8 sensorLocationX()
const;
70 quint8 sensorLocationY()
const;
71 quint8 sensorRadius()
const;
74 Q_INVOKABLE
void refresh() { Q_EMIT changed(); }
80 std::unique_ptr<DeviceInfo> m_info;
82 Qt::ScreenOrientation stringToOrientation(
const std::string &orientationString, Qt::ScreenOrientation defaultValue)
const;