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 QQUICKSTACKELEMENT_P_P_H
5#define QQUICKSTACKELEMENT_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/qquickstackview_p.h>
19#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
20#if QT_CONFIG(quick_viewtransitions)
21#include <QtQuick/private/qquickitemviewtransition_p.h>
22#endif
23#include <QtQuick/private/qquickitemchangelistener_p.h>
24#include <QtQml/private/qv4persistent_p.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQmlContext;
29class QQmlComponent;
30struct QQuickStackTransition;
31class RequiredProperties;
32
33class QQuickStackElement :
34#if QT_CONFIG(quick_viewtransitions)
35 public QQuickItemViewTransitionableItem,
36#endif
37 public QQuickItemChangeListener
38{
39 QQuickStackElement();
40
41public:
42 ~QQuickStackElement();
43
44 static QQuickStackElement *fromString(const QString &str, QQuickStackView *view, QString *error);
45 static QQuickStackElement *fromObject(QObject *object, QQuickStackView *view, QString *error);
46
47 bool load(QQuickStackView *parent);
48 void incubate(QObject *object, RequiredProperties *requiredProperties);
49 void initialize(RequiredProperties *requiredProperties);
50
51 void setIndex(int index);
52 void setView(QQuickStackView *view);
53 void setStatus(QQuickStackView::Status status);
54 void setVisible(bool visible);
55
56#if QT_CONFIG(quick_viewtransitions)
57 void transitionNextReposition(QQuickItemViewTransitioner *transitioner, QQuickItemViewTransitioner::TransitionType type, bool asTarget);
58 bool prepareTransition(QQuickItemViewTransitioner *transitioner, const QRectF &viewBounds);
59 void startTransition(QQuickItemViewTransitioner *transitioner, QQuickStackView::Status status);
60 void completeTransition(QQuickTransition *quickTransition);
61#endif
62
63 void itemDestroyed(QQuickItem *item) override;
64
65 int index = -1;
66 bool init = false;
67 bool removal = false;
68 bool ownItem = false;
69 bool ownComponent = false;
70 bool widthValid = false;
71 bool heightValid = false;
72 QQmlComponent *component = nullptr;
73 QQuickStackView *view = nullptr;
74 QPointer<QQuickItem> originalParent;
75 QQuickStackView::Status status = QQuickStackView::Inactive;
76 QV4::PersistentValue properties;
77 QV4::PersistentValue qmlCallingContext;
78#if !QT_CONFIG(quick_viewtransitions)
79 QQuickItem *item;
80#endif
81};
82
83QT_END_NAMESPACE
84
85#endif // QQUICKSTACKELEMENT_P_P_H
86

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