MauiMan

screenmanager.h
1#pragma once
2
3#include <QObject>
4#include <QString>
5
6#include "mauiman_export.h"
7
9namespace MauiMan
10{
11class SettingsStore;
12
13/**
14 * The ScreenManager class exposes all the system screen properties.
15 */
16class MAUIMAN_EXPORT ScreenManager : public QObject
17{
19 /**
20 * The preferred scale factor for the main screen.
21 */
22 Q_PROPERTY(double scaleFactor READ scaleFactor WRITE setScaleFactor NOTIFY scaleFactorChanged)
23
24 /**
25 * The preferred orientation of the main screen.
26 * Possible values are:
27 * - 0 Horizontal - Landscape
28 * - 1 Vertical - Portrait
29 */
30 Q_PROPERTY(uint orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
31
32public:
33
34 /**
35 * @brief The Screen module default values.
36 */
38 {
39 static inline const double scaleFactor = 1;
40 static inline const double orientation = 0;
41 } ;
42
43 explicit ScreenManager(QObject * parent = nullptr);
44
45 double scaleFactor() const;
46 void setScaleFactor(double scaleFactor);
47
48 uint orientation() const;
49 void setOrientation(uint orientation);
50
51private Q_SLOTS:
52 void onScaleFactorChanged(double scale);
53 void onOrientationChanged(uint orientation);
54
56 void scaleFactorChanged(double scaleFactor);
57 void orientationChanged(uint orientation);
58
59private:
60#if !defined Q_OS_ANDROID
61 QDBusInterface *m_interface = nullptr;
62#endif
63 MauiMan::SettingsStore *m_settings;
64
65 void sync(const QString &key, const QVariant &value);
66 void setConnections();
67 void loadSettings();
68
69 double m_scaleFactor = ScreenManager::DefaultValues::scaleFactor;
70 uint m_orientation = ScreenManager::DefaultValues::orientation;
71};
72}
double scaleFactor
The preferred scale factor for the main screen.
uint orientation
The preferred orientation of the main screen.
The SettingsStore class Allows to store and read settings for MauiMan from the local conf file.
The MauiMan name-space contains all of the available modules for configuring the Maui Applications an...
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
The Screen module default values.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 11:54:25 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.