Changeset View
Changeset View
Standalone View
Standalone View
src/scriptengines/qml/plasmoid/containmentinterface.h
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 52 | { | |||
---|---|---|---|---|---|
74 | Q_PROPERTY(QString activityName READ activityName NOTIFY activityNameChanged) | 74 | Q_PROPERTY(QString activityName READ activityName NOTIFY activityNameChanged) | ||
75 | 75 | | |||
76 | /** | 76 | /** | ||
77 | * Actions associated to this containment or corona | 77 | * Actions associated to this containment or corona | ||
78 | */ | 78 | */ | ||
79 | Q_PROPERTY(QList<QObject *> actions READ actions NOTIFY actionsChanged) | 79 | Q_PROPERTY(QList<QObject *> actions READ actions NOTIFY actionsChanged) | ||
80 | 80 | | |||
81 | /** | 81 | /** | ||
82 | * True when the containment is in an edit mode that allows to move | 82 | * True when the Plasma Shell is in an edit mode that allows to move | ||
83 | * things around: it's different from userConfiguring as it's about | 83 | * things around: it's different from userConfiguring as it's about | ||
84 | * editing plasmoids inside the containment, rather than the containment | 84 | * editing plasmoids inside the containment, rather than the containment | ||
85 | * settings dialog itself | 85 | * settings dialog itself. | ||
86 | * This is global for the whole Plasma process, all containments will have the same value for editMode | ||||
86 | */ | 87 | */ | ||
87 | Q_PROPERTY(bool editMode READ isEditMode WRITE setEditMode NOTIFY editModeChanged) | 88 | Q_PROPERTY(bool editMode READ isEditMode WRITE setEditMode NOTIFY editModeChanged) | ||
88 | 89 | | |||
89 | public: | 90 | public: | ||
90 | ContainmentInterface(DeclarativeAppletScript *parent, const QVariantList &args = QVariantList()); | 91 | ContainmentInterface(DeclarativeAppletScript *parent, const QVariantList &args = QVariantList()); | ||
91 | 92 | | |||
92 | //Not for QML | 93 | //Not for QML | ||
93 | Plasma::Containment *containment() const | 94 | Plasma::Containment *containment() const | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 104 | //For QML use | |||
145 | 146 | | |||
146 | /** | 147 | /** | ||
147 | * Given a geometry, it adjusts it moving it completely inside of the boundaries | 148 | * Given a geometry, it adjusts it moving it completely inside of the boundaries | ||
148 | * of availableScreenRegion | 149 | * of availableScreenRegion | ||
149 | * @return the toLeft point of the rectangle | 150 | * @return the toLeft point of the rectangle | ||
150 | */ | 151 | */ | ||
151 | Q_INVOKABLE QPointF adjustToAvailableScreenRegion(int x, int y, int w, int h) const; | 152 | Q_INVOKABLE QPointF adjustToAvailableScreenRegion(int x, int y, int w, int h) const; | ||
152 | 153 | | |||
154 | /** | ||||
155 | * @returns a named action from global Corona's actions | ||||
156 | */ | ||||
157 | Q_INVOKABLE QAction *globalAction(QString name) const; | ||||
158 | | ||||
153 | bool isEditMode() const; | 159 | bool isEditMode() const; | ||
154 | void setEditMode(bool edit); | 160 | void setEditMode(bool edit); | ||
155 | 161 | | |||
156 | static ContainmentInterface *qmlAttachedProperties(QObject *object) | 162 | static ContainmentInterface *qmlAttachedProperties(QObject *object) | ||
157 | { | 163 | { | ||
158 | return qobject_cast<ContainmentInterface *>(AppletQuickItem::qmlAttachedProperties(object)); | 164 | return qobject_cast<ContainmentInterface *>(AppletQuickItem::qmlAttachedProperties(object)); | ||
159 | } | 165 | } | ||
160 | 166 | | |||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 215 | private: | |||
215 | QHash<KJob *, QPoint> m_dropPoints; | 221 | QHash<KJob *, QPoint> m_dropPoints; | ||
216 | QHash<KJob *, QMenu *> m_dropMenus; | 222 | QHash<KJob *, QMenu *> m_dropMenus; | ||
217 | QHash<KJob *, QJSValue *> m_dropCallbacks; | 223 | QHash<KJob *, QJSValue *> m_dropCallbacks; | ||
218 | QHash<KJob *, KIO::DropJob *> m_dropJobs; | 224 | QHash<KJob *, KIO::DropJob *> m_dropJobs; | ||
219 | KActivities::Info *m_activityInfo; | 225 | KActivities::Info *m_activityInfo; | ||
220 | QPointer<Plasma::Containment> m_containment; | 226 | QPointer<Plasma::Containment> m_containment; | ||
221 | QPointer<QMenu> m_contextMenu; | 227 | QPointer<QMenu> m_contextMenu; | ||
222 | int m_wheelDelta; | 228 | int m_wheelDelta; | ||
223 | bool m_editMode : 1; | | |||
224 | friend class AppletInterface; | 229 | friend class AppletInterface; | ||
225 | }; | 230 | }; | ||
226 | 231 | | |||
227 | QML_DECLARE_TYPEINFO(ContainmentInterface, QML_HAS_ATTACHED_PROPERTIES) | 232 | QML_DECLARE_TYPEINFO(ContainmentInterface, QML_HAS_ATTACHED_PROPERTIES) | ||
228 | 233 | | |||
229 | #endif | 234 | #endif |