kdeconnect-kde/plugins/clipboard/datacontrol.h
Aleix Pol 389a47b088 Add support for clipboard integration
Copies over David's implementation in Klipper and integrates it in the
plugin. To do so it splits the ClipboardListener class into 2
subclasses: one that uses QClipboard and the other that uses the
DataControl classes.

BUG: 359747
2021-04-07 00:43:51 +00:00

35 lines
732 B
C++

/*
SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org>
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#pragma once
#include <QObject>
#include <QScopedPointer>
class DataControlPrivate;
class QMimeData;
class DataControl : public QObject
{
Q_OBJECT
public:
DataControl(QObject *parent = nullptr);
~DataControl() override;
QMimeData* selection() const;
QMimeData* receivedSelection() const;
void clearSelection();
void clearPrimarySelection();
void setSelection(QMimeData *mime, bool ownMime);
Q_SIGNALS:
void receivedSelectionChanged();
void selectionChanged();
private:
QScopedPointer<DataControlPrivate> d;
};