kwin/src/wayland/datasource_interface.h

63 lines
1.6 KiB
C
Raw Normal View History

/*
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
2021-03-10 16:08:30 +00:00
#pragma once
#include "abstract_data_source.h"
2020-04-29 14:56:38 +00:00
#include <KWaylandServer/kwaylandserver_export.h>
#include "datadevicemanager_interface.h"
2020-04-29 14:56:38 +00:00
namespace KWaylandServer
{
class DataSourceInterfacePrivate;
2015-09-10 11:36:42 +00:00
/**
* @brief Represents the Resource for the wl_data_source interface.
**/
class KWAYLANDSERVER_EXPORT DataSourceInterface : public AbstractDataSource
{
Q_OBJECT
public:
virtual ~DataSourceInterface();
void accept(const QString &mimeType) override;
void requestData(const QString &mimeType, qint32 fd) override;
void cancel() override;
QStringList mimeTypes() const override;
static DataSourceInterface *get(wl_resource *native);
/**
* @returns The Drag and Drop actions supported by this DataSourceInterface.
**/
DataDeviceManagerInterface::DnDActions supportedDragAndDropActions() const override;
void dropPerformed() override;
void dndFinished() override;
void dndAction(DataDeviceManagerInterface::DnDAction action) override;
wl_resource *resource() const;
wl_client *client() const override;
bool isAccepted() const;
void setAccepted(bool accepted);
private:
friend class DataDeviceManagerInterfacePrivate;
2014-11-20 15:40:14 +00:00
explicit DataSourceInterface(DataDeviceManagerInterface *parent, wl_resource *parentResource);
QScopedPointer<DataSourceInterfacePrivate> d;
};
}
2020-04-29 14:56:38 +00:00
Q_DECLARE_METATYPE(KWaylandServer::DataSourceInterface*)