File indexing completed on 2024-12-08 12:18:38
0001 /* 0002 SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef WAYLANDCLIPBOARD_H 0008 #define WAYLANDCLIPBOARD_H 0009 0010 #include "ksystemclipboard.h" 0011 0012 #include <memory> 0013 0014 class DataControlDevice; 0015 class DataControlDeviceManager; 0016 class KeyboardFocusWatcher; 0017 0018 class WaylandClipboard : public KSystemClipboard 0019 { 0020 public: 0021 WaylandClipboard(QObject *parent); 0022 ~WaylandClipboard(); 0023 void setMimeData(QMimeData *mime, QClipboard::Mode mode) override; 0024 void clear(QClipboard::Mode mode) override; 0025 const QMimeData *mimeData(QClipboard::Mode mode) const override; 0026 0027 bool isValid(); 0028 0029 private: 0030 void gainedFocus(); 0031 std::unique_ptr<KeyboardFocusWatcher> m_keyboardFocusWatcher; 0032 std::unique_ptr<DataControlDeviceManager> m_manager; 0033 std::unique_ptr<DataControlDevice> m_device; 0034 }; 0035 0036 #endif