File indexing completed on 2024-05-19 05:32:33

0001 /*
0002     SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 #pragma once
0007 
0008 #include "kwin_export.h"
0009 
0010 #include <QObject>
0011 #include <memory>
0012 
0013 struct wl_resource;
0014 
0015 namespace KWin
0016 {
0017 class AbstractDataSource;
0018 class DataControlDeviceManagerV1Interface;
0019 class DataControlDeviceV1InterfacePrivate;
0020 class DataControlOfferV1Interface;
0021 class DataControlSourceV1Interface;
0022 class SeatInterface;
0023 class SurfaceInterface;
0024 
0025 /**
0026  * The DataControlDeviceV1Interface extensions allows clients to manage seat's current selection.
0027  *
0028  * DataControlDeviceV1Interface corresponds to the Wayland interface @c zwlr_data_control_device_v1.
0029  */
0030 class KWIN_EXPORT DataControlDeviceV1Interface : public QObject
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     ~DataControlDeviceV1Interface() override;
0036 
0037     SeatInterface *seat() const;
0038     DataControlSourceV1Interface *selection() const;
0039     DataControlSourceV1Interface *primarySelection() const;
0040 
0041     void sendSelection(AbstractDataSource *other);
0042 
0043     void sendPrimarySelection(AbstractDataSource *other);
0044 
0045 Q_SIGNALS:
0046     void selectionChanged(KWin::DataControlSourceV1Interface *dataSource);
0047 
0048     void primarySelectionChanged(KWin::DataControlSourceV1Interface *dataSource);
0049 
0050 private:
0051     friend class DataControlDeviceManagerV1InterfacePrivate;
0052     explicit DataControlDeviceV1Interface(SeatInterface *seat, wl_resource *resource);
0053 
0054     std::unique_ptr<DataControlDeviceV1InterfacePrivate> d;
0055 };
0056 
0057 }
0058 
0059 Q_DECLARE_METATYPE(KWin::DataControlDeviceV1Interface *)