Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/layoutmodel/layout_list_model_selected.h
- This file was added.
1 | #ifndef LAYOUTLISTMODELSELECTED_H | ||||
---|---|---|---|---|---|
2 | #define LAYOUTLISTMODELSELECTED_H | ||||
3 | | ||||
4 | #include <QAbstractListModel> | ||||
5 | | ||||
6 | #include "layout_list_model_base.h" | ||||
7 | | ||||
8 | class LayoutListModelSelected : public QAbstractListModel, public LayoutListModelBase { | ||||
9 | Q_OBJECT | ||||
10 | | ||||
11 | public: | ||||
12 | struct EnabledLayout | ||||
13 | { | ||||
14 | QString saveName; | ||||
15 | bool isLatinModeEnabled; | ||||
16 | QString latinModeLayout; | ||||
17 | }; | ||||
18 | | ||||
19 | explicit LayoutListModelSelected(QObject* parent = nullptr); | ||||
20 | | ||||
21 | // Basic functionality: | ||||
22 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
23 | | ||||
24 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||||
25 | | ||||
26 | QList<EnabledLayout> enabledLayouts() const; | ||||
27 | void setEnabledLayouts(const QList<EnabledLayout> &enabledLayouts); | ||||
28 | | ||||
29 | void add(QString const& saveName); | ||||
30 | void remove(int row); | ||||
31 | | ||||
32 | void setOrder(QVector<int> const& order); | ||||
33 | | ||||
34 | private: | ||||
35 | QList<EnabledLayout> m_enabledLayouts; | ||||
36 | }; | ||||
37 | | ||||
38 | #endif // LAYOUTLISTMODELSELECTED_H |