MauiMan

inputdevicesmanager.h
1#pragma once
2#include <QObject>
3#include "mauiman_export.h"
4
6namespace MauiMan
7{
8 class SettingsStore;
9
10 /**
11 * @brief The InputDevicesManager class exposes all the system input devices properties
12 */
13 class MAUIMAN_EXPORT InputDevicesManager : public QObject
14 {
15 Q_OBJECT
16 /**
17 * The preferred keyboard language layout.
18 */
19 Q_PROPERTY(QString keyboardLayout READ keyboardLayout WRITE setKeyboardLayout NOTIFY keyboardLayoutChanged)
20
21 /**
22 * The preferred keyboard model
23 */
24 Q_PROPERTY(QString keyboardModel READ keyboardModel WRITE setKeyboardModel NOTIFY keyboardModelChanged)
25
26 /**
27 * The preferred keyboard layout variant.
28 */
29 Q_PROPERTY(QString keyboardVariant READ keyboardVariant WRITE setKeyboardVariant NOTIFY keyboardVariantChanged)
30
31 /**
32 * The keyboard layout options.
33 */
34 Q_PROPERTY(QString keyboardOptions READ keyboardOptions WRITE setKeyboardOptions NOTIFY keyboardOptionsChanged)
35
36 /**
37 * The keyboard layout custom rules.
38 */
39 Q_PROPERTY(QString keyboardRules READ keyboardRules WRITE setKeyboardRules NOTIFY keyboardRulesChanged)
40
41 public:
42
43 /**
44 * The InputDevices module default values.
45 */
47 {
48 static inline const QString keyboardLayout = QStringLiteral("us");
49 static inline const QString keyboardModel = QStringLiteral("");
50 static inline const QString keyboardOptions = QStringLiteral("grp:shifts_toggle,compose:ralt,ctrl:nocaps");
51 static inline const QString keyboardVariant = QStringLiteral("");
52 static inline const QString keyboardRules = QStringLiteral("");
53 };
54 explicit InputDevicesManager(QObject *parent = nullptr);
55
56 QString keyboardLayout() const;
57 void setKeyboardLayout(QString keyboardLayout);
58
59 QString keyboardModel() const;
60 void setKeyboardModel(QString keyboardModel);
61
62 QString keyboardVariant() const;
63 void setKeyboardVariant(QString keyboardVariant);
64
65 QString keyboardOptions() const;
66 void setKeyboardOptions(QString keyboardOptions);
67
68 QString keyboardRules() const;
69 void setKeyboardRules(QString keyboardRules);
70
71 private Q_SLOTS:
72 void onKeyboardLayoutChanged(const QString &keyboardLayout);
73 void onKeyboardModelChanged(const QString &keyboardModel);
74 void onKeyboardOptionsChanged(const QString &keyboardOptions);
75 void onKeyboardRulesChanged(const QString &keyboardRules);
76 void onKeyboardVariantChanged (const QString &keyboardVariant);
77
78 private:
79 #if !defined Q_OS_ANDROID
80 QDBusInterface *m_interface = nullptr;
81 #endif
82 MauiMan::SettingsStore *m_settings;
83
84 void sync(const QString &key, const QVariant &value);
85 void setConnections();
86 void loadSettings();
87
88 QString m_keyboardLayout = InputDevicesManager::DefaultValues::keyboardLayout;
89 QString m_keyboardModel = InputDevicesManager::DefaultValues::keyboardModel;
90 QString m_keyboardVariant = InputDevicesManager::DefaultValues::keyboardVariant;
91 QString m_keyboardOptions = InputDevicesManager::DefaultValues::keyboardOptions;
92 QString m_keyboardRules = InputDevicesManager::DefaultValues::keyboardRules;
93
94 Q_SIGNALS:
95 void keyboardLayoutChanged(QString keyboardLayout);
96 void keyboardModelChanged(QString keyboardModel);
97 void keyboardVariantChanged(QString keyboardVariant);
98 void keyboardOptionsChanged(QString keyboardOptions);
99 void keyboardRulesChanged(QString keyboardRules);
100 };
101}
The InputDevicesManager class exposes all the system input devices properties.
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...
The InputDevices module default values.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.