/**************************************************************************** ** ** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ****************************************************************************/ #ifndef QQUICKSTACKVIEW_P_P_H #define QQUICKSTACKVIEW_P_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class QQmlContextData; class QQuickStackElement; struct QQuickStackTransition; class QQuickStackViewPrivate : public QQuickControlPrivate, public QQuickItemViewTransitionChangeListener { Q_DECLARE_PUBLIC(QQuickStackView) public: static QQuickStackViewPrivate *get(QQuickStackView *view) { return view->d_func(); } void warn(const QString &error); void warnOfInterruption(const QString &attemptedOperation); void setCurrentItem(QQuickStackElement *element); QList parseElements(int from, QQmlV4Function *args, QStringList *errors); QQuickStackElement *findElement(QQuickItem *item) const; QQuickStackElement *findElement(const QV4::Value &value) const; QQuickStackElement *createElement(const QV4::Value &value, QQmlContextData *context, QString *error); bool pushElements(const QList &elements); bool pushElement(QQuickStackElement *element); bool popElements(QQuickStackElement *element); bool replaceElements(QQuickStackElement *element, const QList &elements); void ensureTransitioner(); void startTransition(const QQuickStackTransition &first, const QQuickStackTransition &second, bool immediate); void completeTransition(QQuickStackElement *element, QQuickTransition *transition, QQuickStackView::Status status); void viewItemTransitionFinished(QQuickItemViewTransitionableItem *item) override; void setBusy(bool busy); void depthChange(int newDepth, int oldDepth); bool busy = false; bool modifyingElements = false; QString operation; QJSValue initialItem; QQuickItem *currentItem = nullptr; QSet removing; QList removed; QStack elements; QQuickItemViewTransitioner *transitioner = nullptr; }; class QQuickStackViewAttachedPrivate : public QObjectPrivate, public QQuickItemChangeListener { Q_DECLARE_PUBLIC(QQuickStackViewAttached) public: static QQuickStackViewAttachedPrivate *get(QQuickStackViewAttached *attached) { return attached->d_func(); } void itemParentChanged(QQuickItem *item, QQuickItem *parent) override; bool explicitVisible = false; QQuickStackElement *element = nullptr; }; QT_END_NAMESPACE #endif // QQUICKSTACKVIEW_P_P_H