File indexing completed on 2024-05-19 16:35:17

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 "datacontroldevicemanager_v1_interface.h"
0012 
0013 namespace KWaylandServer
0014 {
0015 class DataControlSourceV1InterfacePrivate;
0016 
0017 /**
0018  * The DataControlSourceV1Interface class represents the source side in a data transfer.
0019  *
0020  * DataControlSourceV1Interface corresponds to the wayland interface zwlr_data_control_source_v1.
0021  */
0022 class KWIN_EXPORT DataControlSourceV1Interface : public AbstractDataSource
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     ~DataControlSourceV1Interface() override;
0028 
0029     void requestData(const QString &mimeType, qint32 fd) override;
0030     void cancel() override;
0031 
0032     QStringList mimeTypes() const override;
0033     wl_client *client() const override;
0034 
0035     static DataControlSourceV1Interface *get(wl_resource *native);
0036 
0037 private:
0038     friend class DataControlDeviceManagerV1InterfacePrivate;
0039     explicit DataControlSourceV1Interface(DataControlDeviceManagerV1Interface *parent, ::wl_resource *resource);
0040 
0041     std::unique_ptr<DataControlSourceV1InterfacePrivate> d;
0042 };
0043 
0044 }
0045 
0046 Q_DECLARE_METATYPE(KWaylandServer::DataControlSourceV1Interface *)