File indexing completed on 2024-06-23 05:49:21

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008-2009 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_ABSTRACTLOADJOB_HPP
0010 #define KASTEN_ABSTRACTLOADJOB_HPP
0011 
0012 // lib
0013 #include "kastencore_export.hpp"
0014 // KF
0015 #include <KJob>
0016 // Std
0017 #include <memory>
0018 
0019 namespace Kasten {
0020 
0021 class AbstractDocument;
0022 
0023 class AbstractLoadJobPrivate;
0024 
0025 class KASTENCORE_EXPORT AbstractLoadJob : public KJob
0026 {
0027     Q_OBJECT
0028 
0029 protected:
0030     KASTENCORE_NO_EXPORT explicit AbstractLoadJob(AbstractLoadJobPrivate* d);
0031 
0032 public:
0033     AbstractLoadJob();
0034 
0035     ~AbstractLoadJob() override;
0036 
0037 public:
0038     AbstractDocument* document() const;
0039 
0040 Q_SIGNALS:
0041     void documentLoaded(Kasten::AbstractDocument* document);
0042 
0043 protected:
0044     // emits documentLoaded()
0045     // TODO: or better name property LoadedDocument?
0046     virtual void setDocument(AbstractDocument* document);
0047 
0048 protected:
0049     const std::unique_ptr<AbstractLoadJobPrivate> d_ptr;
0050 
0051 private:
0052     Q_DECLARE_PRIVATE(AbstractLoadJob)
0053 };
0054 
0055 }
0056 
0057 #endif