2020-05-12 11:26:57 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2021-03-10 16:08:30 +00:00
|
|
|
#pragma once
|
2020-05-12 11:26:57 +00:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <KWaylandServer/kwaylandserver_export.h>
|
|
|
|
|
|
|
|
struct wl_resource;
|
|
|
|
|
|
|
|
namespace KWaylandServer
|
|
|
|
{
|
|
|
|
|
|
|
|
class AbstractDataSource;
|
2020-05-28 07:25:56 +00:00
|
|
|
class DataControlDeviceManagerV1Interface;
|
2020-05-28 07:44:46 +00:00
|
|
|
class DataControlDeviceV1InterfacePrivate;
|
2020-05-28 07:25:56 +00:00
|
|
|
class DataControlOfferV1Interface;
|
|
|
|
class DataControlSourceV1Interface;
|
2020-05-12 11:26:57 +00:00
|
|
|
class SeatInterface;
|
|
|
|
class SurfaceInterface;
|
|
|
|
|
|
|
|
/**
|
2020-05-28 07:44:46 +00:00
|
|
|
* The DataControlDeviceV1Interface extensions allows clients to manage seat's current selection.
|
2020-05-12 11:26:57 +00:00
|
|
|
*
|
2020-05-28 07:44:46 +00:00
|
|
|
* DataControlDeviceV1Interface corresponds to the Wayland interface @c zwlr_data_control_device_v1.
|
|
|
|
*/
|
2020-05-28 07:25:56 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT DataControlDeviceV1Interface : public QObject
|
2020-05-12 11:26:57 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-05-28 07:21:32 +00:00
|
|
|
|
2020-05-12 11:26:57 +00:00
|
|
|
public:
|
2020-05-28 07:25:56 +00:00
|
|
|
~DataControlDeviceV1Interface() override;
|
2020-05-12 11:26:57 +00:00
|
|
|
|
|
|
|
SeatInterface *seat() const;
|
2020-05-28 07:25:56 +00:00
|
|
|
DataControlSourceV1Interface *selection() const;
|
2020-05-12 11:26:57 +00:00
|
|
|
|
|
|
|
void sendSelection(AbstractDataSource *other);
|
|
|
|
void sendClearSelection();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
2020-05-28 07:45:21 +00:00
|
|
|
void selectionChanged(KWaylandServer::DataControlSourceV1Interface *dataSource);
|
2020-05-12 11:26:57 +00:00
|
|
|
void selectionCleared();
|
|
|
|
|
|
|
|
private:
|
2020-05-28 07:25:56 +00:00
|
|
|
friend class DataControlDeviceManagerV1InterfacePrivate;
|
|
|
|
explicit DataControlDeviceV1Interface(SeatInterface *seat, wl_resource *resource);
|
2020-05-12 11:26:57 +00:00
|
|
|
|
2020-05-28 07:25:56 +00:00
|
|
|
QScopedPointer<DataControlDeviceV1InterfacePrivate> d;
|
2020-05-12 11:26:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-05-28 07:25:56 +00:00
|
|
|
Q_DECLARE_METATYPE(KWaylandServer::DataControlDeviceV1Interface*)
|