File indexing completed on 2024-05-12 05:11:10

0001 /*
0002     SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>
0003     SPDX-FileCopyrightText: 2010 Andras Mantia <andras@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "commandbase.h"
0011 #include "messagestatus.h"
0012 
0013 #include <Akonadi/Collection>
0014 #include <Akonadi/Item>
0015 
0016 #include "akonadi-mime_export.h"
0017 
0018 #include <memory>
0019 
0020 class KJob;
0021 namespace Akonadi
0022 {
0023 class MarkAsCommandPrivate;
0024 class AKONADI_MIME_EXPORT MarkAsCommand : public CommandBase
0025 {
0026     Q_OBJECT
0027 public:
0028     MarkAsCommand(MessageStatus targetStatus, const Akonadi::Item::List &msgList, bool invert = false, QObject *parent = nullptr);
0029     MarkAsCommand(MessageStatus targetStatus, const Akonadi::Collection::List &folders, bool invert = false, bool recursive = false, QObject *parent = nullptr);
0030     ~MarkAsCommand() override;
0031     void execute() override;
0032 
0033 private:
0034     AKONADI_MIME_NO_EXPORT void slotCollectionFetchDone(KJob *job);
0035     AKONADI_MIME_NO_EXPORT void slotFetchDone(KJob *job);
0036     AKONADI_MIME_NO_EXPORT void slotHelperDone(Result result);
0037     AKONADI_MIME_NO_EXPORT void slotModifyItemDone();
0038     AKONADI_MIME_NO_EXPORT void markMessages();
0039 
0040     std::unique_ptr<MarkAsCommandPrivate> const d;
0041 };
0042 }