KWin
Loading...
Searching...
No Matches
datasource.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
3 SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
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 "kwin_export.h"
10
12#include "datadevicemanager.h"
13
14namespace KWin
15{
16class DataSourceInterfacePrivate;
17class XdgToplevelDragV1Interface;
18
22class KWIN_EXPORT DataSourceInterface : public AbstractDataSource
23{
24 Q_OBJECT
25public:
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
39 DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const override;
40 DataDeviceManagerInterface::DnDAction selectedDndAction() const override;
41 void dropPerformed() override;
42 void dndFinished() override;
43 void dndAction(DataDeviceManagerInterface::DnDAction action) override;
44 void dndCancelled() override;
45
46 bool isDndCancelled() const;
47 bool isDropPerformed() const;
48
49 wl_resource *resource() const;
50
51 wl_client *client() const override;
52
53 bool isAccepted() const override;
54 void setAccepted(bool accepted);
55
56 XdgToplevelDragV1Interface *xdgToplevelDrag() const;
57
58private:
61 explicit DataSourceInterface(wl_resource *resource);
62
63 std::unique_ptr<DataSourceInterfacePrivate> d;
64};
65
66}
67
The AbstractDataSource class abstracts the data that can be transferred to another client.
Represents the Resource for the wl_data_source interface.
Definition datasource.h:23
Q_DECLARE_METATYPE(KWin::SwitchEvent::State)