1// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDDRAG_H
5#define QWAYLANDDRAG_H
6
7#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
8#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
9
10#include <QtCore/QObject>
11#include <QtCore/QPointF>
12
13QT_REQUIRE_CONFIG(draganddrop);
14
15QT_BEGIN_NAMESPACE
16
17class QWaylandDragPrivate;
18class QWaylandSurface;
19class QWaylandSeat;
20
21class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandDrag : public QObject
22{
23 Q_OBJECT
24 Q_DECLARE_PRIVATE(QWaylandDrag)
25
26 Q_PROPERTY(QWaylandSurface *icon READ icon NOTIFY iconChanged)
27 Q_PROPERTY(bool visible READ visible NOTIFY iconChanged)
28 Q_MOC_INCLUDE("qwaylandsurface.h")
29
30 QML_NAMED_ELEMENT(WaylandDrag)
31 QML_ADDED_IN_VERSION(1, 0)
32 QML_UNCREATABLE("")
33public:
34 explicit QWaylandDrag(QWaylandSeat *seat);
35
36 QWaylandSurface *icon() const;
37 QWaylandSurface *origin() const;
38 QWaylandSeat *seat() const;
39 bool visible() const;
40
41public Q_SLOTS:
42 void dragMove(QWaylandSurface *target, const QPointF &pos);
43 void drop();
44 void cancelDrag();
45
46Q_SIGNALS:
47 void iconChanged();
48 void dragStarted(); // QWaylandSurface *icon????
49};
50
51QT_END_NAMESPACE
52
53#endif // QWAYLANDDRAG_H
54

source code of qtwayland/src/compositor/compositor_api/qwaylanddrag.h