File indexing completed on 2025-02-09 07:11:24

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_ABSTRACTFILESYSTEMEXPORTJOB_HPP
0010 #define KASTEN_ABSTRACTFILESYSTEMEXPORTJOB_HPP
0011 
0012 // lib
0013 #include "abstractexportjob.hpp"
0014 
0015 class QUrl;
0016 class QFile;
0017 
0018 namespace Kasten {
0019 
0020 class AbstractModel;
0021 class AbstractModelSelection;
0022 
0023 class AbstractFileSystemExportJobPrivate;
0024 
0025 class KASTENCORE_EXPORT AbstractFileSystemExportJob : public AbstractExportJob
0026 {
0027     Q_OBJECT
0028 
0029 protected:
0030     KASTENCORE_NO_EXPORT explicit AbstractFileSystemExportJob(AbstractFileSystemExportJobPrivate* d);
0031 
0032 public:
0033     AbstractFileSystemExportJob(AbstractModel* model, const AbstractModelSelection* selection,
0034                                 const QUrl& url);
0035 
0036     ~AbstractFileSystemExportJob() override;
0037 
0038 public: // KJob API
0039     void start() override;
0040 
0041 protected: // API to be implemented
0042     virtual void startExportToFile() = 0;
0043 
0044 protected:
0045     void completeExport(bool success);
0046 
0047 protected:
0048     AbstractModel* model() const;
0049     const AbstractModelSelection* selection() const;
0050     QFile* file() const;
0051 
0052 private:
0053     Q_PRIVATE_SLOT(d_func(), void exportToFile())
0054 
0055 private:
0056     Q_DECLARE_PRIVATE(AbstractFileSystemExportJob)
0057 };
0058 
0059 }
0060 
0061 #endif