Changeset View
Changeset View
Standalone View
Standalone View
shell/currentcontainmentactionsmodel.h
Show All 24 Lines | |||||
25 | #include <kconfig.h> | 25 | #include <kconfig.h> | ||
26 | #include <kconfiggroup.h> | 26 | #include <kconfiggroup.h> | ||
27 | 27 | | |||
28 | namespace Plasma { | 28 | namespace Plasma { | ||
29 | class Containment; | 29 | class Containment; | ||
30 | class ContainmentActions; | 30 | class ContainmentActions; | ||
31 | } | 31 | } | ||
32 | 32 | | |||
33 | class QQuickItem; | ||||
34 | | ||||
33 | //This model load the data about available containment actions plugins, such as context menus that can be loaded on mouse click | 35 | //This model load the data about available containment actions plugins, such as context menus that can be loaded on mouse click | ||
34 | //TODO: out of the library? | 36 | //TODO: out of the library? | ||
35 | class CurrentContainmentActionsModel : public QStandardItemModel | 37 | class CurrentContainmentActionsModel : public QStandardItemModel | ||
36 | { | 38 | { | ||
37 | Q_OBJECT | 39 | Q_OBJECT | ||
38 | 40 | | |||
39 | public: | 41 | public: | ||
40 | enum Roles { | 42 | enum Roles { | ||
Show All 9 Lines | |||||
50 | 52 | | |||
51 | Q_INVOKABLE bool isTriggerUsed(const QString &trigger); | 53 | Q_INVOKABLE bool isTriggerUsed(const QString &trigger); | ||
52 | Q_INVOKABLE QString mouseEventString(int mouseButtons, int modifiers); | 54 | Q_INVOKABLE QString mouseEventString(int mouseButtons, int modifiers); | ||
53 | Q_INVOKABLE QString wheelEventString(const QPointF &delta, int mouseButtons, int modifiers); | 55 | Q_INVOKABLE QString wheelEventString(const QPointF &delta, int mouseButtons, int modifiers); | ||
54 | Q_INVOKABLE bool append(const QString &action, const QString &plugin); | 56 | Q_INVOKABLE bool append(const QString &action, const QString &plugin); | ||
55 | Q_INVOKABLE void update(int row, const QString &action, const QString &plugin); | 57 | Q_INVOKABLE void update(int row, const QString &action, const QString &plugin); | ||
56 | Q_INVOKABLE void remove(int row); | 58 | Q_INVOKABLE void remove(int row); | ||
57 | Q_INVOKABLE void showConfiguration(int row); | 59 | Q_INVOKABLE void showConfiguration(int row); | ||
58 | Q_INVOKABLE void showAbout(int row); | 60 | Q_INVOKABLE void showAbout(int row, QQuickItem *ctx = nullptr); | ||
59 | Q_INVOKABLE void save(); | 61 | Q_INVOKABLE void save(); | ||
60 | 62 | | |||
61 | private: | 63 | private: | ||
62 | Plasma::Containment *m_containment; | 64 | Plasma::Containment *m_containment; | ||
63 | QHash<QString, Plasma::ContainmentActions *> m_plugins; | 65 | QHash<QString, Plasma::ContainmentActions *> m_plugins; | ||
64 | KConfigGroup m_baseCfg; | 66 | KConfigGroup m_baseCfg; | ||
65 | KConfigGroup m_tempConfig; | 67 | KConfigGroup m_tempConfig; | ||
66 | KConfig m_tempConfigParent; | 68 | KConfig m_tempConfigParent; | ||
67 | QStringList m_removedTriggers; | 69 | QStringList m_removedTriggers; | ||
68 | }; | 70 | }; | ||
69 | 71 | | |||
70 | #endif | 72 | #endif |