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 QQUICKSWIPE_P_H |
5 | #define QQUICKSWIPE_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 <QtCore/qobject.h> |
19 | #include <QtQuickTemplates2/private/qtquicktemplates2global_p.h> |
20 | #include <QtQuickTemplates2/private/qquickswipedelegate_p.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QQmlComponent; |
25 | class QQuickItem; |
26 | class QQuickTransition; |
27 | class QQuickSwipePrivate; |
28 | |
29 | class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipe : public QObject |
30 | { |
31 | Q_OBJECT |
32 | Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL) |
33 | Q_PROPERTY(bool complete READ isComplete NOTIFY completeChanged FINAL) |
34 | Q_PROPERTY(QQmlComponent *left READ left WRITE setLeft NOTIFY leftChanged FINAL) |
35 | Q_PROPERTY(QQmlComponent *behind READ behind WRITE setBehind NOTIFY behindChanged FINAL) |
36 | Q_PROPERTY(QQmlComponent *right READ right WRITE setRight NOTIFY rightChanged FINAL) |
37 | Q_PROPERTY(QQuickItem *leftItem READ leftItem NOTIFY leftItemChanged FINAL) |
38 | Q_PROPERTY(QQuickItem *behindItem READ behindItem NOTIFY behindItemChanged FINAL) |
39 | Q_PROPERTY(QQuickItem *rightItem READ rightItem NOTIFY rightItemChanged FINAL) |
40 | // 2.2 (Qt 5.9) |
41 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) // REVISION(2, 2) |
42 | Q_PROPERTY(QQuickTransition *transition READ transition WRITE setTransition NOTIFY transitionChanged FINAL) // REVISION(2, 2) |
43 | QML_ANONYMOUS |
44 | QML_ADDED_IN_VERSION(2, 0) |
45 | |
46 | public: |
47 | explicit QQuickSwipe(QQuickSwipeDelegate *control); |
48 | |
49 | qreal position() const; |
50 | void setPosition(qreal position); |
51 | |
52 | bool isComplete() const; |
53 | void setComplete(bool complete); |
54 | |
55 | QQmlComponent *left() const; |
56 | void setLeft(QQmlComponent *left); |
57 | |
58 | QQmlComponent *behind() const; |
59 | void setBehind(QQmlComponent *behind); |
60 | |
61 | QQmlComponent *right() const; |
62 | void setRight(QQmlComponent *right); |
63 | |
64 | QQuickItem *leftItem() const; |
65 | void setLeftItem(QQuickItem *item); |
66 | |
67 | QQuickItem *behindItem() const; |
68 | void setBehindItem(QQuickItem *item); |
69 | |
70 | QQuickItem *rightItem() const; |
71 | void setRightItem(QQuickItem *item); |
72 | |
73 | // 2.1 (Qt 5.8) |
74 | Q_REVISION(2, 1) Q_INVOKABLE void close(); |
75 | |
76 | // 2.2 (Qt 5.9) |
77 | bool isEnabled() const; |
78 | void setEnabled(bool enabled); |
79 | |
80 | QQuickTransition *transition() const; |
81 | void setTransition(QQuickTransition *transition); |
82 | |
83 | Q_REVISION(2, 2) Q_INVOKABLE void open(QQuickSwipeDelegate::Side side); |
84 | |
85 | Q_SIGNALS: |
86 | void positionChanged(); |
87 | void completeChanged(); |
88 | void leftChanged(); |
89 | void behindChanged(); |
90 | void rightChanged(); |
91 | void leftItemChanged(); |
92 | void behindItemChanged(); |
93 | void rightItemChanged(); |
94 | // 2.1 (Qt 5.8) |
95 | /*Q_REVISION(2, 1)*/ void completed(); |
96 | // 2.2 (Qt 5.9) |
97 | /*Q_REVISION(2, 2)*/ void opened(); |
98 | /*Q_REVISION(2, 2)*/ void closed(); |
99 | /*Q_REVISION(2, 2)*/ void enabledChanged(); |
100 | /*Q_REVISION(2, 2)*/ void transitionChanged(); |
101 | |
102 | private: |
103 | Q_DISABLE_COPY(QQuickSwipe) |
104 | Q_DECLARE_PRIVATE(QQuickSwipe) |
105 | }; |
106 | |
107 | QT_END_NAMESPACE |
108 | |
109 | #endif // QQUICKSWIPE_P_H |
110 | |