KWin
Loading...
Searching...
No Matches
datadevice.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 SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8#pragma once
9
10#include "kwin_export.h"
11
12#include <QObject>
13#include <memory>
14
16
17struct wl_client;
18struct wl_resource;
19
20namespace KWin
21{
22class DataDeviceManagerInterface;
23class DataOfferInterface;
24class DataSourceInterface;
25class AbstractDataSource;
26class SeatInterface;
27class SurfaceInterface;
28class SurfaceRole;
29class DataDeviceInterfacePrivate;
30class DragAndDropIconPrivate;
31
38class KWIN_EXPORT DragAndDropIcon : public QObject
39{
40 Q_OBJECT
41
42public:
43 ~DragAndDropIcon() override;
44
45 static SurfaceRole *role();
46
50 QPoint position() const;
51
55 SurfaceInterface *surface() const;
56
57Q_SIGNALS:
58 void changed();
59
60private:
61 void commit();
62
63 explicit DragAndDropIcon(SurfaceInterface *surface);
65 std::unique_ptr<DragAndDropIconPrivate> d;
66};
67
79class KWIN_EXPORT DataDeviceInterface : public AbstractDropHandler
80{
81 Q_OBJECT
82public:
84
85 SeatInterface *seat() const;
86
87 DataSourceInterface *selection() const;
88
89 void sendSelection(KWin::AbstractDataSource *other);
93 void drop() override;
105 void updateDragTarget(SurfaceInterface *surface, quint32 serial) override;
106
107 wl_client *client();
108
109Q_SIGNALS:
111 void dragStarted(AbstractDataSource *source, SurfaceInterface *originSurface, quint32 serial, DragAndDropIcon *dragIcon);
113
114private:
116 explicit DataDeviceInterface(SeatInterface *seat, wl_resource *resource);
117 std::unique_ptr<DataDeviceInterfacePrivate> d;
119};
120
121}
122
The AbstractDataSource class abstracts the data that can be transferred to another client.
DataDeviceInterface allows clients to share data by copy-and-paste and drag-and-drop.
Definition datadevice.h:80
void selectionChanged(KWin::DataSourceInterface *)
void dragStarted(AbstractDataSource *source, SurfaceInterface *originSurface, quint32 serial, DragAndDropIcon *dragIcon)
Represents the Resource for the wl_data_source interface.
Definition datasource.h:23
Represents a Seat on the Wayland Display.
Definition seat.h:134
Resource representing a wl_surface.
Definition surface.h:80
Q_DECLARE_METATYPE(KWin::SwitchEvent::State)