archivemailkernel.h 1.85 KB
Newer Older
1
/*
2
3
4
   SPDX-FileCopyrightText: 2012-2020 Laurent Montel <montel@kde.org>

   SPDX-License-Identifier: GPL-2.0-or-later
5
6
7
8
9
10
11
*/

#ifndef ARCHIVEMAILKERNEL_H
#define ARCHIVEMAILKERNEL_H

#include <MailCommon/MailInterfaces>

Laurent Montel's avatar
Laurent Montel committed
12
namespace Akonadi {
13
14
15
16
class EntityTreeModel;
class EntityMimeTypeFilterModel;
}

Laurent Montel's avatar
Laurent Montel committed
17
namespace MailCommon {
18
19
20
21
22
23
class FolderCollectionMonitor;
class JobScheduler;
}

class ArchiveMailKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings
{
24
    Q_OBJECT
25
public:
Laurent Montel's avatar
Laurent Montel committed
26
    explicit ArchiveMailKernel(QObject *parent = nullptr);
27

28
29
    static ArchiveMailKernel *self();

30
31
    KIdentityManagement::IdentityManager *identityManager() override;
    MessageComposer::MessageSender *msgSender() override;
32

33
34
35
36
37
38
    Akonadi::EntityMimeTypeFilterModel *collectionModel() const override;
    KSharedConfig::Ptr config() override;
    void syncConfig() override;
    MailCommon::JobScheduler *jobScheduler() const override;
    Akonadi::ChangeRecorder *folderCollectionMonitor() const override;
    void updateSystemTray() override;
39

Laurent Montel's avatar
Laurent Montel committed
40
41
42
43
    Q_REQUIRED_RESULT qreal closeToQuotaThreshold() override;
    Q_REQUIRED_RESULT bool excludeImportantMailFromExpiry() override;
    Q_REQUIRED_RESULT QStringList customTemplates() override;
    Q_REQUIRED_RESULT Akonadi::Collection::Id lastSelectedFolder() override;
44
    void setLastSelectedFolder(Akonadi::Collection::Id col) override;
Laurent Montel's avatar
Laurent Montel committed
45
    Q_REQUIRED_RESULT bool showPopupAfterDnD() override;
46
    void expunge(Akonadi::Collection::Id col, bool sync) override;
47
48

private:
Laurent Montel's avatar
Laurent Montel committed
49
    Q_DISABLE_COPY(ArchiveMailKernel)
Laurent Montel's avatar
Laurent Montel committed
50
51
52
53
54
    KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
    MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor = nullptr;
    Akonadi::EntityTreeModel *mEntityTreeModel = nullptr;
    Akonadi::EntityMimeTypeFilterModel *mCollectionModel = nullptr;
    MailCommon::JobScheduler *mJobScheduler = nullptr;
55
56
57
};

#endif