File indexing completed on 2024-06-16 05:00:35

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstractimportexportjob.h"
0010 #include "pimdataexportercore_private_export.h"
0011 class ArchiveStorage;
0012 
0013 class PIMDATAEXPORTER_TESTS_EXPORT ExportNotesJobInterface : public AbstractImportExportJob
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit ExportNotesJobInterface(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
0018     ~ExportNotesJobInterface() override;
0019 
0020     void start() override;
0021 
0022     void slotCheckBackupConfig();
0023     void slotWriteNextArchiveResource();
0024 
0025 protected:
0026     virtual void convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr) = 0;
0027     virtual void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) = 0;
0028     [[nodiscard]] virtual QList<Utils::AkonadiInstanceInfo> listOfResource() = 0;
0029     void slotNoteJobTerminated();
0030     [[nodiscard]] virtual QString resourcePath(const QString &identifier) const = 0;
0031     [[nodiscard]] QString resourceArchiveName() const;
0032     [[nodiscard]] QString applicationName() const override;
0033 
0034 private:
0035     void slotCheckBackupResource();
0036 
0037     void backupConfig();
0038     void backupTheme();
0039     int mIndexIdentifier = 0;
0040 };