File indexing completed on 2024-05-26 05:27:07

0001 /*
0002    SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "importexportmailutil.h"
0010 #include "pimdataexportercore_private_export.h"
0011 #include <Akonadi/Collection>
0012 #include <QObject>
0013 class KArchiveDirectory;
0014 class ImportMailJobInterface;
0015 class PIMDATAEXPORTER_TESTS_EXPORT ImportMailFolderAttributeJob : public QObject
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit ImportMailFolderAttributeJob(QObject *parent = nullptr);
0020     ~ImportMailFolderAttributeJob() override;
0021 
0022     [[nodiscard]] bool canStart() const;
0023 
0024     void setArchiveDirectory(const KArchiveDirectory *zip);
0025     void setExportInterface(ImportMailJobInterface *interface);
0026     void setExtractPath(const QString &extractPath);
0027     void start();
0028 
0029 Q_SIGNALS:
0030     void successed();
0031     void failed();
0032 
0033 protected:
0034     virtual void applyAttributes(const QMap<Akonadi::Collection::Id, ImportExportMailUtil::AttributeInfo> &) = 0;
0035     void restoreFileFolderAttribute();
0036     QString mExtractPath;
0037 
0038 private:
0039     const KArchiveDirectory *mArchiveDirectory = nullptr;
0040     ImportMailJobInterface *mInterface = nullptr;
0041 };