Warning, file /pim/mailcommon/src/folder/foldercollectionmonitor.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002   SPDX-FileCopyrightText: 2009-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "mailcommon_export.h"
0010 
0011 #include <KIO/Job>
0012 #include <KSharedConfig>
0013 
0014 #include <QModelIndex>
0015 #include <QObject>
0016 
0017 class QAbstractItemModel;
0018 
0019 namespace Akonadi
0020 {
0021 class ChangeRecorder;
0022 class Collection;
0023 class Session;
0024 }
0025 
0026 namespace MailCommon
0027 {
0028 class FolderCollectionMonitorPrivate;
0029 /**
0030  * @brief The FolderCollectionMonitor class
0031  * @author Laurent Montel <montel@kde.org>
0032  */
0033 class MAILCOMMON_EXPORT FolderCollectionMonitor : public QObject
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     explicit FolderCollectionMonitor(Akonadi::Session *session, QObject *parent = nullptr);
0039     ~FolderCollectionMonitor() override;
0040 
0041     [[nodiscard]] Akonadi::ChangeRecorder *monitor() const;
0042     void expireAllFolders(bool immediate, QAbstractItemModel *collectionModel);
0043     void expunge(const Akonadi::Collection &, bool sync = false);
0044 
0045 protected:
0046     void expireAllCollection(const QAbstractItemModel *model, bool immediate, const QModelIndex &parentIndex = QModelIndex());
0047 
0048 private:
0049     MAILCOMMON_NO_EXPORT void slotDeleteJob(KJob *job);
0050     std::unique_ptr<FolderCollectionMonitorPrivate> const d;
0051 };
0052 }