File indexing completed on 2025-02-02 05:43:14

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008-2009, 2011 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_ABSTRACTFILESYSTEMSYNCWITHREMOTEJOB_HPP
0010 #define KASTEN_ABSTRACTFILESYSTEMSYNCWITHREMOTEJOB_HPP
0011 
0012 // library
0013 #include "abstractsyncwithremotejob.hpp"
0014 #include "abstractmodelsynchronizer.hpp"
0015 
0016 class QUrl;
0017 class QFile;
0018 
0019 namespace Kasten {
0020 
0021 class AbstractModelFileSystemSynchronizer;
0022 
0023 class AbstractFileSystemSyncWithRemoteJobPrivate;
0024 
0025 class KASTENCORE_EXPORT AbstractFileSystemSyncWithRemoteJob : public AbstractSyncWithRemoteJob
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     AbstractFileSystemSyncWithRemoteJob(AbstractModelFileSystemSynchronizer* synchronizer,
0031                                         const QUrl& url, AbstractModelSynchronizer::ConnectOption option);
0032     ~AbstractFileSystemSyncWithRemoteJob() override;
0033 
0034 public: // KJob API
0035     void start() override;
0036 
0037 protected: // API to be implemented
0038     virtual void startSyncWithRemote() = 0;
0039 
0040 protected:
0041     AbstractModelFileSystemSynchronizer* synchronizer() const;
0042     QFile* file() const;
0043 
0044 protected:
0045     void completeSync(bool success);
0046 
0047 private:
0048     Q_PRIVATE_SLOT(d_func(), void syncWithRemote())
0049 
0050 private:
0051     Q_DECLARE_PRIVATE(AbstractFileSystemSyncWithRemoteJob)
0052 };
0053 
0054 }
0055 
0056 #endif