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 QQUICKPOPUPITEM_P_P_H
5#define QQUICKPOPUPITEM_P_P_H
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 <QtQuickTemplates2/private/qquickpage_p.h>
19#include <QtQuickTemplates2/private/qquickpage_p_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQuickPopup;
24class QQuickPopupItemPrivate;
25
26class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupItem : public QQuickPage
27{
28 Q_OBJECT
29
30public:
31 explicit QQuickPopupItem(QQuickPopup *popup);
32
33protected:
34 void updatePolish() override;
35
36 bool childMouseEventFilter(QQuickItem *child, QEvent *event) override;
37 void focusInEvent(QFocusEvent *event) override;
38 void focusOutEvent(QFocusEvent *event) override;
39 void keyPressEvent(QKeyEvent *event) override;
40 void keyReleaseEvent(QKeyEvent *event) override;
41 void mousePressEvent(QMouseEvent *event) override;
42 void mouseMoveEvent(QMouseEvent *event) override;
43 void mouseReleaseEvent(QMouseEvent *event) override;
44 void mouseDoubleClickEvent(QMouseEvent *event) override;
45 void mouseUngrabEvent() override;
46#if QT_CONFIG(quicktemplates2_multitouch)
47 void touchEvent(QTouchEvent *event) override;
48 void touchUngrabEvent() override;
49#endif
50#if QT_CONFIG(wheelevent)
51 void wheelEvent(QWheelEvent *event) override;
52#endif
53
54 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
55 void contentSizeChange(const QSizeF &newSize, const QSizeF &oldSize) override;
56 void fontChange(const QFont &newFont, const QFont &oldFont) override;
57 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
58 void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
59 void mirrorChange() override;
60 void itemChange(ItemChange change, const ItemChangeData &data) override;
61 void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override;
62 void enabledChange() override;
63
64 QFont defaultFont() const override;
65
66#if QT_CONFIG(accessibility)
67 QAccessible::Role accessibleRole() const override;
68 void accessibilityActiveChanged(bool active) override;
69#endif
70
71private:
72 Q_DISABLE_COPY(QQuickPopupItem)
73 Q_DECLARE_PRIVATE(QQuickPopupItem)
74 friend class QQuickPopup;
75};
76
77class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupItemPrivate : public QQuickPagePrivate
78{
79 Q_DECLARE_PUBLIC(QQuickPopupItem)
80
81public:
82 QQuickPopupItemPrivate(QQuickPopup *popup);
83
84 static QQuickPopupItemPrivate *get(QQuickPopupItem *popupItem);
85
86 void implicitWidthChanged() override;
87 void implicitHeightChanged() override;
88
89 void resolveFont() override;
90
91 QQuickItem *getContentItem() override;
92
93 void cancelContentItem() override;
94 void executeContentItem(bool complete = false) override;
95
96 void cancelBackground() override;
97 void executeBackground(bool complete = false) override;
98
99 QQuickPalette *palette() const override;
100 void setPalette(QQuickPalette* p) override;
101 void resetPalette() override;
102
103 QPalette defaultPalette() const override;
104 bool providesPalette() const override;
105
106 QPalette parentPalette(const QPalette &fallbackPalette) const override;
107
108 int backId = 0;
109 int escapeId = 0;
110 QQuickPopup *popup = nullptr;
111};
112
113QT_END_NAMESPACE
114
115#endif // QQUICKPOPUPITEM_P_P_H
116

source code of qtdeclarative/src/quicktemplates/qquickpopupitem_p_p.h