File indexing completed on 2024-05-12 05:25:33

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 class KZip;
0011 class PimDataBackupThread;
0012 class ExportResourceArchiveJob : public QObject
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit ExportResourceArchiveJob(QObject *parent = nullptr);
0017     ~ExportResourceArchiveJob() override;
0018 
0019     void setArchivePath(const QString &archivePath);
0020 
0021     void setUrl(const QString &url);
0022 
0023     void setIdentifier(const QString &identifier);
0024 
0025     void setArchive(KZip *zip);
0026     void start();
0027     void setArchiveName(const QString &archiveName);
0028 
0029 Q_SIGNALS:
0030     void error(const QString &str);
0031     void info(const QString &str);
0032     void terminated();
0033 
0034 public Q_SLOTS:
0035     void slotTaskCanceled();
0036 
0037 private:
0038     void slotTerminated(bool success);
0039     void finished();
0040     QString mArchiveName;
0041     QString mUrl;
0042     QString mArchivePath;
0043     QString mIdentifier;
0044     KZip *mZip = nullptr;
0045     PimDataBackupThread *mThread = nullptr;
0046 };