File indexing completed on 2024-05-19 16:35:25
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 "abstract_data_source.h" 0011 #include "primaryselectiondevicemanager_v1_interface.h" 0012 0013 namespace KWaylandServer 0014 { 0015 class PrimarySelectionSourceV1InterfacePrivate; 0016 0017 /** 0018 * @brief Represents the Resource for the zwp_primary_selection_source_v1 interface. 0019 * Lifespan is mapped to the underlying object 0020 */ 0021 class KWIN_EXPORT PrimarySelectionSourceV1Interface : public AbstractDataSource 0022 { 0023 Q_OBJECT 0024 public: 0025 ~PrimarySelectionSourceV1Interface() override; 0026 0027 void requestData(const QString &mimeType, qint32 fd) override; 0028 void cancel() override; 0029 0030 QStringList mimeTypes() const override; 0031 0032 static PrimarySelectionSourceV1Interface *get(wl_resource *native); 0033 wl_client *client() const override; 0034 0035 private: 0036 friend class PrimarySelectionDeviceManagerV1InterfacePrivate; 0037 explicit PrimarySelectionSourceV1Interface(::wl_resource *resource); 0038 0039 std::unique_ptr<PrimarySelectionSourceV1InterfacePrivate> d; 0040 }; 0041 0042 } 0043 0044 Q_DECLARE_METATYPE(KWaylandServer::PrimarySelectionSourceV1Interface *)