File indexing completed on 2024-12-22 05:00:50

0001 /*
0002    SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Akonadi/AgentBase>
0010 
0011 #include <Akonadi/Collection>
0012 class QTimer;
0013 
0014 class ArchiveMailManager;
0015 
0016 class ArchiveMailAgent : public Akonadi::AgentBase, public Akonadi::AgentBase::ObserverV3
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit ArchiveMailAgent(const QString &id);
0022     ~ArchiveMailAgent() override;
0023 
0024     [[nodiscard]] QString printArchiveListInfo() const;
0025 
0026     void setEnableAgent(bool b);
0027     [[nodiscard]] bool enabledAgent() const;
0028 
0029     [[nodiscard]] QString printCurrentListInfo() const;
0030     void archiveFolder(const QString &path, Akonadi::Collection::Id collectionId);
0031 Q_SIGNALS:
0032     void needUpdateConfigDialogBox();
0033 
0034 public Q_SLOTS:
0035     void reload();
0036     void pause();
0037     void resume();
0038 
0039 protected:
0040     void doSetOnline(bool online) override;
0041 
0042 private:
0043     void mailCollectionRemoved(const Akonadi::Collection &collection);
0044     QTimer *const mTimer;
0045     ArchiveMailManager *const mArchiveManager;
0046 };