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

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2006-2007, 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_ABSTRACTDOCUMENTFACTORY_HPP
0010 #define KASTEN_ABSTRACTDOCUMENTFACTORY_HPP
0011 
0012 // lib
0013 #include "kastencore_export.hpp"
0014 // Qt
0015 #include <QObject>
0016 
0017 class QMimeData;
0018 
0019 namespace Kasten {
0020 
0021 class AbstractDocument;
0022 
0023 class KASTENCORE_EXPORT AbstractDocumentFactory : public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     ~AbstractDocumentFactory() override;
0029 
0030 public: // API to be implemented
0031     /// default returns false
0032     virtual bool canCreateFromData(const QMimeData* mimeData);
0033 
0034     virtual AbstractDocument* create() = 0;
0035     /// default returns 0
0036     virtual AbstractDocument* createFromData(const QMimeData* mimeData, bool setModified);
0037 };
0038 
0039 }
0040 
0041 #endif