Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/kcmui/hardware_config_model.h
- This file was added.
1 | #ifndef KCM_KEYBOARD_DATAMODEL_H | ||||
---|---|---|---|---|---|
2 | #define KCM_KEYBOARD_DATAMODEL_H | ||||
3 | | ||||
4 | #include <QObject> | ||||
5 | | ||||
6 | #include <memory> | ||||
7 | | ||||
8 | #include "keyboard_model_model.h" | ||||
9 | #include "../xkb_rules.h" | ||||
10 | | ||||
11 | enum class TriState { | ||||
12 | ON = 0, | ||||
13 | OFF = 1, | ||||
14 | UNCHANGED = 2 | ||||
15 | }; | ||||
16 | | ||||
17 | class HardwareConfigModel : public QObject { | ||||
18 | Q_OBJECT | ||||
19 | Q_PROPERTY(KeyboardModelModel* keyboardModelModel READ keyboardModelModel NOTIFY keyboardModelModelChanged) | ||||
20 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) | ||||
21 | Q_PROPERTY(int numlockOnStartup READ numlockOnStartup WRITE setNumlockOnStartup NOTIFY numlockOnStartupChanged) | ||||
22 | Q_PROPERTY(int keyboardRepeat READ keyboardRepeat WRITE setKeyboardRepeat NOTIFY keyboardRepeatChanged) | ||||
23 | Q_PROPERTY(int repeatDelay READ repeatDelay WRITE setRepeatDelay NOTIFY repeatDelayChanged) | ||||
24 | Q_PROPERTY(double repeatRate READ repeatRate WRITE setRepeatRate NOTIFY repeatRateChanged) | ||||
25 | | ||||
26 | public: | ||||
27 | explicit HardwareConfigModel(QObject* parent); | ||||
28 | | ||||
29 | public: | ||||
30 | KeyboardModelModel* keyboardModelModel(); | ||||
31 | | ||||
32 | int currentIndex(); | ||||
33 | void setCurrentIndex(int idx); | ||||
34 | | ||||
35 | int numlockOnStartup(); | ||||
36 | void setNumlockOnStartup(int state); | ||||
37 | | ||||
38 | int keyboardRepeat(); | ||||
39 | void setKeyboardRepeat(int state); | ||||
40 | | ||||
41 | int repeatDelay(); | ||||
42 | void setRepeatDelay(int ms); | ||||
43 | | ||||
44 | double repeatRate(); | ||||
45 | void setRepeatRate(double rate); | ||||
46 | | ||||
47 | QString keyboardModel() const; | ||||
48 | void setKeyboardModel(const QString &keyboardModel); | ||||
49 | | ||||
50 | Q_SIGNALS: | ||||
51 | void keyboardModelModelChanged(); | ||||
52 | void currentIndexChanged(); | ||||
53 | void numlockOnStartupChanged(); | ||||
54 | void keyboardRepeatChanged(); | ||||
55 | void repeatDelayChanged(); | ||||
56 | void repeatRateChanged(); | ||||
57 | | ||||
58 | private: | ||||
59 | KeyboardModelModel m_keyboard_model_model; | ||||
60 | | ||||
61 | TriState m_numlockOnStartup; | ||||
62 | TriState m_keyboardRepeat; | ||||
63 | int m_repeatDelay; | ||||
64 | double m_repeatRate; | ||||
65 | QString m_keyboardModel; | ||||
66 | }; | ||||
67 | | ||||
68 | #endif // KCM_KEYBOARD_DATAMODEL_H |