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

0001 /*
0002     SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003     SPDX-License-Identifier: GPL-2.0-only
0004 */
0005 #pragma once
0006 #include "historyclosedreaderinfo.h"
0007 #include "kmail_private_export.h"
0008 
0009 #include <QObject>
0010 
0011 class KMAILTESTS_TESTS_EXPORT HistoryClosedReaderManager : public QObject
0012 {
0013     Q_OBJECT
0014 public:
0015     static HistoryClosedReaderManager *self();
0016 
0017     explicit HistoryClosedReaderManager(QObject *parent = nullptr);
0018     ~HistoryClosedReaderManager() override;
0019 
0020     void addInfo(const HistoryClosedReaderInfo &info);
0021 
0022     [[nodiscard]] HistoryClosedReaderInfo lastInfo();
0023 
0024     void clear();
0025 
0026     [[nodiscard]] bool isEmpty() const;
0027 
0028     void removeItem(Akonadi::Item::Id id);
0029 
0030     [[nodiscard]] int count() const;
0031 
0032     [[nodiscard]] QList<HistoryClosedReaderInfo> closedReaderInfos() const;
0033 
0034 Q_SIGNALS:
0035     void historyClosedReaderChanged();
0036 
0037 private:
0038     QList<HistoryClosedReaderInfo> mClosedReaderInfos;
0039 };