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
28
29QT_BEGIN_NAMESPACE
30
31class QMimeData;
32class QPlatformDragQtResponse;
33class QWindow;
34
35namespace QtWayland {
36class xdg_toplevel_drag_v1;
37}
38
39namespace QtWaylandClient {
40
41class QWaylandDisplay;
42class QWaylandDataDeviceManager;
43class QWaylandDataOffer;
44class QWaylandDataSource;
45class QWaylandInputDevice;
46class QWaylandWindow;
47
49{
51public:
54
55 QWaylandDataOffer *selectionOffer() const;
57 QWaylandDataSource *selectionSource() const;
58 void setSelectionSource(QWaylandDataSource *source);
59
60#if QT_CONFIG(draganddrop)
63 void cancelDrag();
64#endif
65
66protected:
67 void data_device_data_offer(struct ::wl_data_offer *id) override;
68
69#if QT_CONFIG(draganddrop)
74#endif
75 void data_device_selection(struct ::wl_data_offer *id) override;
76
77private Q_SLOTS:
79
80#if QT_CONFIG(draganddrop)
82#endif
83
84private:
85#if QT_CONFIG(draganddrop)
86 QPoint calculateDragPosition(int x, int y, QWindow *wnd) const;
87#endif
88 void sendResponse(Qt::DropActions supportedActions, const QPlatformDragQtResponse &response);
89
90 static int dropActionsToWl(Qt::DropActions dropActions);
91
92
93 QWaylandDisplay *m_display = nullptr;
94 QWaylandInputDevice *m_inputDevice = nullptr;
95 uint32_t m_enterSerial = 0;
96 QPointer<QWindow> m_dragWindow;
97 QPoint m_dragPoint;
98 QScopedPointer<QWaylandDataOffer> m_dragOffer;
99 QScopedPointer<QWaylandDataOffer> m_selectionOffer;
100 QScopedPointer<QWaylandDataSource> m_selectionSource;
101 QScopedPointer<QWaylandDataSource> m_dragSource;
102 QtWayland::xdg_toplevel_drag_v1 *m_toplevelDrag = nullptr;
103};
104
105}
106
107QT_END_NAMESPACE
108
109#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)