KWayland

dataoffer.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_DATAOFFER_H
7 #define WAYLAND_DATAOFFER_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 #include "datadevicemanager.h"
14 
15 struct wl_data_offer;
16 
17 class QMimeType;
18 
19 namespace KWayland
20 {
21 namespace Client
22 {
23 class DataDevice;
24 
33 class KWAYLANDCLIENT_EXPORT DataOffer : public QObject
34 {
35  Q_OBJECT
36 public:
37  virtual ~DataOffer();
38 
44  void release();
59  void destroy();
63  bool isValid() const;
64 
65  QList<QMimeType> offeredMimeTypes() const;
66 
67  void receive(const QMimeType &mimeType, qint32 fd);
68  void receive(const QString &mimeType, qint32 fd);
69 
78  void dragAndDropFinished();
79 
85  DataDeviceManager::DnDActions sourceDragAndDropActions() const;
86 
91  void setDragAndDropActions(DataDeviceManager::DnDActions supported, DataDeviceManager::DnDAction preferred);
92 
98  DataDeviceManager::DnDAction selectedDragAndDropAction() const;
99 
100  operator wl_data_offer*();
101  operator wl_data_offer*() const;
102 
103 Q_SIGNALS:
104  void mimeTypeOffered(const QString&);
111  void sourceDragAndDropActionsChanged();
117  void selectedDragAndDropActionChanged();
118 
119 private:
120  friend class DataDevice;
121  explicit DataOffer(DataDevice *parent, wl_data_offer *dataOffer);
122  class Private;
124 };
125 
126 }
127 }
128 
129 Q_DECLARE_METATYPE(KWayland::Client::DataOffer*)
130 
131 #endif
DataDevice allows clients to share data by copy-and-paste and drag-and-drop.
Definition: datadevice.h:32
Wrapper for the wl_data_offer interface.
Definition: dataoffer.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.