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
22QT_BEGIN_NAMESPACE
23
24class QQuickDrawerPrivate : public QQuickPopupPrivate
25{
26 Q_DECLARE_PUBLIC(QQuickDrawer)
27
28public:
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 showOverlay() override;
39 void hideOverlay() override;
40 void resizeOverlay() 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 bool setEdge(Qt::Edge edge);
58
59 Qt::Edge edge = Qt::LeftEdge;
60 qreal offset = 0;
61 qreal position = 0;
62 qreal dragMargin = 0;
63 QQuickVelocityCalculator velocityCalculator;
64 bool delayedEnterTransition = false;
65};
66
67QT_END_NAMESPACE
68
69#endif // QQUICKDRAWER_P_P_H
70

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