KWaylandServer

datasource_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 "abstract_data_source.h"
10 
11 #include <KWaylandServer/kwaylandserver_export.h>
12 
13 #include "datadevicemanager_interface.h"
14 
15 namespace KWaylandServer
16 {
17 class DataSourceInterfacePrivate;
18 
19 /**
20  * @brief Represents the Resource for the wl_data_source interface.
21  */
22 class KWAYLANDSERVER_EXPORT DataSourceInterface : public AbstractDataSource
23 {
24  Q_OBJECT
25 public:
26  virtual ~DataSourceInterface();
27 
28  void accept(const QString &mimeType) override;
29  void requestData(const QString &mimeType, qint32 fd) override;
30  void cancel() override;
31 
32  QStringList mimeTypes() const override;
33 
34  static DataSourceInterface *get(wl_resource *native);
35 
36  /**
37  * @returns The Drag and Drop actions supported by this DataSourceInterface.
38  */
39  DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const override;
40 
41  void dropPerformed() override;
42  void dndFinished() override;
43  void dndAction(DataDeviceManagerInterface::DnDAction action) override;
44  void dndCancelled() override;
45 
46  wl_resource *resource() const;
47 
48  wl_client *client() const override;
49 
50  bool isAccepted() const override;
51  void setAccepted(bool accepted);
52 
53 private:
54  friend class DataDeviceManagerInterfacePrivate;
55  explicit DataSourceInterface(DataDeviceManagerInterface *parent, wl_resource *parentResource);
56 
58 };
59 
60 }
61 
62 Q_DECLARE_METATYPE(KWaylandServer::DataSourceInterface *)
The AbstractDataSource class abstracts the data that can be transferred to another client...
Represents the Global for wl_data_device_manager interface.
DnDAction
Drag and Drop actions supported by the DataSourceInterface.
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 Oct 25 2021 23:08:43 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.