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
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// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDPRIMARYSELECTIONV1_P_H
6#define QWAYLANDPRIMARYSELECTIONV1_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtWaylandClient/private/qwayland-wp-primary-selection-unstable-v1.h>
20
21#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
22#include <QtWaylandClient/private/qwaylanddataoffer_p.h>
23
24#include <QtCore/QObject>
25
26#include <memory>
27
29
30QT_BEGIN_NAMESPACE
31
32class QMimeData;
33
34namespace QtWaylandClient {
35
36class QWaylandInputDevice;
38
40{
41public:
42 explicit QWaylandPrimarySelectionDeviceManagerV1(QWaylandDisplay *display, uint id, uint version);
44 QWaylandPrimarySelectionDeviceV1 *createDevice(QWaylandInputDevice *seat);
45 QWaylandDisplay *display() const { return m_display; }
46
47private:
48 QWaylandDisplay *m_display = nullptr;
49};
50
52{
53public:
54 explicit QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer);
56 void startReceiving(const QString &mimeType, int fd) override;
57 QMimeData *mimeData() override { return m_mimeData.get(); }
58
59protected:
60 void zwp_primary_selection_offer_v1_offer(const QString &mime_type) override;
61
62private:
63 QWaylandDisplay *m_display = nullptr;
64 std::unique_ptr<QWaylandMimeData> m_mimeData;
65};
66
86
88{
91
92public:
94 QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.get(); }
96 QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.get(); }
97 void setSelectionSource(QWaylandPrimarySelectionSourceV1 *source);
98
99protected:
100 void zwp_primary_selection_device_v1_data_offer(struct ::zwp_primary_selection_offer_v1 *offer) override;
101 void zwp_primary_selection_device_v1_selection(struct ::zwp_primary_selection_offer_v1 *id) override;
102
103private:
104 QWaylandDisplay *m_display = nullptr;
105 QWaylandInputDevice *m_seat = nullptr;
106 std::unique_ptr<QWaylandPrimarySelectionOfferV1> m_selectionOffer;
107 std::unique_ptr<QWaylandPrimarySelectionSourceV1> m_selectionSource;
109};
110
111} // namespace QtWaylandClient
112
113QT_END_NAMESPACE
114
115#endif // QWAYLANDPRIMARYSELECTIONV1_P_H
QWaylandPrimarySelectionDeviceManagerV1(QWaylandDisplay *display, uint id, uint version)
QWaylandPrimarySelectionDeviceV1 * createDevice(QWaylandInputDevice *seat)
QWaylandPrimarySelectionSourceV1 * selectionSource() const
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)
QT_REQUIRE_CONFIG(wayland_client_primary_selection)