Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwldatasource_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef WLDATASOURCE_H
5#define WLDATASOURCE_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 <QtWaylandCompositor/private/qwayland-server-wayland.h>
19#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h>
20#include <QObject>
21#include <QtCore/QList>
22
23QT_REQUIRE_CONFIG(wayland_datadevice);
24
26
27namespace QtWayland {
28
29class DataOffer;
30class DataDevice;
31class DataDeviceManager;
32
33class DataSource : public QObject, public QtWaylandServer::wl_data_source
34{
35public:
36 DataSource(struct wl_client *client, uint32_t id, uint32_t time);
37 ~DataSource() override;
38 uint32_t time() const;
39 QList<QString> mimeTypes() const;
40
41 void accept(const QString &mimeType);
42 void send(const QString &mimeType,int fd);
43 void cancel();
44
47
48 static DataSource *fromResource(struct ::wl_resource *resource);
49
50protected:
51 void data_source_offer(Resource *resource, const QString &mime_type) override;
52 void data_source_destroy(Resource *resource) override;
53 void data_source_destroy_resource(Resource *resource) override;
54
55private:
56 uint32_t m_time;
57 QList<QString> m_mimeTypes;
58
59 DataDevice *m_device = nullptr;
60 DataDeviceManager *m_manager = nullptr;
61};
62
63}
64
66
67#endif // WLDATASOURCE_H
IOBluetoothDevice * device
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void send(const QString &mimeType, int fd)
uint32_t time() const
void setManager(DataDeviceManager *mgr)
DataSource(struct wl_client *client, uint32_t id, uint32_t time)
static DataSource * fromResource(struct ::wl_resource *resource)
void data_source_destroy_resource(Resource *resource) override
void data_source_offer(Resource *resource, const QString &mime_type) override
void setDevice(DataDevice *device)
void accept(const QString &mimeType)
void data_source_destroy(Resource *resource) override
QList< QString > mimeTypes() const
Combined button and popup list for selecting options.
const char * mimeType
GLuint64 GLenum GLint fd
#define QT_REQUIRE_CONFIG(feature)