mailkernel.h 1.74 KB
Newer Older
1
/*
2
3
4
   SPDX-FileCopyrightText: 2018 Daniel Vrátil <dvratil@kde.org>

   SPDX-License-Identifier: GPL-2.0-or-later
5
6
*/

Laurent Montel's avatar
Laurent Montel committed
7
#pragma once
8
9

#include <MailCommon/MailInterfaces>
Laurent Montel's avatar
Laurent Montel committed
10
#include <QObject>
11

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

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

Laurent Montel's avatar
Laurent Montel committed
23
class MailKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings
24
25
26
{
    Q_OBJECT
public:
Daniel Vrátil's avatar
Daniel Vrátil committed
27
    explicit MailKernel(const KSharedConfigPtr &config, QObject *parent = nullptr);
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    ~MailKernel() override;

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

    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;

    qreal closeToQuotaThreshold() override;
    bool excludeImportantMailFromExpiry() override;
    QStringList customTemplates() override;
    Akonadi::Collection::Id lastSelectedFolder() override;
    void setLastSelectedFolder(Akonadi::Collection::Id col) override;
    bool showPopupAfterDnD() override;
    void expunge(Akonadi::Collection::Id id, bool sync) override;

private:
    Q_DISABLE_COPY(MailKernel)

    KSharedConfigPtr mConfig;
Laurent Montel's avatar
Laurent Montel committed
52
53
    KIdentityManagement::IdentityManager *const mIdentityManager;
    MessageComposer::MessageSender *const mMessageSender;
54
55
56
57
58
    MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor = nullptr;
    Akonadi::EntityTreeModel *mEntityTreeModel = nullptr;
    Akonadi::EntityMimeTypeFilterModel *mCollectionModel = nullptr;
};