1 | // Copyright (C) 2018 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 QQUICKFXVIEWITEM_P_P_H |
5 | #define QQUICKFXVIEWITEM_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 <QtQuick/private/qtquickglobal_p.h> |
19 | #include <QtQuick/private/qquickitem_p.h> |
20 | #if QT_CONFIG(quick_viewtransitions) |
21 | #include <QtQuick/private/qquickitemviewtransition_p.h> |
22 | #endif |
23 | #include <private/qanimationjobutil_p.h> |
24 | |
25 | QT_REQUIRE_CONFIG(quick_itemview); |
26 | |
27 | QT_BEGIN_NAMESPACE |
28 | |
29 | class Q_QUICK_PRIVATE_EXPORT QQuickItemViewFxItem |
30 | { |
31 | public: |
32 | QQuickItemViewFxItem(QQuickItem *item, bool ownItem, QQuickItemChangeListener *changeListener); |
33 | virtual ~QQuickItemViewFxItem(); |
34 | |
35 | qreal itemX() const; |
36 | qreal itemY() const; |
37 | inline qreal itemWidth() const { return item ? item->width() : 0; } |
38 | inline qreal itemHeight() const { return item ? item->height() : 0; } |
39 | |
40 | void moveTo(const QPointF &pos, bool immediate); |
41 | void setVisible(bool visible); |
42 | void trackGeometry(bool track); |
43 | |
44 | QRectF geometry() const; |
45 | void setGeometry(const QRectF &geometry); |
46 | |
47 | #if QT_CONFIG(quick_viewtransitions) |
48 | QQuickItemViewTransitioner::TransitionType scheduledTransitionType() const; |
49 | bool transitionScheduledOrRunning() const; |
50 | bool transitionRunning() const; |
51 | bool isPendingRemoval() const; |
52 | |
53 | void transitionNextReposition(QQuickItemViewTransitioner *transitioner, QQuickItemViewTransitioner::TransitionType type, bool asTarget); |
54 | bool prepareTransition(QQuickItemViewTransitioner *transitioner, const QRectF &viewBounds); |
55 | void startTransition(QQuickItemViewTransitioner *transitioner); |
56 | #endif |
57 | |
58 | // these are positions and sizes along the current direction of scrolling/flicking |
59 | virtual qreal position() const = 0; |
60 | virtual qreal endPosition() const = 0; |
61 | virtual qreal size() const = 0; |
62 | virtual qreal sectionSize() const = 0; |
63 | |
64 | virtual bool contains(qreal x, qreal y) const = 0; |
65 | |
66 | SelfDeletable m_selfDeletable; |
67 | QPointer<QQuickItem> item; |
68 | QQuickItemChangeListener *changeListener; |
69 | #if QT_CONFIG(quick_viewtransitions) |
70 | QQuickItemViewTransitionableItem *transitionableItem; |
71 | #endif |
72 | int index = -1; |
73 | bool ownItem : 1; |
74 | bool releaseAfterTransition : 1; |
75 | bool trackGeom : 1; |
76 | }; |
77 | |
78 | QT_END_NAMESPACE |
79 | |
80 | #endif // QQUICKFXVIEWITEM_P_P_H |
81 | |