KWayland

datasource.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_DATASOURCE_H
7 #define WAYLAND_DATASOURCE_H
8 
9 #include "buffer.h"
10 #include "datadevicemanager.h"
11 
12 #include <QObject>
13 
14 #include <KWayland/Client/kwaylandclient_export.h>
15 
16 struct wl_data_source;
17 class QMimeType;
18 
19 namespace KWayland
20 {
21 namespace Client
22 {
23 
24 
33 class KWAYLANDCLIENT_EXPORT DataSource : public QObject
34 {
35  Q_OBJECT
36 public:
37  explicit DataSource(QObject *parent = nullptr);
38  virtual ~DataSource();
39 
45  void setup(wl_data_source *dataSource);
51  void release();
66  void destroy();
70  bool isValid() const;
71 
72  void offer(const QString &mimeType);
73  void offer(const QMimeType &mimeType);
74 
85  void setDragAndDropActions(DataDeviceManager::DnDActions actions);
86 
92  DataDeviceManager::DnDAction selectedDragAndDropAction() const;
93 
94  operator wl_data_source*();
95  operator wl_data_source*() const;
96 
97 Q_SIGNALS:
102  void targetAccepts(const QString &mimeType);
108  void sendDataRequested(const QString &mimeType, qint32 fd);
113  void cancelled();
114 
131  void dragAndDropPerformed();
132 
143  void dragAndDropFinished();
144 
150  void selectedDragAndDropActionChanged();
151 
152 private:
153  class Private;
155 };
156 
157 }
158 }
159 
160 #endif
Wrapper for the wl_data_source interface.
Definition: datasource.h:33
DnDAction
Drag and Drop actions supported by DataSource and DataOffer.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.