Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/kcmui/layout_config_model.h
- This file was added.
1 | #ifndef LAYOUTMODEL_H | ||||
---|---|---|---|---|---|
2 | #define LAYOUTMODEL_H | ||||
3 | | ||||
4 | #include <QObject> | ||||
5 | #include <KActionCollection> | ||||
6 | | ||||
7 | #include "layout_list_models.h" | ||||
8 | | ||||
9 | class LayoutConfigModel : public QObject { | ||||
10 | Q_OBJECT | ||||
11 | Q_PROPERTY(bool showLayoutIndicator READ showLayoutIndicator WRITE setShowLayoutIndicator NOTIFY showLayoutIndicatorChanged) | ||||
12 | Q_PROPERTY(bool showForSingleLayout READ showForSingleLayout WRITE setShowForSingleLayout NOTIFY showForSingleLayoutChanged) | ||||
13 | Q_PROPERTY(bool layoutIndicatorShowFlag READ layoutIndicatorShowFlag WRITE setLayoutIndicatorShowFlag NOTIFY layoutIndicatorShowFlagChanged) | ||||
14 | Q_PROPERTY(bool layoutIndicatorShowLabel READ layoutIndicatorShowLabel WRITE setLayoutIndicatorShowLabel NOTIFY layoutIndicatorShowLabelChanged) | ||||
15 | Q_PROPERTY(int switchingPolicyIndex READ switchingPolicyIndex WRITE setSwitchingPolicyIndex NOTIFY switchingPolicyIndexChanged) | ||||
16 | Q_PROPERTY(QString alternativeShortcut READ alternativeShortcut WRITE setAlternativeShortcut NOTIFY alternativeShortcutChanged) | ||||
17 | Q_PROPERTY(LayoutListFilterDuplicatesProxyModel* layoutListModel READ layoutListModel NOTIFY layoutListModelChanged) | ||||
18 | Q_PROPERTY(LayoutListSortByPriorityProxyModel* currentLayoutListModel READ currentLayoutListModel NOTIFY currentLayoutListModelChanged) | ||||
19 | Q_PROPERTY(QStringList mainShiftKeyModel READ mainShiftKeyModel) | ||||
20 | Q_PROPERTY(int mainShiftKeyIndex READ mainShiftKeyIndex WRITE setMainShiftKeyIndex NOTIFY mainShiftKeyIndexChanged) | ||||
21 | Q_PROPERTY(QStringList thirdLevelShortcutModel READ thirdLevelShortcutModel) | ||||
22 | Q_PROPERTY(int thirdLevelShortcutIndex READ thirdLevelShortcutIndex WRITE setThirdLevelShortcutIndex NOTIFY thirdLevelShortcutChanged) | ||||
23 | | ||||
24 | public: | ||||
25 | explicit LayoutConfigModel(QObject* parent); | ||||
26 | | ||||
27 | public: | ||||
28 | bool showLayoutIndicator() const; | ||||
29 | void setShowLayoutIndicator(bool showLayoutIndicator); | ||||
30 | | ||||
31 | bool showForSingleLayout() const; | ||||
32 | void setShowForSingleLayout(bool showForSingleLayout); | ||||
33 | | ||||
34 | bool layoutIndicatorShowFlag() const; | ||||
35 | void setLayoutIndicatorShowFlag(bool b); | ||||
36 | | ||||
37 | bool layoutIndicatorShowLabel() const; | ||||
38 | void setLayoutIndicatorShowLabel(bool b); | ||||
39 | | ||||
40 | int switchingPolicyIndex() const; | ||||
41 | void setSwitchingPolicyIndex(int switchingPolicyIndex); | ||||
42 | | ||||
43 | QString alternativeShortcut() const; | ||||
44 | void setAlternativeShortcut(QString alternativeShortcut); | ||||
45 | | ||||
46 | LayoutListFilterDuplicatesProxyModel* layoutListModel() const; | ||||
47 | LayoutListSortByPriorityProxyModel* currentLayoutListModel() const; | ||||
48 | | ||||
49 | void loadEnabledLayouts(); | ||||
50 | void saveEnabledLayouts(); | ||||
51 | | ||||
52 | QStringList mainShiftKeyModel() const; | ||||
53 | QStringList thirdLevelShortcutModel() const; | ||||
54 | | ||||
55 | static const char* switch_modes[4]; | ||||
56 | | ||||
57 | int mainShiftKeyIndex() const; | ||||
58 | QString mainShiftKey() const; | ||||
59 | void setMainShiftKeyIndex(int mainShiftKeyIndex); | ||||
60 | void setMainShiftKey(QString const& name); | ||||
61 | | ||||
62 | int thirdLevelShortcutIndex() const; | ||||
63 | QString thirdLevelShortcut() const; | ||||
64 | void setThirdLevelShortcutIndex(int thirdLevelShortcut); | ||||
65 | void setThirdLevelShortcut(QString const& name); | ||||
66 | | ||||
67 | Q_SIGNALS: | ||||
68 | void showLayoutIndicatorChanged(); | ||||
69 | void showForSingleLayoutChanged(); | ||||
70 | void layoutIndicatorShowFlagChanged(); | ||||
71 | void layoutIndicatorShowLabelChanged(); | ||||
72 | void switchingPolicyIndexChanged(); | ||||
73 | void alternativeShortcutChanged(); | ||||
74 | void layoutListModelChanged(); | ||||
75 | void currentLayoutListModelChanged(); | ||||
76 | void mainShiftKeyIndexChanged(); | ||||
77 | void thirdLevelShortcutChanged(); | ||||
78 | | ||||
79 | private: | ||||
80 | bool m_showLayoutIndicator; | ||||
81 | bool m_showForSingleLayout; | ||||
82 | | ||||
83 | bool m_layoutIndicatorShowFlag; | ||||
84 | bool m_layoutIndicatorShowLabel; | ||||
85 | | ||||
86 | int m_switchingPolicyIndex; | ||||
87 | int m_mainShiftKeyIndex; | ||||
88 | int m_thirdLevelShortcutIndex; | ||||
89 | | ||||
90 | QString m_alternativeShortcuts; | ||||
91 | | ||||
92 | LayoutListModels* m_layoutListModels; | ||||
93 | }; | ||||
94 | | ||||
95 | #endif // LAYOUTMODEL_H |