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
qwaylanddatacontrolv1_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 Jie Liu <liujie01@kylinos.cn>
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 QWAYLANDDATACONTROLV1_H
6#define QWAYLANDDATACONTROLV1_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-wlr-data-control-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 QWaylandDataControlManagerV1(QWaylandDisplay *display, uint id, uint version);
41 QWaylandDataControlDeviceV1 *createDevice(QWaylandInputDevice *seat);
42 QWaylandDisplay *display() const { return m_display; }
43
44private:
45 QWaylandDisplay *m_display = nullptr;
46};
47
49{
50public:
51 explicit QWaylandDataControlOfferV1(QWaylandDisplay *display, ::zwlr_data_control_offer_v1 *offer);
53 void startReceiving(const QString &mimeType, int fd) override;
54 QMimeData *mimeData() override { return m_mimeData.data(); }
55
56protected:
57 void zwlr_data_control_offer_v1_offer(const QString &mime_type) override;
58
59private:
60 QWaylandDisplay *m_display = nullptr;
61 QScopedPointer<QWaylandMimeData> m_mimeData;
62};
63
84
86{
89
90public:
92 QWaylandDataControlOfferV1 *primarySelectionOffer() const { return m_primarySelectionOffer.data(); }
93 QWaylandDataControlOfferV1 *selectionOffer() const { return m_selectionOffer.data(); }
95 QWaylandDataControlSourceV1 *selectionSource() const { return m_selectionSource.data(); }
96 QWaylandDataControlSourceV1 *primarySelectionSource() const { return m_primarySelectionSource.data(); }
97 void setSelectionSource(QWaylandDataControlSourceV1 *source);
98 void setPrimarySelectionSource(QWaylandDataControlSourceV1 *source);
99
100protected:
101 void zwlr_data_control_device_v1_data_offer(struct ::zwlr_data_control_offer_v1 *id) override;
102 void zwlr_data_control_device_v1_selection(struct ::zwlr_data_control_offer_v1 *id) override;
104 void zwlr_data_control_device_v1_primary_selection(struct ::zwlr_data_control_offer_v1 *id) override;
105
106private:
107 QWaylandDisplay *m_display = nullptr;
108 QWaylandInputDevice *m_seat = nullptr;
109 QScopedPointer<QWaylandDataControlOfferV1> m_selectionOffer;
110 QScopedPointer<QWaylandDataControlOfferV1> m_primarySelectionOffer;
111 QScopedPointer<QWaylandDataControlSourceV1> m_selectionSource;
112 QScopedPointer<QWaylandDataControlSourceV1> m_primarySelectionSource;
114};
115
116} // namespace QtWaylandClient
117
118QT_END_NAMESPACE
119
120#endif // QWAYLANDDATACONTROLV1_H
QWaylandDataControlOfferV1 * selectionOffer() const
QWaylandDataControlOfferV1 * primarySelectionOffer() const
QWaylandDataControlSourceV1 * selectionSource() const
void setSelectionSource(QWaylandDataControlSourceV1 *source)
QWaylandDataControlSourceV1 * primarySelectionSource() const
void setPrimarySelectionSource(QWaylandDataControlSourceV1 *source)
QWaylandDataControlManagerV1(QWaylandDisplay *display, uint id, uint version)
QWaylandDataControlDeviceV1 * createDevice(QWaylandInputDevice *seat)
QWaylandDataControlOfferV1(QWaylandDisplay *display, ::zwlr_data_control_offer_v1 *offer)
void startReceiving(const QString &mimeType, int fd) override
void zwlr_data_control_offer_v1_offer(const QString &mime_type) override
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG(clipboard)