/* SPDX-FileCopyrightText: 2004 Esben Mose Hansen SPDX-FileCopyrightText: Andrew Stanley-Jones SPDX-FileCopyrightText: 2024 Fushan Wen SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include #include class QKeyEvent; class QWindow; class HistoryModel; namespace KWayland { namespace Client { class PlasmaShell; class PlasmaShellSurface; } } /** * Default view of clipboard history. * */ class KlipperPopup : public PlasmaQuick::PlasmaWindow { Q_OBJECT public: explicit KlipperPopup(); ~KlipperPopup() override = default; void show(); void setPlasmaShell(KWayland::Client::PlasmaShell *plasmashell); public Q_SLOTS: void hide(); protected: void showEvent(QShowEvent *event) override; private: void positionOnScreen(); void onObjectIncubated(); void onFocusWindowChanged(QWindow *focusWindow); /** * The "document" (clipboard history) */ std::shared_ptr m_model; PlasmaQuick::SharedQmlEngine m_engine; KWayland::Client::PlasmaShell *m_plasmashell = nullptr; };