5#include <qqmlregistration.h>
6#include "qml_material/export.hpp"
7#include "qml_material/input/nested_scroll_connection.hpp"
11class NestedScrollHandler;
13class QML_MATERIAL_API NestedScroll :
public QObject {
16 QML_UNCREATABLE(
"NestedScroll is an attached property")
17 QML_ATTACHED(NestedScroll)
18 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
19 Q_PROPERTY(Qt::Orientations axes READ axes WRITE setAxes NOTIFY axesChanged FINAL)
20 Q_PROPERTY(
bool wheelEnabled MEMBER m_wheelEnabled NOTIFY wheelEnabledChanged FINAL)
21 Q_PROPERTY(
bool restoreOnReverse MEMBER m_restoreOnReverse NOTIFY restoreOnReverseChanged FINAL)
22 Q_PROPERTY(NestedScrollConnection* connection READ connection WRITE setConnection NOTIFY
23 connectionChanged FINAL)
25 explicit NestedScroll(QObject* parent);
26 ~NestedScroll() override;
27 static NestedScroll* qmlAttachedProperties(QObject*);
28 static
bool coordinates(QQuickItem* receiver, QQuickItem* ancestor);
29 bool enabled()
const {
return m_enabled; }
30 void setEnabled(
bool);
31 Qt::Orientations axes()
const {
return m_axes; }
32 void setAxes(Qt::Orientations);
33 QQuickItem* item()
const {
return m_item; }
34 NestedScrollConnection* connection()
const {
return m_connection; }
35 void setConnection(NestedScrollConnection*);
36 Q_SIGNAL
void connectionChanged();
37 Q_SIGNAL
void enabledChanged();
38 Q_SIGNAL
void axesChanged();
39 Q_SIGNAL
void wheelEnabledChanged();
40 Q_SIGNAL
void restoreOnReverseChanged();
42 Q_SIGNAL
void scrollConsumed(QPointF delta);
43 Q_SIGNAL
void scrollStarted();
44 Q_SIGNAL
void scrollFinished(
bool cancelled);
47 friend class NestedScrollHandler;
48 QPointer<QQuickItem> m_item;
49 QPointer<NestedScrollHandler> m_handler;
50 QPointer<NestedScrollHandler> m_controller;
51 QPointer<NestedScrollConnection> m_connection;
52 QMetaObject::Connection m_connectionDestroyed;
53 bool m_enabled =
false;
54 bool m_wheelEnabled =
true;
55 bool m_restoreOnReverse =
false;
56 Qt::Orientations m_axes = Qt::Horizontal | Qt::Vertical;
60QML_DECLARE_TYPEINFO(qml_material::NestedScroll, QML_HAS_ATTACHED_PROPERTIES)