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

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0003     SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 #pragma once
0008 
0009 #include "kwin_export.h"
0010 
0011 #include <QObject>
0012 #include <memory>
0013 
0014 #include "datadevice_interface.h"
0015 
0016 namespace KWaylandServer
0017 {
0018 class Display;
0019 class DataSourceInterface;
0020 class DataDeviceManagerInterfacePrivate;
0021 
0022 /**
0023  * @brief Represents the Global for wl_data_device_manager interface.
0024  *
0025  */
0026 class KWIN_EXPORT DataDeviceManagerInterface : public QObject
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     explicit DataDeviceManagerInterface(Display *display, QObject *parent = nullptr);
0032     ~DataDeviceManagerInterface() override;
0033 
0034     /**
0035      * Drag and Drop actions supported by the DataSourceInterface.
0036      */
0037     enum class DnDAction {
0038         None = 0,
0039         Copy = 1 << 0,
0040         Move = 1 << 1,
0041         Ask = 1 << 2,
0042     };
0043     Q_DECLARE_FLAGS(DnDActions, DnDAction)
0044 
0045 Q_SIGNALS:
0046     void dataSourceCreated(KWaylandServer::DataSourceInterface *);
0047     void dataDeviceCreated(KWaylandServer::DataDeviceInterface *);
0048 
0049 private:
0050     std::unique_ptr<DataDeviceManagerInterfacePrivate> d;
0051 };
0052 
0053 }
0054 
0055 Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::DataDeviceManagerInterface::DnDActions)