File indexing completed on 2024-12-22 05:01:09

0001 /*
0002     SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003     SPDX-License-Identifier: GPL-2.0-only
0004 */
0005 
0006 #pragma once
0007 
0008 #include <Akonadi/Item>
0009 #include <KActionMenu>
0010 
0011 class HistoryClosedReaderMenu : public KActionMenu
0012 {
0013     Q_OBJECT
0014 public:
0015     explicit HistoryClosedReaderMenu(QObject *parent = nullptr);
0016     ~HistoryClosedReaderMenu() override;
0017 
0018     [[nodiscard]] QAction *reopenAction() const;
0019 
0020     void createReOpenClosedAction();
0021 Q_SIGNALS:
0022     void openMessage(Akonadi::Item::Id id);
0023 
0024 private:
0025     void slotClear();
0026     void updateMenu();
0027     void addReOpenClosedAction();
0028     void slotReopenLastClosedViewer();
0029     QAction *mReopenAction = nullptr;
0030     QAction *mSeparatorAction = nullptr;
0031 };