File indexing completed on 2024-05-12 05:32:26

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 #include "primaryselectiondevicemanager_v1.h"
0014 
0015 struct wl_resource;
0016 namespace KWin
0017 {
0018 class AbstractDataSource;
0019 class PrimarySelectionDeviceV1Interface;
0020 class PrimarySelectionSourceV1Interface;
0021 class PrimarySelectionOfferV1InterfacePrivate;
0022 
0023 /**
0024  * @brief Represents the Resource for the wl_data_offer interface.
0025  * Lifespan is mapped to the underlying object
0026  */
0027 class KWIN_EXPORT PrimarySelectionOfferV1Interface : public QObject
0028 {
0029     Q_OBJECT
0030 public:
0031     ~PrimarySelectionOfferV1Interface() override;
0032 
0033     void sendAllOffers();
0034     wl_resource *resource() const;
0035 
0036 private:
0037     friend class PrimarySelectionDeviceV1InterfacePrivate;
0038     explicit PrimarySelectionOfferV1Interface(AbstractDataSource *source, wl_resource *resource);
0039 
0040     std::unique_ptr<PrimarySelectionOfferV1InterfacePrivate> d;
0041 };
0042 
0043 }
0044 
0045 Q_DECLARE_METATYPE(KWin::PrimarySelectionOfferV1Interface *)