KWayland

dataoffer_interface.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_SERVER_DATA_OFFER_INTERFACE_H
7 #define WAYLAND_SERVER_DATA_OFFER_INTERFACE_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Server/kwaylandserver_export.h>
12 
13 #include "resource.h"
14 #include "datadevicemanager_interface.h"
15 
16 namespace KWayland
17 {
18 namespace Server
19 {
20 
21 class DataDeviceInterface;
22 class DataSourceInterface;
23 
24 /**
25  * @brief Represents the Resource for the wl_data_offer interface.
26  *
27  **/
28 class KWAYLANDSERVER_EXPORT DataOfferInterface : public Resource
29 {
30  Q_OBJECT
31 public:
32  virtual ~DataOfferInterface();
33 
34  void sendAllOffers();
35 
36  /**
37  * @returns The Drag and Drop actions supported by this DataOfferInterface.
38  * @since 5.42
39  **/
40  DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const;
41 
42  /**
43  * @returns The preferred Drag and Drop action of this DataOfferInterface.
44  * @since 5.42
45  **/
46  DataDeviceManagerInterface::DnDAction preferredDragAndDropAction() const;
47 
48  /**
49  * This event indicates the @p action selected by the compositor after matching the
50  * source/destination side actions. Only one action (or none) will be offered here.
51  * @since 5.42
52  **/
53  void dndAction(DataDeviceManagerInterface::DnDAction action);
54 
55 Q_SIGNALS:
56  /**
57  * Emitted whenever the supported or preferred Drag and Drop actions changed.
58  * @since 5.42
59  **/
60  void dragAndDropActionsChanged();
61 
62 private:
63  friend class DataDeviceInterface;
64  explicit DataOfferInterface(DataSourceInterface *source, DataDeviceInterface *parentInterface, wl_resource *parentResource);
65 
66  class Private;
67  Private *d_func() const;
68 };
69 
70 }
71 }
72 
73 Q_DECLARE_METATYPE(KWayland::Server::DataOfferInterface*)
74 
75 #endif
Represents the Resource for the wl_data_offer interface.
DataDeviceInterface allows clients to share data by copy-and-paste and drag-and-drop.
DnDAction
Drag and Drop actions supported by the DataSourceInterface.
Represents a bound Resource.
Definition: resource.h:32
Represents the Resource for the wl_data_source interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Mar 8 2021 22:50:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.