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