File indexing completed on 2025-01-26 05:24:22

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 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_MULTIDOCUMENTSTRATEGY_HPP
0010 #define KASTEN_MULTIDOCUMENTSTRATEGY_HPP
0011 
0012 // lib
0013 #include "abstractdocumentstrategy.hpp"
0014 
0015 namespace Kasten {
0016 class ViewManager;
0017 class DocumentManager;
0018 class MultiDocumentStrategyPrivate;
0019 
0020 class KASTENGUI_EXPORT MultiDocumentStrategy : public AbstractDocumentStrategy
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     MultiDocumentStrategy(DocumentManager* documentManager,
0026                           ViewManager* viewManager);
0027     ~MultiDocumentStrategy() override;
0028 
0029 public: // AbstractDocumentStrategy API
0030     void createNew() override;
0031     void createNewFromClipboard() override;
0032     void createNewWithGenerator(AbstractModelDataGenerator* generator) override;
0033 
0034     void load(const QUrl& url) override;
0035 
0036     void closeDocument(AbstractDocument* document) override;
0037     void closeAll() override;
0038     void closeAllOther(AbstractDocument* document) override;
0039 
0040 public: // const AbstractDocumentStrategy API
0041     QVector<AbstractDocument*> documents() const override;
0042     QStringList supportedRemoteTypes() const override;
0043 
0044     bool canClose(AbstractDocument* document) const override;
0045     bool canCloseAll() const override;
0046     bool canCloseAllOther(AbstractDocument* document) const override;
0047 
0048 private:
0049     Q_DECLARE_PRIVATE(MultiDocumentStrategy)
0050 };
0051 
0052 }
0053 
0054 #endif