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

KDE's Doxygen guidelines are available online.