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
27
28QT_BEGIN_NAMESPACE
29
30class QMimeData;
31
32namespace QtWaylandClient {
33
34class QWaylandInputDevice;
36
38{
39public:
40 explicit QWaylandPrimarySelectionDeviceManagerV1(QWaylandDisplay *display, uint id, uint version);
42 QWaylandPrimarySelectionDeviceV1 *createDevice(QWaylandInputDevice *seat);
43 QWaylandDisplay *display() const { return m_display; }
44
45private:
46 QWaylandDisplay *m_display = nullptr;
47};
48
50{
51public:
52 explicit QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer);
54 void startReceiving(const QString &mimeType, int fd) override;
55 QMimeData *mimeData() override { return m_mimeData.data(); }
56
57protected:
58 void zwp_primary_selection_offer_v1_offer(const QString &mime_type) override;
59
60private:
61 QWaylandDisplay *m_display = nullptr;
62 QScopedPointer<QWaylandMimeData> m_mimeData;
63};
64
84
86{
89
90public:
92 QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.data(); }
94 QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.data(); }
95 void setSelectionSource(QWaylandPrimarySelectionSourceV1 *source);
96
97protected:
98 void zwp_primary_selection_device_v1_data_offer(struct ::zwp_primary_selection_offer_v1 *offer) override;
99 void zwp_primary_selection_device_v1_selection(struct ::zwp_primary_selection_offer_v1 *id) override;
100
101private:
102 QWaylandDisplay *m_display = nullptr;
103 QWaylandInputDevice *m_seat = nullptr;
104 QScopedPointer<QWaylandPrimarySelectionOfferV1> m_selectionOffer;
105 QScopedPointer<QWaylandPrimarySelectionSourceV1> m_selectionSource;
107};
108
109} // namespace QtWaylandClient
110
111QT_END_NAMESPACE
112
113#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)