Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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:
42 QWaylandDisplay *display() const { return m_display; }
43
44private:
45 QWaylandDisplay *m_display = nullptr;
46};
47
48class QWaylandPrimarySelectionOfferV1 : public QtWayland::zwp_primary_selection_offer_v1, public QWaylandAbstractDataOffer
49{
50public:
51 explicit QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer);
52 ~QWaylandPrimarySelectionOfferV1() override { destroy(); }
53 void startReceiving(const QString &mimeType, int fd) override;
54 QMimeData *mimeData() override { return m_mimeData.data(); }
55
56protected:
57 void zwp_primary_selection_offer_v1_offer(const QString &mime_type) override;
58
59private:
60 QWaylandDisplay *m_display = nullptr;
61 QScopedPointer<QWaylandMimeData> m_mimeData;
62};
63
64class Q_WAYLANDCLIENT_EXPORT QWaylandPrimarySelectionSourceV1 : public QObject, public QtWayland::zwp_primary_selection_source_v1
65{
67public:
70
71 QMimeData *mimeData() const { return m_mimeData; }
72
74 void cancelled();
75
76protected:
77 void zwp_primary_selection_source_v1_send(const QString &mime_type, int32_t fd) override;
79
80private:
81 QMimeData *m_mimeData = nullptr;
82};
83
84class QWaylandPrimarySelectionDeviceV1 : public QObject, public QtWayland::zwp_primary_selection_device_v1
85{
88
89public:
91 QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.data(); }
93 QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.data(); }
95
96protected:
97 void zwp_primary_selection_device_v1_data_offer(struct ::zwp_primary_selection_offer_v1 *offer) override;
98 void zwp_primary_selection_device_v1_selection(struct ::zwp_primary_selection_offer_v1 *id) override;
99
100private:
101 QWaylandDisplay *m_display = nullptr;
102 QWaylandInputDevice *m_seat = nullptr;
103 QScopedPointer<QWaylandPrimarySelectionOfferV1> m_selectionOffer;
104 QScopedPointer<QWaylandPrimarySelectionSourceV1> m_selectionSource;
106};
107
108} // namespace QtWaylandClient
109
111
112#endif // QWAYLANDPRIMARYSELECTIONV1_P_H
bool cancelled
Definition btgcdtimer.mm:27
\inmodule QtCore
Definition qmimedata.h:16
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QWaylandPrimarySelectionDeviceManagerV1(QWaylandDisplay *display, uint id, uint version)
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
QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer)
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 Q_SIGNALS
#define emit
unsigned int uint
Definition qtypes.h:34
QMimeData * mimeData
QNetworkAccessManager manager