1 /*
2    SPDX-FileCopyrightText: 2013-2021 Laurent Montel <montel@kde.org>
3 
4    SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include <Akonadi/Item>
9 #include <QObject>
10 class KJob;
11 class FolderArchiveAccountInfo;
12 class FolderArchiveManager;
13 class KMMoveCommand;
14 class FolderArchiveAgentJob : public QObject
15 {
16     Q_OBJECT
17 public:
18     explicit FolderArchiveAgentJob(FolderArchiveManager *manager,
19                                    FolderArchiveAccountInfo *info,
20                                    const Akonadi::Item::List &lstItem,
21                                    QObject *parent = nullptr);
22     ~FolderArchiveAgentJob() override;
23 
24     void start();
25 
26 private:
27     Q_DISABLE_COPY(FolderArchiveAgentJob)
28     void slotFetchCollection(KJob *job);
29     void sloMoveMailsToCollection(const Akonadi::Collection &col);
30     void slotCheckFailed(const QString &message);
31     void slotCollectionIdFound(const Akonadi::Collection &col);
32     void slotMoveMessages(KMMoveCommand *);
33 
34     void sendError(const QString &error);
35     const Akonadi::Item::List mListItem;
36     FolderArchiveManager *const mManager;
37     FolderArchiveAccountInfo *const mInfo;
38 };
39 
40