KWayland

datadevice.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_DATADEVICE_H
7 #define WAYLAND_DATADEVICE_H
8 
9 #include "dataoffer.h"
10 
11 #include <QObject>
12 
13 #include <KWayland/Client/kwaylandclient_export.h>
14 
15 struct wl_data_device;
16 
17 namespace KWayland
18 {
19 namespace Client
20 {
21 class DataSource;
22 class Surface;
23 
32 class KWAYLANDCLIENT_EXPORT DataDevice : public QObject
33 {
34  Q_OBJECT
35 public:
36  explicit DataDevice(QObject *parent = nullptr);
37  virtual ~DataDevice();
38 
44  void setup(wl_data_device *dataDevice);
50  void release();
65  void destroy();
69  bool isValid() const;
70 
71  void startDrag(quint32 serial, DataSource *source, Surface *origin, Surface *icon = nullptr);
72  void startDragInternally(quint32 serial, Surface *origin, Surface *icon = nullptr);
73 
74  void setSelection(quint32 serial, DataSource *source = nullptr);
75  void clearSelection(quint32 serial);
76 
77  DataOffer *offeredSelection() const;
78 
83  QPointer<Surface> dragSurface() const;
88  DataOffer *dragOffer() const;
89 
90  operator wl_data_device*();
91  operator wl_data_device*() const;
92 
93 Q_SIGNALS:
94  void selectionOffered(KWayland::Client::DataOffer*);
95  void selectionCleared();
107  void dragEntered(quint32 serial, const QPointF &relativeToSurface);
115  void dragLeft();
124  void dragMotion(const QPointF &relativeToSurface, quint32 time);
134  void dropped();
135 
136 private:
137  class Private;
139 };
140 
141 }
142 }
143 
144 #endif
DataDevice allows clients to share data by copy-and-paste and drag-and-drop.
Definition: datadevice.h:32
Wrapper for the wl_data_source interface.
Definition: datasource.h:33
Wrapper for the wl_surface interface.
Definition: surface.h:44
Wrapper for the wl_data_offer interface.
Definition: dataoffer.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:50:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.