Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandprimaryselectionv1_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QWAYLANDPRIMARYSELECTIONV1_P_H
5#define QWAYLANDPRIMARYSELECTIONV1_P_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 <QtWaylandClient/private/qwayland-wp-primary-selection-unstable-v1.h>
19
20#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
21#include <QtWaylandClient/private/qwaylanddataoffer_p.h>
22
23#include <QtCore/QObject>
24
25QT_REQUIRE_CONFIG(wayland_client_primary_selection);
26
28
29class QMimeData;
30
31namespace QtWaylandClient {
32
33class QWaylandInputDevice;
34class QWaylandPrimarySelectionDeviceV1;
35
36class QWaylandPrimarySelectionDeviceManagerV1 : public QtWayland::zwp_primary_selection_device_manager_v1
37{
38public:
41 QWaylandDisplay *display() const { return m_display; }
42
43private:
44 QWaylandDisplay *m_display = nullptr;
45};
46
47class QWaylandPrimarySelectionOfferV1 : public QtWayland::zwp_primary_selection_offer_v1, public QWaylandAbstractDataOffer
48{
49public:
50 explicit QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer);
51 ~QWaylandPrimarySelectionOfferV1() override { destroy(); }
52 void startReceiving(const QString &mimeType, int fd) override;
53 QMimeData *mimeData() override { return m_mimeData.data(); }
54
55protected:
56 void zwp_primary_selection_offer_v1_offer(const QString &mime_type) override;
57
58private:
59 QWaylandDisplay *m_display = nullptr;
61};
62
63class Q_WAYLANDCLIENT_EXPORT QWaylandPrimarySelectionSourceV1 : public QObject, public QtWayland::zwp_primary_selection_source_v1
64{
66public:
69
70 QMimeData *mimeData() const { return m_mimeData; }
71
73 void cancelled();
74
75protected:
76 void zwp_primary_selection_source_v1_send(const QString &mime_type, int32_t fd) override;
78
79private:
80 QMimeData *m_mimeData = nullptr;
81};
82
83class QWaylandPrimarySelectionDeviceV1 : public QObject, public QtWayland::zwp_primary_selection_device_v1
84{
87
88public:
90 QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.data(); }
92 QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.data(); }
94
95protected:
96 void zwp_primary_selection_device_v1_data_offer(struct ::zwp_primary_selection_offer_v1 *offer) override;
97 void zwp_primary_selection_device_v1_selection(struct ::zwp_primary_selection_offer_v1 *id) override;
98
99private:
100 QWaylandDisplay *m_display = nullptr;
101 QWaylandInputDevice *m_seat = nullptr;
105};
106
107} // namespace QtWaylandClient
108
110
111#endif // QWAYLANDPRIMARYSELECTIONV1_P_H
bool cancelled
Definition btgcdtimer.mm:27
\inmodule QtCore
Definition qmimedata.h:16
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QWaylandPrimarySelectionDeviceV1 * createDevice(QWaylandInputDevice *seat)
QWaylandPrimarySelectionSourceV1 * selectionSource() const
void zwp_primary_selection_device_v1_selection(struct ::zwp_primary_selection_offer_v1 *id) override
void zwp_primary_selection_device_v1_data_offer(struct ::zwp_primary_selection_offer_v1 *offer) override
void setSelectionSource(QWaylandPrimarySelectionSourceV1 *source)
QWaylandPrimarySelectionOfferV1 * selectionOffer() const
void startReceiving(const QString &mimeType, int fd) override
void zwp_primary_selection_offer_v1_offer(const QString &mime_type) override
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
const char * mimeType
GLuint64 GLenum GLint fd
GLsizei GLsizei GLchar * source
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define signals
#define emit
unsigned int uint
Definition qtypes.h:29
QMimeData * mimeData
QNetworkAccessManager manager