Changeset View
Changeset View
Standalone View
Standalone View
components/shellprivate/widgetexplorer/plasmaappletitemmodel_p.h
Show All 23 Lines | |||||
24 | #include <Plasma/Applet> | 24 | #include <Plasma/Applet> | ||
25 | #include "kcategorizeditemsviewmodels_p.h" | 25 | #include "kcategorizeditemsviewmodels_p.h" | ||
26 | 26 | | |||
27 | class PlasmaAppletItemModel; | 27 | class PlasmaAppletItemModel; | ||
28 | 28 | | |||
29 | /** | 29 | /** | ||
30 | * Implementation of the KCategorizedItemsViewModels::AbstractItem | 30 | * Implementation of the KCategorizedItemsViewModels::AbstractItem | ||
31 | */ | 31 | */ | ||
32 | class PlasmaAppletItem : public QObject, public KCategorizedItemsViewModels::AbstractItem | 32 | class PlasmaAppletItem : public KCategorizedItemsViewModels::AbstractItem | ||
33 | { | 33 | { | ||
34 | Q_OBJECT | | |||
35 | | ||||
36 | public: | 34 | public: | ||
37 | PlasmaAppletItem(PlasmaAppletItemModel *model, const KPluginInfo& info); | 35 | PlasmaAppletItem(const KPluginInfo& info); | ||
38 | 36 | | |||
39 | QString pluginName() const; | 37 | QString pluginName() const; | ||
40 | QString name() const override; | 38 | QString name() const override; | ||
41 | QString category() const; | 39 | QString category() const; | ||
42 | QString description() const override; | 40 | QString description() const override; | ||
43 | QString license() const; | 41 | QString license() const; | ||
44 | QString website() const; | 42 | QString website() const; | ||
45 | QString version() const; | 43 | QString version() const; | ||
46 | QString author() const; | 44 | QString author() const; | ||
47 | QString email() const; | 45 | QString email() const; | ||
48 | QVariant data(int role = Qt::UserRole + 1) const override; | 46 | QVariant data(int role = Qt::UserRole + 1) const override; | ||
49 | 47 | | |||
50 | int running() const override; | 48 | int running() const override; | ||
51 | bool isLocal() const; | 49 | bool isLocal() const; | ||
52 | PlasmaAppletItemModel* appletItemModel(); | | |||
53 | bool matches(const QString &pattern) const override; | 50 | bool matches(const QString &pattern) const override; | ||
54 | 51 | | |||
55 | //set how many instances of this applet are running | 52 | //set how many instances of this applet are running | ||
56 | void setRunning(int count) override; | 53 | void setRunning(int count) override; | ||
57 | bool passesFiltering(const KCategorizedItemsViewModels::Filter & filter) const override; | 54 | bool passesFiltering(const KCategorizedItemsViewModels::Filter & filter) const override; | ||
58 | QMimeData *mimeData() const; | 55 | QMimeData *mimeData() const; | ||
59 | QStringList mimeTypes() const; | 56 | QStringList mimeTypes() const; | ||
60 | 57 | | |||
61 | private: | 58 | private: | ||
62 | PlasmaAppletItemModel * m_model; | | |||
63 | KPluginInfo m_info; | 59 | KPluginInfo m_info; | ||
64 | QString m_screenshot; | 60 | QString m_screenshot; | ||
65 | QString m_icon; | 61 | QString m_icon; | ||
66 | int m_runningCount; | 62 | int m_runningCount; | ||
67 | bool m_local; | 63 | bool m_local; | ||
68 | }; | 64 | }; | ||
69 | 65 | | |||
70 | class PlasmaAppletItemModel : public QStandardItemModel | 66 | class PlasmaAppletItemModel : public QStandardItemModel | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |