7#ifndef APPLETQUICKITEM_H
8#define APPLETQUICKITEM_H
10#include <QQmlComponent>
12#include <QQmlParserStatus>
16#include <plasmaquick/plasmaquick_export.h>
36class AppletQuickItemPrivate;
39class PLASMAQUICK_EXPORT AppletQuickItem :
public QQuickItem
43 Q_PROPERTY(
int switchWidth READ switchWidth WRITE setSwitchWidth NOTIFY switchWidthChanged)
44 Q_PROPERTY(
int switchHeight READ switchHeight WRITE setSwitchHeight NOTIFY switchHeightChanged)
46 Q_PROPERTY(QQmlComponent *compactRepresentation READ compactRepresentation WRITE setCompactRepresentation NOTIFY compactRepresentationChanged)
47 Q_PROPERTY(QQuickItem *compactRepresentationItem READ compactRepresentationItem NOTIFY compactRepresentationItemChanged)
49 Q_PROPERTY(QQmlComponent *fullRepresentation READ fullRepresentation WRITE setFullRepresentation NOTIFY fullRepresentationChanged)
50 Q_PROPERTY(QQuickItem *fullRepresentationItem READ fullRepresentationItem NOTIFY fullRepresentationItemChanged)
59 Q_PROPERTY(
bool preloadFullRepresentation READ preloadFullRepresentation WRITE setPreloadFullRepresentation NOTIFY preloadFullRepresentationChanged)
64 Q_PROPERTY(QQmlComponent *preferredRepresentation READ preferredRepresentation WRITE setPreferredRepresentation NOTIFY preferredRepresentationChanged)
69 Q_PROPERTY(
bool expanded READ isExpanded WRITE setExpanded NOTIFY expandedChanged)
75 Q_PROPERTY(
bool activationTogglesExpanded WRITE setActivationTogglesExpanded READ isActivationTogglesExpanded NOTIFY activationTogglesExpandedChanged)
82 Q_PROPERTY(
bool hideOnWindowDeactivate READ hideOnWindowDeactivate WRITE setHideOnWindowDeactivate NOTIFY hideOnWindowDeactivateChanged)
89 Q_PROPERTY(
bool expandedOnDragHover READ expandedOnDragHover WRITE setExpandedOnDragHover NOTIFY expandedOnDragHoverChanged)
94 Q_PROPERTY(QObject *plasmoid READ applet CONSTANT)
104 Q_PROPERTY(QString badgeText READ badgeText WRITE setBadgeText NOTIFY badgeTextChanged)
107 AppletQuickItem(QQuickItem *parent =
nullptr);
108 ~AppletQuickItem()
override;
111 Plasma::Applet *applet()
const;
113 void classBegin()
override;
114 void componentComplete()
override;
116 QQuickItem *compactRepresentationItem();
117 QQuickItem *fullRepresentationItem();
120 int switchWidth()
const;
121 void setSwitchWidth(
int width);
123 int switchHeight()
const;
124 void setSwitchHeight(
int width);
126 QQmlComponent *compactRepresentation();
127 void setCompactRepresentation(QQmlComponent *component);
129 QQmlComponent *fullRepresentation();
130 void setFullRepresentation(QQmlComponent *component);
132 QQmlComponent *preferredRepresentation();
133 void setPreferredRepresentation(QQmlComponent *component);
135 bool isExpanded()
const;
136 void setExpanded(
bool expanded);
138 bool isActivationTogglesExpanded()
const;
139 void setActivationTogglesExpanded(
bool activationTogglesExpanded);
141 bool hideOnWindowDeactivate()
const;
142 void setHideOnWindowDeactivate(
bool hide);
144 bool preloadFullRepresentation()
const;
145 void setPreloadFullRepresentation(
bool preload);
147 bool expandedOnDragHover()
const;
148 void setExpandedOnDragHover(
bool expandedOnDragHover);
150 QString badgeText()
const;
151 void setBadgeText(
const QString &text);
153 static bool hasItemForApplet(Plasma::Applet *applet);
154 static AppletQuickItem *itemForApplet(Plasma::Applet *applet);
158 void switchWidthChanged(
int width);
159 void switchHeightChanged(
int height);
161 void expandedChanged(
bool expanded);
163 void activationTogglesExpandedChanged(
bool activationTogglesExpanded);
164 void hideOnWindowDeactivateChanged(
bool hide);
166 void compactRepresentationChanged(QQmlComponent *compactRepresentation);
167 void fullRepresentationChanged(QQmlComponent *fullRepresentation);
168 void preferredRepresentationChanged(QQmlComponent *preferredRepresentation);
170 void compactRepresentationItemChanged(QObject *compactRepresentationItem);
171 void fullRepresentationItemChanged(QObject *fullRepresentationItem);
173 void preloadFullRepresentationChanged(
bool preload);
175 void expandedOnDragHoverChanged(
bool expandedOnDragHover);
177 void badgeTextChanged(QString text);
182 PlasmaQuick::SharedQmlEngine *qmlObject();
185 void childEvent(QChildEvent *event)
override;
186 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry)
override;
189 AppletQuickItemPrivate *
const d;
191 Q_PRIVATE_SLOT(d,
void minimumWidthChanged())
192 Q_PRIVATE_SLOT(d,
void minimumHeightChanged())
193 Q_PRIVATE_SLOT(d,
void preferredWidthChanged())
194 Q_PRIVATE_SLOT(d,
void preferredHeightChanged())
195 Q_PRIVATE_SLOT(d,
void maximumWidthChanged())
196 Q_PRIVATE_SLOT(d,
void maximumHeightChanged())
197 Q_PRIVATE_SLOT(d,
void fillWidthChanged())
198 Q_PRIVATE_SLOT(d,
void fillHeightChanged())
An object that instantiates an entire QML context, with its own declarative engine.
The EdgeEventForwarder class This class forwards edge events to be replayed within the given margin T...
Namespace for everything in libplasma.