Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylanddatadevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Klarälvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QWAYLANDDATADEVICE_H
7#define QWAYLANDDATADEVICE_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <qtwaylandclientglobal_p.h>
21#include <QObject>
22#include <QPointer>
23#include <QPoint>
24
25#include <QtWaylandClient/private/qwayland-wayland.h>
26
27#include <memory>
28
30
31QT_BEGIN_NAMESPACE
32
33class QMimeData;
34class QPlatformDragQtResponse;
35class QWindow;
36
37namespace QtWayland {
38class xdg_toplevel_drag_v1;
39}
40
41namespace QtWaylandClient {
42
43class QWaylandDisplay;
44class QWaylandDataDeviceManager;
45class QWaylandDataOffer;
46class QWaylandDataSource;
47class QWaylandInputDevice;
48class QWaylandWindow;
49
51{
53public:
56
57 QWaylandDataOffer *selectionOffer() const;
59 QWaylandDataSource *selectionSource() const;
60 void setSelectionSource(QWaylandDataSource *source);
61
62#if QT_CONFIG(draganddrop)
65 void cancelDrag();
66#endif
67
68protected:
69 void data_device_data_offer(struct ::wl_data_offer *id) override;
70
71#if QT_CONFIG(draganddrop)
76#endif
77 void data_device_selection(struct ::wl_data_offer *id) override;
78
79private Q_SLOTS:
81
82#if QT_CONFIG(draganddrop)
84#endif
85
86private:
87#if QT_CONFIG(draganddrop)
88 QPoint calculateDragPosition(int x, int y, QWindow *wnd) const;
89#endif
90 void sendResponse(Qt::DropActions supportedActions, const QPlatformDragQtResponse &response);
91
92 static int dropActionsToWl(Qt::DropActions dropActions);
93
94
95 QWaylandDisplay *m_display = nullptr;
96 QWaylandInputDevice *m_inputDevice = nullptr;
97 uint32_t m_enterSerial = 0;
98 QPointer<QWindow> m_dragWindow;
99 QPoint m_dragPoint;
100 std::unique_ptr<QWaylandDataOffer> m_dragOffer;
101 std::unique_ptr<QWaylandDataOffer> m_selectionOffer;
102 std::unique_ptr<QWaylandDataSource> m_selectionSource;
103 std::unique_ptr<QWaylandDataSource> m_dragSource;
104 QtWayland::xdg_toplevel_drag_v1 *m_toplevelDrag = nullptr;
105};
106
107}
108
109QT_END_NAMESPACE
110
111#endif // QWAYLANDDATADEVICE_H
virtual void startReceiving(const QString &mimeType, int fd)=0
QWaylandDataControlOfferV1 * selectionOffer() const
QWaylandDataControlOfferV1 * primarySelectionOffer() const
QWaylandDataControlSourceV1 * selectionSource() const
void setSelectionSource(QWaylandDataControlSourceV1 *source)
QWaylandDataControlSourceV1 * primarySelectionSource() const
void setPrimarySelectionSource(QWaylandDataControlSourceV1 *source)
QWaylandDataControlManagerV1(QWaylandDisplay *display, uint id, uint version)
QWaylandDataControlDeviceV1 * createDevice(QWaylandInputDevice *seat)
QWaylandDataControlOfferV1(QWaylandDisplay *display, ::zwlr_data_control_offer_v1 *offer)
void startReceiving(const QString &mimeType, int fd) override
void zwlr_data_control_offer_v1_offer(const QString &mime_type) override
QWaylandDataSource * selectionSource() const
QWaylandDataOffer * selectionOffer() const
void setSelectionSource(QWaylandDataSource *source)
QVariant retrieveData_sys(const QString &mimeType, QMetaType type) const override
void appendFormat(const QString &mimeType)
QStringList formats_sys() const override
QWaylandMimeData(QWaylandAbstractDataOffer *dataOffer)
bool hasFormat_sys(const QString &mimeType) const override
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG(liburing)
QT_REQUIRE_CONFIG(clipboard)