1 | // Copyright (C) 2017 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKPOPUP_P_H |
5 | #define |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtCore/qobject.h> |
19 | #include <QtCore/qmargins.h> |
20 | #include <QtGui/qevent.h> |
21 | #include <QtCore/qlocale.h> |
22 | #include <QtGui/qfont.h> |
23 | #include <QtGui/qpalette.h> |
24 | #include <QtQuickTemplates2/private/qtquicktemplates2global_p.h> |
25 | #include <QtQml/qqml.h> |
26 | #include <QtQml/qqmllist.h> |
27 | #include <QtQml/qqmlparserstatus.h> |
28 | #include <QtQuick/qquickitem.h> |
29 | |
30 | #if QT_CONFIG(accessibility) |
31 | #include <QtGui/qaccessible.h> |
32 | #endif |
33 | |
34 | QT_BEGIN_NAMESPACE |
35 | |
36 | class QQuickWindow; |
37 | class ; |
38 | class ; |
39 | class QQuickTransition; |
40 | |
41 | class Q_QUICKTEMPLATES2_PRIVATE_EXPORT : public QObject, public QQmlParserStatus |
42 | { |
43 | Q_OBJECT |
44 | Q_INTERFACES(QQmlParserStatus) |
45 | Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL) |
46 | Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL) |
47 | Q_PROPERTY(qreal z READ z WRITE setZ RESET resetZ NOTIFY zChanged FINAL) |
48 | Q_PROPERTY(qreal width READ width WRITE setWidth RESET resetWidth NOTIFY widthChanged FINAL) |
49 | Q_PROPERTY(qreal height READ height WRITE setHeight RESET resetHeight NOTIFY heightChanged FINAL) |
50 | Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged FINAL) |
51 | Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged FINAL) |
52 | Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL) |
53 | Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL) |
54 | Q_PROPERTY(qreal availableWidth READ availableWidth NOTIFY availableWidthChanged FINAL) |
55 | Q_PROPERTY(qreal availableHeight READ availableHeight NOTIFY availableHeightChanged FINAL) |
56 | Q_PROPERTY(qreal margins READ margins WRITE setMargins RESET resetMargins NOTIFY marginsChanged FINAL) |
57 | Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin RESET resetTopMargin NOTIFY topMarginChanged FINAL) |
58 | Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin RESET resetLeftMargin NOTIFY leftMarginChanged FINAL) |
59 | Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin RESET resetRightMargin NOTIFY rightMarginChanged FINAL) |
60 | Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin RESET resetBottomMargin NOTIFY bottomMarginChanged FINAL) |
61 | Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged FINAL) |
62 | Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged FINAL) |
63 | Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding NOTIFY leftPaddingChanged FINAL) |
64 | Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged FINAL) |
65 | Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged FINAL) |
66 | Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET resetLocale NOTIFY localeChanged FINAL) |
67 | Q_PROPERTY(QFont font READ font WRITE setFont RESET resetFont NOTIFY fontChanged FINAL) |
68 | Q_PROPERTY(QQuickItem *parent READ parentItem WRITE setParentItem RESET resetParentItem NOTIFY parentChanged FINAL) |
69 | Q_PROPERTY(QQuickItem *background READ background WRITE setBackground NOTIFY backgroundChanged FINAL) |
70 | Q_PROPERTY(QQuickItem *contentItem READ contentItem WRITE setContentItem NOTIFY contentItemChanged FINAL) |
71 | Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQmlListProperty<QObject> contentData READ contentData) |
72 | Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQmlListProperty<QQuickItem> contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL) |
73 | Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged FINAL) |
74 | Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL) |
75 | Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged FINAL) |
76 | Q_PROPERTY(bool modal READ isModal WRITE setModal NOTIFY modalChanged FINAL) |
77 | Q_PROPERTY(bool dim READ dim WRITE setDim RESET resetDim NOTIFY dimChanged FINAL) |
78 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
79 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL) |
80 | Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged FINAL) |
81 | Q_PROPERTY(ClosePolicy closePolicy READ closePolicy WRITE setClosePolicy RESET resetClosePolicy NOTIFY closePolicyChanged FINAL) |
82 | Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin FINAL) |
83 | Q_PROPERTY(QQuickTransition *enter READ enter WRITE setEnter NOTIFY enterChanged FINAL) |
84 | Q_PROPERTY(QQuickTransition *exit READ exit WRITE setExit NOTIFY exitChanged FINAL) |
85 | // 2.1 (Qt 5.8) |
86 | Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing RESET resetSpacing NOTIFY spacingChanged FINAL REVISION(2, 1)) |
87 | // 2.3 (Qt 5.10) |
88 | Q_PROPERTY(bool opened READ isOpened NOTIFY openedChanged FINAL REVISION(2, 3)) |
89 | Q_PROPERTY(bool mirrored READ isMirrored NOTIFY mirroredChanged FINAL REVISION(2, 3)) |
90 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL REVISION(2, 3)) |
91 | Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQuickPalette *palette READ palette WRITE setPalette RESET resetPalette NOTIFY paletteChanged REVISION(2, 3)) |
92 | // 2.5 (Qt 5.12) |
93 | Q_PROPERTY(qreal horizontalPadding READ horizontalPadding WRITE setHorizontalPadding RESET resetHorizontalPadding NOTIFY horizontalPaddingChanged FINAL) |
94 | Q_PROPERTY(qreal verticalPadding READ verticalPadding WRITE setVerticalPadding RESET resetVerticalPadding NOTIFY verticalPaddingChanged FINAL) |
95 | Q_PRIVATE_PROPERTY(QQuickPopup::d_func(), QQuickPopupAnchors *anchors READ getAnchors DESIGNABLE false CONSTANT FINAL REVISION(2, 5)) |
96 | Q_PROPERTY(qreal implicitContentWidth READ implicitContentWidth NOTIFY implicitContentWidthChanged FINAL REVISION(2, 5)) |
97 | Q_PROPERTY(qreal implicitContentHeight READ implicitContentHeight NOTIFY implicitContentHeightChanged FINAL REVISION(2, 5)) |
98 | Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION(2, 5)) |
99 | Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION(2, 5)) |
100 | Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION(2, 5)) |
101 | Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION(2, 5)) |
102 | Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION(2, 5)) |
103 | Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION(2, 5)) |
104 | Q_CLASSINFO("DeferredPropertyNames" , "background,contentItem" ) |
105 | Q_CLASSINFO("DefaultProperty" , "contentData" ) |
106 | QML_NAMED_ELEMENT(Popup) |
107 | QML_ADDED_IN_VERSION(2, 0) |
108 | |
109 | public: |
110 | explicit (QObject *parent = nullptr); |
111 | (); |
112 | |
113 | qreal () const; |
114 | void (qreal x); |
115 | |
116 | qreal () const; |
117 | void (qreal y); |
118 | |
119 | QPointF () const; |
120 | void (const QPointF &pos); |
121 | |
122 | qreal () const; |
123 | void (qreal z); |
124 | void (); |
125 | |
126 | qreal () const; |
127 | void (qreal width); |
128 | void (); |
129 | |
130 | qreal () const; |
131 | void (qreal height); |
132 | void (); |
133 | |
134 | qreal () const; |
135 | void (qreal width); |
136 | |
137 | qreal () const; |
138 | void (qreal height); |
139 | |
140 | qreal () const; |
141 | void (qreal width); |
142 | |
143 | qreal () const; |
144 | void (qreal height); |
145 | |
146 | qreal () const; |
147 | qreal () const; |
148 | |
149 | qreal () const; |
150 | void (qreal margins); |
151 | void (); |
152 | |
153 | qreal () const; |
154 | void (qreal margin); |
155 | void (); |
156 | |
157 | qreal () const; |
158 | void (qreal margin); |
159 | void (); |
160 | |
161 | qreal () const; |
162 | void (qreal margin); |
163 | void (); |
164 | |
165 | qreal () const; |
166 | void (qreal margin); |
167 | void (); |
168 | |
169 | qreal () const; |
170 | void (qreal padding); |
171 | void (); |
172 | |
173 | qreal () const; |
174 | void (qreal padding); |
175 | void (); |
176 | |
177 | qreal () const; |
178 | void (qreal padding); |
179 | void (); |
180 | |
181 | qreal () const; |
182 | void (qreal padding); |
183 | void (); |
184 | |
185 | qreal () const; |
186 | void (qreal padding); |
187 | void (); |
188 | |
189 | QLocale () const; |
190 | void (const QLocale &locale); |
191 | void (); |
192 | |
193 | QFont () const; |
194 | void (const QFont &font); |
195 | void (); |
196 | |
197 | QQuickWindow *() const; |
198 | QQuickItem *() const; |
199 | |
200 | QQuickItem *() const; |
201 | void (QQuickItem *parent); |
202 | void (); |
203 | |
204 | QQuickItem *() const; |
205 | void (QQuickItem *background); |
206 | |
207 | QQuickItem *() const; |
208 | void (QQuickItem *item); |
209 | |
210 | bool () const; |
211 | void (bool clip); |
212 | |
213 | bool () const; |
214 | void (bool focus); |
215 | |
216 | bool () const; |
217 | |
218 | bool () const; |
219 | void (bool modal); |
220 | |
221 | bool () const; |
222 | void (bool dim); |
223 | void (); |
224 | |
225 | bool () const; |
226 | virtual void (bool visible); |
227 | |
228 | qreal () const; |
229 | void (qreal opacity); |
230 | |
231 | qreal () const; |
232 | void (qreal scale); |
233 | |
234 | enum { |
235 | = 0x00, |
236 | = 0x01, |
237 | = 0x02, |
238 | = 0x04, |
239 | = 0x08, |
240 | = 0x10 |
241 | }; |
242 | Q_DECLARE_FLAGS(, ClosePolicyFlag) |
243 | Q_FLAG(ClosePolicy) |
244 | |
245 | ClosePolicy () const; |
246 | void (ClosePolicy policy); |
247 | void (); |
248 | |
249 | // keep in sync with Item.TransformOrigin |
250 | enum { |
251 | , , , |
252 | , , , |
253 | , , |
254 | }; |
255 | Q_ENUM(TransformOrigin) |
256 | |
257 | TransformOrigin () const; |
258 | void (TransformOrigin); |
259 | |
260 | QQuickTransition *() const; |
261 | void (QQuickTransition *transition); |
262 | |
263 | QQuickTransition *() const; |
264 | void (QQuickTransition *transition); |
265 | |
266 | bool () const; |
267 | void (bool filter); |
268 | |
269 | Q_INVOKABLE void (Qt::FocusReason reason = Qt::OtherFocusReason); |
270 | |
271 | // 2.1 (Qt 5.8) |
272 | qreal () const; |
273 | void (qreal spacing); |
274 | void (); |
275 | |
276 | // 2.3 (Qt 5.10) |
277 | bool () const; |
278 | bool () const; |
279 | |
280 | bool () const; |
281 | void (bool enabled); |
282 | |
283 | // 2.5 (Qt 5.12) |
284 | qreal () const; |
285 | void (qreal padding); |
286 | void (); |
287 | |
288 | qreal () const; |
289 | void (qreal padding); |
290 | void (); |
291 | |
292 | qreal () const; |
293 | qreal () const; |
294 | |
295 | qreal () const; |
296 | qreal () const; |
297 | |
298 | qreal () const; |
299 | void (qreal inset); |
300 | void (); |
301 | |
302 | qreal () const; |
303 | void (qreal inset); |
304 | void (); |
305 | |
306 | qreal () const; |
307 | void (qreal inset); |
308 | void (); |
309 | |
310 | qreal () const; |
311 | void (qreal inset); |
312 | void (); |
313 | |
314 | public Q_SLOTS: |
315 | void (); |
316 | void (); |
317 | |
318 | Q_SIGNALS: |
319 | void (); |
320 | void (); |
321 | void (); |
322 | void (); |
323 | void (); |
324 | void (); |
325 | void (); |
326 | void (); |
327 | void (); |
328 | void (); |
329 | void (); |
330 | void (); |
331 | void (); |
332 | void (); |
333 | void (); |
334 | void (); |
335 | void (); |
336 | void (); |
337 | void (); |
338 | void (); |
339 | void (); |
340 | void (); |
341 | void (); |
342 | void (); |
343 | void (); |
344 | void (); |
345 | void (); |
346 | void (); |
347 | void (); |
348 | void (); |
349 | void (); |
350 | void (); |
351 | void (); |
352 | void (); |
353 | void (); |
354 | void (); |
355 | void (); |
356 | void (); |
357 | void (); |
358 | void (); |
359 | void (); |
360 | void (); |
361 | void (QQuickWindow *window); |
362 | // 2.1 (Qt 5.8) |
363 | Q_REVISION(2, 1) void (); |
364 | // 2.3 (Qt 5.10) |
365 | Q_REVISION(2, 3) void (); |
366 | Q_REVISION(2, 3) void (); |
367 | Q_REVISION(2, 3) void (); |
368 | Q_REVISION(2, 3) void (); |
369 | Q_REVISION(2, 3) void (); |
370 | // 2.5 (Qt 5.12) |
371 | Q_REVISION(2, 5) void (); |
372 | Q_REVISION(2, 5) void (); |
373 | Q_REVISION(2, 5) void (); |
374 | Q_REVISION(2, 5) void (); |
375 | Q_REVISION(2, 5) void (); |
376 | Q_REVISION(2, 5) void (); |
377 | Q_REVISION(2, 5) void (); |
378 | Q_REVISION(2, 5) void (); |
379 | Q_REVISION(2, 5) void (); |
380 | Q_REVISION(2, 5) void (); |
381 | |
382 | protected: |
383 | (QQuickPopupPrivate &dd, QObject *parent); |
384 | |
385 | void () override; |
386 | void () override; |
387 | bool () const; |
388 | |
389 | virtual bool (QQuickItem *child, QEvent *event); |
390 | virtual void (QFocusEvent *event); |
391 | virtual void (QFocusEvent *event); |
392 | virtual void (QKeyEvent *event); |
393 | virtual void (QKeyEvent *event); |
394 | virtual void (QMouseEvent *event); |
395 | virtual void (QMouseEvent *event); |
396 | virtual void (QMouseEvent *event); |
397 | virtual void (QMouseEvent *event); |
398 | virtual void (); |
399 | virtual bool (QQuickItem *item, QEvent *event); |
400 | #if QT_CONFIG(quicktemplates2_multitouch) |
401 | virtual void (QTouchEvent *event); |
402 | virtual void (); |
403 | #endif |
404 | #if QT_CONFIG(wheelevent) |
405 | virtual void (QWheelEvent *event); |
406 | #endif |
407 | |
408 | virtual void (QQuickItem *newItem, QQuickItem *oldItem); |
409 | virtual void (const QSizeF &newSize, const QSizeF &oldSize); |
410 | virtual void (const QFont &newFont, const QFont &oldFont); |
411 | virtual void (const QRectF &newGeometry, const QRectF &oldGeometry); |
412 | virtual void (const QLocale &newLocale, const QLocale &oldLocale); |
413 | virtual void (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data); |
414 | virtual void (const QMarginsF &newMargins, const QMarginsF &oldMargins); |
415 | virtual void (const QMarginsF &newPadding, const QMarginsF &oldPadding); |
416 | virtual void (qreal newSpacing, qreal oldSpacing); |
417 | virtual void (const QMarginsF &newInset, const QMarginsF &oldInset); |
418 | |
419 | virtual QFont () const; |
420 | |
421 | #if QT_CONFIG(accessibility) |
422 | QAccessible::Role () const; |
423 | private: |
424 | virtual QAccessible::Role () const; |
425 | protected: |
426 | virtual void (bool active); |
427 | #endif |
428 | |
429 | QString () const; |
430 | void (const QString &name); |
431 | |
432 | QVariant (const char *propertyName); |
433 | bool (const char *propertyName, const QVariant &value); |
434 | |
435 | private: |
436 | Q_DISABLE_COPY() |
437 | Q_DECLARE_PRIVATE(QQuickPopup) |
438 | friend class ; |
439 | friend class QQuickOverlay; |
440 | friend class QQuickOverlayPrivate; |
441 | }; |
442 | |
443 | Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPopup::ClosePolicy) |
444 | |
445 | QT_END_NAMESPACE |
446 | |
447 | QML_DECLARE_TYPE(QQuickPopup) |
448 | |
449 | #endif // QQUICKPOPUP_P_H |
450 | |