Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/layoutmodel/layout_list_model_fcitx.h
- This file was added.
1 | #ifndef LAYOUTLISTMODELFCITX_H | ||||
---|---|---|---|---|---|
2 | #define LAYOUTLISTMODELFCITX_H | ||||
3 | | ||||
4 | #include <QAbstractItemModel> | ||||
5 | #include <QDBusMessage> | ||||
6 | | ||||
7 | #include "layout_list_model_base.h" | ||||
8 | | ||||
9 | class LayoutListModelFcitx : public QAbstractItemModel, public LayoutListModelBase { | ||||
10 | Q_OBJECT | ||||
11 | | ||||
12 | public: | ||||
13 | explicit LayoutListModelFcitx(QObject* parent = nullptr); | ||||
14 | | ||||
15 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
16 | | ||||
17 | int columnCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
18 | | ||||
19 | Qt::ItemFlags flags(const QModelIndex& index) const override; | ||||
20 | | ||||
21 | QModelIndex index(int row, int column = 0, | ||||
22 | const QModelIndex& parent = QModelIndex()) const override; | ||||
23 | | ||||
24 | QModelIndex parent(const QModelIndex& index) const override; | ||||
25 | | ||||
26 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||||
27 | | ||||
28 | private: | ||||
29 | void load(); | ||||
30 | | ||||
31 | private: | ||||
32 | struct Layout { | ||||
33 | QString save_name; | ||||
34 | QString layout_id; | ||||
35 | QString description; | ||||
36 | QString language; | ||||
37 | bool enabled; | ||||
38 | }; | ||||
39 | | ||||
40 | QScopedPointer<QVector<Layout>> m_layouts; | ||||
41 | int m_numEnabled = 0; | ||||
42 | }; | ||||
43 | | ||||
44 | #endif |