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

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 "pimdataexporter_export.h"
0010 #include <QObject>
0011 #include <QStringList>
0012 class KJob;
0013 class PIMDATAEXPORTER_EXPORT SynchronizeResourceJob : public QObject
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit SynchronizeResourceJob(QObject *parent = nullptr);
0018     ~SynchronizeResourceJob() override;
0019 
0020     void start();
0021     void setListResources(const QStringList &resources);
0022     void setSynchronizeOnlyCollection(bool onlyCollection);
0023 
0024 Q_SIGNALS:
0025     void synchronizationFinished();
0026     void synchronizationInstanceDone(const QString &name, const QString &identifier);
0027     void synchronizationInstanceFailed(const QString &);
0028 
0029 private:
0030     void slotSynchronizationFinished(KJob *);
0031     void slotNextSync();
0032 
0033     QStringList mListResources;
0034     int mIndex = 0;
0035     bool mOnlyCollection = true;
0036 };