| 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 QQUICKDRAWER_P_P_H |
| 5 | #define QQUICKDRAWER_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/qquickdrawer_p.h> |
| 19 | #include <QtQuickTemplates2/private/qquickpopup_p_p.h> |
| 20 | #include <QtQuickTemplates2/private/qquickvelocitycalculator_p_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QQuickDrawerPrivate : public QQuickPopupPrivate |
| 25 | { |
| 26 | Q_DECLARE_PUBLIC(QQuickDrawer) |
| 27 | |
| 28 | public: |
| 29 | static QQuickDrawerPrivate *get(QQuickDrawer *drawer) |
| 30 | { |
| 31 | return drawer->d_func(); |
| 32 | } |
| 33 | |
| 34 | qreal offsetAt(const QPointF &point) const; |
| 35 | qreal positionAt(const QPointF &point) const; |
| 36 | |
| 37 | QQuickPopupPositioner *getPositioner() override; |
| 38 | void showDimmer() override; |
| 39 | void hideDimmer() override; |
| 40 | void resizeDimmer() override; |
| 41 | |
| 42 | bool startDrag(QEvent *event); |
| 43 | bool grabMouse(QQuickItem *item, QMouseEvent *event); |
| 44 | #if QT_CONFIG(quicktemplates2_multitouch) |
| 45 | bool grabTouch(QQuickItem *item, QTouchEvent *event); |
| 46 | #endif |
| 47 | bool blockInput(QQuickItem *item, const QPointF &point) const override; |
| 48 | |
| 49 | bool handlePress(QQuickItem* item, const QPointF &point, ulong timestamp) override; |
| 50 | bool handleMove(QQuickItem* item, const QPointF &point, ulong timestamp) override; |
| 51 | bool handleRelease(QQuickItem* item, const QPointF &point, ulong timestamp) override; |
| 52 | void handleUngrab() override; |
| 53 | |
| 54 | bool prepareEnterTransition() override; |
| 55 | bool prepareExitTransition() override; |
| 56 | |
| 57 | QQuickPopup::PopupType () const override; |
| 58 | |
| 59 | bool setEdge(Qt::Edge edge); |
| 60 | Qt::Edge effectiveEdge() const; |
| 61 | bool isWithinDragMargin(const QPointF &point) const; |
| 62 | |
| 63 | Qt::Edge edge = Qt::LeftEdge; |
| 64 | qreal offset = 0; |
| 65 | qreal position = 0; |
| 66 | qreal dragMargin = 0; |
| 67 | QQuickVelocityCalculator velocityCalculator; |
| 68 | bool delayedEnterTransition = false; |
| 69 | }; |
| 70 | |
| 71 | QT_END_NAMESPACE |
| 72 | |
| 73 | #endif // QQUICKDRAWER_P_P_H |
| 74 | |