1 /* 2 SPDX-FileCopyrightText: 2013-2021 Laurent Montel <montel@kde.org> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include "abstractimportexportjob.h" 10 #include "pimdataexportercore_private_export.h" 11 class ArchiveStorage; 12 13 class PIMDATAEXPORTER_TESTS_EXPORT ExportAddressbookJobInterface : public AbstractImportExportJob 14 { 15 Q_OBJECT 16 public: 17 explicit ExportAddressbookJobInterface(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep); 18 ~ExportAddressbookJobInterface() override; 19 20 void start() override; 21 void slotWriteNextArchiveResource(); 22 void slotAddressbookJobTerminated(); 23 24 protected: 25 virtual void convertCollectionToRealPath(KConfigGroup &group, const QString ¤tKey) = 0; 26 virtual void convertCollectionListToRealPath(KConfigGroup &group, const QString ¤tKey) = 0; 27 void slotCheckBackupConfig(); 28 virtual void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) = 0; 29 Q_REQUIRED_RESULT virtual QVector<Utils::AkonadiInstanceInfo> listOfResource() = 0; 30 Q_REQUIRED_RESULT virtual QString resourcePath(const QString &agentIdentifier, const QString &defaultPath) const = 0; 31 virtual void backupAddressBookResourceFile(const QString &agentIdentifier, const QString &defaultPath) = 0; 32 33 private: 34 void slotCheckBackupResource(); 35 36 void backupConfig(); 37 int mIndexIdentifier = 0; 38 }; 39