389a47b088
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
35 lines
732 B
C++
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;
|
|
};
|