Changeset View
Changeset View
Standalone View
Standalone View
shell/scripting/widget.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 37 | { | |||
---|---|---|---|---|---|
44 | Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys) | 44 | Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys) | ||
45 | Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups) | 45 | Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups) | ||
46 | Q_PROPERTY(int index WRITE setIndex READ index) | 46 | Q_PROPERTY(int index WRITE setIndex READ index) | ||
47 | //We pass our js based QRect wrapper instead of a simple QRectF | 47 | //We pass our js based QRect wrapper instead of a simple QRectF | ||
48 | Q_PROPERTY(QJSValue geometry WRITE setGeometry READ geometry) | 48 | Q_PROPERTY(QJSValue geometry WRITE setGeometry READ geometry) | ||
49 | Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup) | 49 | Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup) | ||
50 | Q_PROPERTY(QString globalShortcut WRITE setGlobalShortcut READ globalShorcut) | 50 | Q_PROPERTY(QString globalShortcut WRITE setGlobalShortcut READ globalShorcut) | ||
51 | Q_PROPERTY(bool locked READ locked WRITE setLocked) | 51 | Q_PROPERTY(bool locked READ locked WRITE setLocked) | ||
52 | Q_PROPERTY(QString userBackgroundHints WRITE setUserBackgroundHints READ userBackgroundHints) | ||||
52 | 53 | | |||
53 | public: | 54 | public: | ||
54 | explicit Widget(Plasma::Applet *applet, QObject *parent = nullptr); | 55 | explicit Widget(Plasma::Applet *applet, QObject *parent = nullptr); | ||
55 | ~Widget() override; | 56 | ~Widget() override; | ||
56 | 57 | | |||
57 | uint id() const; | 58 | uint id() const; | ||
58 | QString type() const; | 59 | QString type() const; | ||
59 | 60 | | |||
60 | int index() const; | 61 | int index() const; | ||
61 | void setIndex(int index); | 62 | void setIndex(int index); | ||
62 | 63 | | |||
63 | QJSValue geometry() const; | 64 | QJSValue geometry() const; | ||
64 | void setGeometry(const QJSValue &geometry); | 65 | void setGeometry(const QJSValue &geometry); | ||
65 | 66 | | |||
66 | void setGlobalShortcut(const QString &shortcut); | 67 | void setGlobalShortcut(const QString &shortcut); | ||
67 | QString globalShorcut() const; | 68 | QString globalShorcut() const; | ||
68 | 69 | | |||
70 | QString userBackgroundHints() const; | ||||
71 | void setUserBackgroundHints(QString hint); | ||||
apol: const&
or should it be Plasma::Types::BackgroundHints? | |||||
everthing else presents strings to the engine. i don't know if it's possible making enums work correctly with qjsengine (that is without qml) mart: everthing else presents strings to the engine.
i don't know if it's possible making enums work… | |||||
72 | | ||||
69 | Plasma::Applet *applet() const override; | 73 | Plasma::Applet *applet() const override; | ||
70 | 74 | | |||
71 | public Q_SLOTS: | 75 | public Q_SLOTS: | ||
72 | void remove(); | 76 | void remove(); | ||
73 | void showConfigurationInterface(); | 77 | void showConfigurationInterface(); | ||
74 | 78 | | |||
75 | private: | 79 | private: | ||
76 | class Private; | 80 | class Private; | ||
77 | Private * const d; | 81 | Private * const d; | ||
78 | }; | 82 | }; | ||
79 | 83 | | |||
80 | } | 84 | } | ||
81 | 85 | | |||
82 | #endif | 86 | #endif | ||
83 | 87 | |
const&
or should it be Plasma::Types::BackgroundHints?