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:
49
50 QWaylandDisplay *m_display = nullptr;
51};
52
54{
55public:
56 explicit QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer);
58 void startReceiving(const QString &mimeType, int fd) override;
59 QMimeData *mimeData() override { return m_mimeData.get(); }
60
61protected:
62 void zwp_primary_selection_offer_v1_offer(const QString &mime_type) override;
63
64private:
66
67 QWaylandDisplay *m_display = nullptr;
68 std::unique_ptr<QWaylandMimeData> m_mimeData;
69};
70
92
94{
97
98public:
100 QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.get(); }
102 QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.get(); }
103 void setSelectionSource(QWaylandPrimarySelectionSourceV1 *source);
104
105protected:
106 void zwp_primary_selection_device_v1_data_offer(struct ::zwp_primary_selection_offer_v1 *offer) override;
107 void zwp_primary_selection_device_v1_selection(struct ::zwp_primary_selection_offer_v1 *id) override;
108
109private:
111
112 QWaylandDisplay *m_display = nullptr;
113 QWaylandInputDevice *m_seat = nullptr;
114 std::unique_ptr<QWaylandPrimarySelectionOfferV1> m_selectionOffer;
115 std::unique_ptr<QWaylandPrimarySelectionSourceV1> m_selectionSource;
117};
118
119} // namespace QtWaylandClient
120
121QT_END_NAMESPACE
122
123#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)