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
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
26
27QT_BEGIN_NAMESPACE
28
29class QMimeData;
30
31namespace QtWaylandClient {
32
33class QWaylandInputDevice;
35
37{
38public:
39 explicit QWaylandPrimarySelectionDeviceManagerV1(QWaylandDisplay *display, uint id, uint version);
41 QWaylandPrimarySelectionDeviceV1 *createDevice(QWaylandInputDevice *seat);
42 QWaylandDisplay *display() const { return m_display; }
43
44private:
45 QWaylandDisplay *m_display = nullptr;
46};
47
49{
50public:
51 explicit QWaylandPrimarySelectionOfferV1(QWaylandDisplay *display, ::zwp_primary_selection_offer_v1 *offer);
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
83
85{
88
89public:
91 QWaylandPrimarySelectionOfferV1 *selectionOffer() const { return m_selectionOffer.data(); }
93 QWaylandPrimarySelectionSourceV1 *selectionSource() const { return m_selectionSource.data(); }
94 void setSelectionSource(QWaylandPrimarySelectionSourceV1 *source);
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
110QT_END_NAMESPACE
111
112#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)