1// Copyright (C) 2016 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 QWAYLANDDND_H
5#define QWAYLANDDND_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 <qpa/qplatformdrag.h>
19#include <QtGui/private/qsimpledrag_p.h>
20
21#include <QtGui/QDrag>
22#include <QtCore/QMimeData>
23
24#include <QtWaylandClient/qtwaylandclientglobal.h>
25
26QT_BEGIN_NAMESPACE
27
28namespace QtWaylandClient {
29
30class QWaylandDisplay;
31#if QT_CONFIG(draganddrop)
32class Q_WAYLANDCLIENT_EXPORT QWaylandDrag : public QBasicDrag
33{
34public:
35 QWaylandDrag(QWaylandDisplay *display);
36 ~QWaylandDrag() override;
37
38 void setResponse(bool accepted);
39 void setResponse(const QPlatformDropQtResponse &response);
40 void setDropResponse(const QPlatformDropQtResponse &response);
41 void finishDrag();
42
43protected:
44 void startDrag() override;
45 void cancel() override;
46 void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override;
47 void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override;
48 void endDrag() override;
49
50 bool ownsDragObject() const override;
51
52private:
53 QWaylandDisplay *m_display = nullptr;
54};
55#endif
56}
57
58QT_END_NAMESPACE
59
60#endif // QWAYLANDDND_H
61

source code of qtwayland/src/client/qwaylanddnd_p.h