Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/layoutmodel/layout_list_models.h
- This file was added.
1 | #ifndef LAYOUT_LIST_MODELS_H | ||||
---|---|---|---|---|---|
2 | #define LAYOUT_LIST_MODELS_H | ||||
3 | | ||||
4 | #include <QObject> | ||||
5 | #include <QDBusInterface> | ||||
6 | #include <QDBusArgument> | ||||
7 | | ||||
8 | #include "layout_list_model_selected.h" | ||||
9 | #include "layout_list_filter_duplicates_proxy_model.h" | ||||
10 | #include "layout_list_sort_by_priority_proxy_model.h" | ||||
11 | #include "layout_list_current_proxy_model.h" | ||||
12 | | ||||
13 | class LayoutListModels : public QObject | ||||
14 | { | ||||
15 | Q_OBJECT | ||||
16 | Q_PROPERTY(int currentLayoutIndex READ currentLayoutIndex WRITE setCurrentLayoutIndex NOTIFY currentLayoutIndexChanged) | ||||
17 | | ||||
18 | LayoutListModelSelected* m_selected; | ||||
19 | LayoutListFilterDuplicatesProxyModel* m_layoutListModel; | ||||
20 | LayoutListSortByPriorityProxyModel* m_configuredLayoutListModel; | ||||
21 | LayoutListCurrentProxyModel* m_currentLayoutListModel; | ||||
22 | QDBusInterface* m_kdedIface, *m_fcitxIface; | ||||
23 | int m_currentLayoutIndex; | ||||
24 | | ||||
25 | public: | ||||
26 | LayoutListModels(QObject *parent); | ||||
27 | | ||||
28 | LayoutListFilterDuplicatesProxyModel *entireLayoutListModel() const; | ||||
29 | LayoutListSortByPriorityProxyModel *configuredLayoutListModel() const; | ||||
30 | LayoutListCurrentProxyModel *currentLayoutListModel() const; | ||||
31 | | ||||
32 | int currentLayoutIndex(); | ||||
33 | void setCurrentLayoutIndex(int new_index); | ||||
34 | Q_INVOKABLE void switchLayout(int new_index); | ||||
35 | Q_INVOKABLE void openConfigDialog(); | ||||
36 | QString currentIconName(); | ||||
37 | | ||||
38 | void loadConfig(); | ||||
39 | void saveConfig(); | ||||
40 | | ||||
41 | Q_SIGNALS: | ||||
42 | void currentLayoutIndexChanged(); | ||||
43 | | ||||
44 | public Q_SLOTS: | ||||
45 | void setCurrentLayoutByName(QString const& saveName); | ||||
46 | void fcitxPropertyChanged(QString const& ifaceName, QVariantMap const& map, QStringList const& invalidated); | ||||
47 | }; | ||||
48 | | ||||
49 | #endif // LAYOUT_LIST_MODELS_H |