KWaylandServer

dataoffer_interface.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3  SPDX-FileCopyrightText: 2020 David Edmundson <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #pragma once
8 
9 #include <QObject>
10 
11 #include <KWaylandServer/kwaylandserver_export.h>
12 
13 #include "datadevicemanager_interface.h"
14 
15 namespace KWaylandServer
16 {
17 class DataDeviceInterface;
18 class AbstractDataSource;
19 class DataOfferInterfacePrivate;
20 
21 /**
22  * @brief Represents the Resource for the wl_data_offer interface.
23  *
24  */
25 class KWAYLANDSERVER_EXPORT DataOfferInterface : public QObject
26 {
27  Q_OBJECT
28 public:
29  virtual ~DataOfferInterface();
30 
31  void sendAllOffers();
32  void sendSourceActions();
33  wl_resource *resource() const;
34 
35  /**
36  * @returns The Drag and Drop actions supported by this DataOfferInterface.
37  */
38  DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const;
39 
40  /**
41  * @returns The preferred Drag and Drop action of this DataOfferInterface.
42  */
43  DataDeviceManagerInterface::DnDAction preferredDragAndDropAction() const;
44 
45  /**
46  * This event indicates the @p action selected by the compositor after matching the
47  * source/destination side actions. Only one action (or none) will be offered here.
48  */
49  void dndAction(DataDeviceManagerInterface::DnDAction action);
50 
51 Q_SIGNALS:
52  /**
53  * Emitted whenever the supported or preferred Drag and Drop actions changed.
54  */
55  void dragAndDropActionsChanged();
56 
57 private:
58  friend class DataDeviceInterfacePrivate;
59  explicit DataOfferInterface(AbstractDataSource *source, wl_resource *resource);
60 
62 };
63 
64 }
65 
66 Q_DECLARE_METATYPE(KWaylandServer::DataOfferInterface *)
The AbstractDataSource class abstracts the data that can be transferred to another client...
Represents the Resource for the wl_data_offer interface.
DnDAction
Drag and Drop actions supported by the DataSourceInterface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:08:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.