1 | // Copyright (C) 2017 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef WLDATAOFFER_H |
5 | #define WLDATAOFFER_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 <QPointer> |
19 | #include <QtWaylandCompositor/private/qwayland-server-wayland.h> |
20 | #include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h> |
21 | |
22 | QT_REQUIRE_CONFIG(wayland_datadevice); |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | namespace QtWayland |
27 | { |
28 | |
29 | class DataSource; |
30 | |
31 | class DataOffer : public QtWaylandServer::wl_data_offer |
32 | { |
33 | public: |
34 | DataOffer(DataSource *data_source, QtWaylandServer::wl_data_device::Resource *target); |
35 | ~DataOffer() override; |
36 | |
37 | protected: |
38 | void data_offer_accept(Resource *resource, uint32_t serial, const QString &mime_type) override; |
39 | void data_offer_receive(Resource *resource, const QString &mime_type, int32_t fd) override; |
40 | void data_offer_destroy(Resource *resource) override; |
41 | void data_offer_destroy_resource(Resource *resource) override; |
42 | |
43 | private: |
44 | QPointer<DataSource> m_dataSource; |
45 | }; |
46 | |
47 | } |
48 | |
49 | QT_END_NAMESPACE |
50 | |
51 | #endif // WLDATAOFFER_H |
52 | |