archivemailagent.h 1.13 KB
Newer Older
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   SPDX-FileCopyrightText: 2012-2021 Laurent Montel <montel@kde.org>
3

4
   SPDX-License-Identifier: GPL-2.0-or-later
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
*/

#ifndef ARCHIVEMAILAGENT_H
#define ARCHIVEMAILAGENT_H

#include <AkonadiAgentBase/agentbase.h>

#include <AkonadiCore/Collection>
class QTimer;

class ArchiveMailManager;

class ArchiveMailAgent : public Akonadi::AgentBase, public Akonadi::AgentBase::ObserverV3
{
    Q_OBJECT

public:
    explicit ArchiveMailAgent(const QString &id);
Laurent Montel's avatar
Laurent Montel committed
23
    ~ArchiveMailAgent() override;
24

Laurent Montel's avatar
Laurent Montel committed
25
    Q_REQUIRED_RESULT QString printArchiveListInfo() const;
26
27

    void setEnableAgent(bool b);
Laurent Montel's avatar
Laurent Montel committed
28
    Q_REQUIRED_RESULT bool enabledAgent() const;
29

Laurent Montel's avatar
Laurent Montel committed
30
    Q_REQUIRED_RESULT QString printCurrentListInfo() const;
31
32
33
34
35
36
37
38
39
40
    void archiveFolder(const QString &path, Akonadi::Collection::Id collectionId);
Q_SIGNALS:
    void needUpdateConfigDialogBox();

public Q_SLOTS:
    void reload();
    void pause();
    void resume();

protected:
41
    void doSetOnline(bool online) override;
42
43

private:
44
    void mailCollectionRemoved(const Akonadi::Collection &collection);
Laurent Montel's avatar
Laurent Montel committed
45
    QTimer *mTimer = nullptr;
Laurent Montel's avatar
Laurent Montel committed
46
    ArchiveMailManager *const mArchiveManager;
47
48
49
};

#endif /* ARCHIVEMAILAGENT_H */