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)
97 AppletQuickItem(QQuickItem *parent =
nullptr);
98 ~AppletQuickItem()
override;
101 Plasma::Applet *applet()
const;
103 void classBegin()
override;
104 void componentComplete()
override;
106 QQuickItem *compactRepresentationItem();
107 QQuickItem *fullRepresentationItem();
110 int switchWidth()
const;
111 void setSwitchWidth(
int width);
113 int switchHeight()
const;
114 void setSwitchHeight(
int width);
116 QQmlComponent *compactRepresentation();
117 void setCompactRepresentation(QQmlComponent *component);
119 QQmlComponent *fullRepresentation();
120 void setFullRepresentation(QQmlComponent *component);
122 QQmlComponent *preferredRepresentation();
123 void setPreferredRepresentation(QQmlComponent *component);
125 bool isExpanded()
const;
126 void setExpanded(
bool expanded);
128 bool isActivationTogglesExpanded()
const;
129 void setActivationTogglesExpanded(
bool activationTogglesExpanded);
131 bool hideOnWindowDeactivate()
const;
132 void setHideOnWindowDeactivate(
bool hide);
134 bool preloadFullRepresentation()
const;
135 void setPreloadFullRepresentation(
bool preload);
137 bool expandedOnDragHover()
const;
138 void setExpandedOnDragHover(
bool expandedOnDragHover);
140 static bool hasItemForApplet(Plasma::Applet *applet);
141 static AppletQuickItem *itemForApplet(Plasma::Applet *applet);
145 void switchWidthChanged(
int width);
146 void switchHeightChanged(
int height);
148 void expandedChanged(
bool expanded);
150 void activationTogglesExpandedChanged(
bool activationTogglesExpanded);
151 void hideOnWindowDeactivateChanged(
bool hide);
153 void compactRepresentationChanged(QQmlComponent *compactRepresentation);
154 void fullRepresentationChanged(QQmlComponent *fullRepresentation);
155 void preferredRepresentationChanged(QQmlComponent *preferredRepresentation);
157 void compactRepresentationItemChanged(QObject *compactRepresentationItem);
158 void fullRepresentationItemChanged(QObject *fullRepresentationItem);
160 void preloadFullRepresentationChanged(
bool preload);
162 void expandedOnDragHoverChanged(
bool expandedOnDragHover);
167 PlasmaQuick::SharedQmlEngine *qmlObject();
170 void childEvent(QChildEvent *event)
override;
171 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry)
override;
174 AppletQuickItemPrivate *
const d;
176 Q_PRIVATE_SLOT(d,
void minimumWidthChanged())
177 Q_PRIVATE_SLOT(d,
void minimumHeightChanged())
178 Q_PRIVATE_SLOT(d,
void preferredWidthChanged())
179 Q_PRIVATE_SLOT(d,
void preferredHeightChanged())
180 Q_PRIVATE_SLOT(d,
void maximumWidthChanged())
181 Q_PRIVATE_SLOT(d,
void maximumHeightChanged())
182 Q_PRIVATE_SLOT(d,
void fillWidthChanged())
183 Q_PRIVATE_SLOT(d,
void fillHeightChanged())
An object that instantiates an entire QML context, with its own declarative engine.
void init(KXmlGuiWindow *window, KGameDifficulty *difficulty=nullptr)
The EdgeEventForwarder class This class forwards edge events to be replayed within the given margin T...
Namespace for everything in libplasma.