KWayland

datadevicemanager.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_DATA_DEVICE_MANAGER_H
7 #define WAYLAND_DATA_DEVICE_MANAGER_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct wl_data_device_manager;
14 
15 namespace KWayland
16 {
17 namespace Client
18 {
19 
20 class EventQueue;
21 class DataDevice;
22 class DataSource;
23 class Seat;
24 
48 class KWAYLANDCLIENT_EXPORT DataDeviceManager : public QObject
49 {
50  Q_OBJECT
51 public:
56  enum class DnDAction {
57  None = 0,
58  Copy = 1 << 0,
59  Move = 1 << 1,
60  Ask = 1 << 2
61  };
62  Q_DECLARE_FLAGS(DnDActions, DnDAction)
63 
64 
70  explicit DataDeviceManager(QObject *parent = nullptr);
71  virtual ~DataDeviceManager();
72 
76  bool isValid() const;
82  void setup(wl_data_device_manager *manager);
88  void release();
103  void destroy();
104 
108  void setEventQueue(EventQueue *queue);
112  EventQueue *eventQueue();
113 
114  DataSource *createDataSource(QObject *parent = nullptr);
115 
116  DataDevice *getDataDevice(Seat *seat, QObject *parent = nullptr);
117 
118  operator wl_data_device_manager*();
119  operator wl_data_device_manager*() const;
120 
121 Q_SIGNALS:
130  void removed();
131 
132 private:
133  class Private;
135 };
136 
137 }
138 }
139 
140 Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::DataDeviceManager::DnDActions)
141 
142 #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 class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_seat interface.
Definition: seat.h:52
DnDAction
Drag and Drop actions supported by DataSource and DataOffer.
Wrapper for the wl_data_device_manager interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 14 2020 22:49:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.