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

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 struct wl_client;
0015 
0016 namespace KWin
0017 {
0018 class AbstractDataSource;
0019 class PrimarySelectionDeviceManagerV1Interface;
0020 class PrimarySelectionOfferV1Interface;
0021 class PrimarySelectionSourceV1Interface;
0022 class SeatInterface;
0023 class SurfaceInterface;
0024 class PrimarySelectionDeviceV1InterfacePrivate;
0025 
0026 /**
0027  * @brief Represents the Resource for the wl_data_device interface.
0028  *
0029  * @see SeatInterface
0030  * @see PrimarySelectionSourceInterface
0031  * Lifespan is mapped to the underlying object
0032  */
0033 class KWIN_EXPORT PrimarySelectionDeviceV1Interface : public QObject
0034 {
0035     Q_OBJECT
0036 public:
0037     virtual ~PrimarySelectionDeviceV1Interface();
0038 
0039     SeatInterface *seat() const;
0040 
0041     PrimarySelectionSourceV1Interface *selection() const;
0042 
0043     void sendSelection(AbstractDataSource *other);
0044 
0045     wl_client *client() const;
0046 
0047 Q_SIGNALS:
0048     void selectionChanged(KWin::PrimarySelectionSourceV1Interface *);
0049 
0050 private:
0051     friend class PrimarySelectionDeviceManagerV1InterfacePrivate;
0052     explicit PrimarySelectionDeviceV1Interface(SeatInterface *seat, wl_resource *resource);
0053 
0054     std::unique_ptr<PrimarySelectionDeviceV1InterfacePrivate> d;
0055 };
0056 
0057 }
0058 
0059 Q_DECLARE_METATYPE(KWin::PrimarySelectionDeviceV1Interface *)