File indexing completed on 2025-01-26 05:24:14
0001 /* 0002 This file is part of the Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2007-2008, 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_COPYASCONTROLLER_HPP 0010 #define KASTEN_COPYASCONTROLLER_HPP 0011 0012 // Kasten gui 0013 #include <Kasten/AbstractXmlGuiController> 0014 0015 class KXMLGUIClient; 0016 class KSelectAction; 0017 class QAction; 0018 0019 namespace Kasten { 0020 0021 class ModelCodecViewManager; 0022 class ModelCodecManager; 0023 namespace If { 0024 class DataSelectable; 0025 } 0026 class AbstractModelStreamEncoder; 0027 class AbstractModelSelection; 0028 0029 class CopyAsController : public AbstractXmlGuiController 0030 { 0031 Q_OBJECT 0032 0033 public: 0034 CopyAsController(ModelCodecViewManager* modelCodecViewManager, 0035 ModelCodecManager* modelCodecManager, 0036 KXMLGUIClient* guiClient); 0037 0038 public: // AbstractXmlGuiController API 0039 void setTargetModel(AbstractModel* model) override; 0040 0041 private Q_SLOTS: 0042 void updateActions(); 0043 void onActionTriggered(QAction* action); 0044 void triggerExecution(Kasten::AbstractModelStreamEncoder* encoder, 0045 const Kasten::AbstractModelSelection* selection); 0046 0047 private: 0048 ModelCodecViewManager* mModelCodecViewManager; 0049 ModelCodecManager* mModelCodecManager; 0050 0051 AbstractModel* mModel = nullptr; 0052 If::DataSelectable* mSelectionControl = nullptr; 0053 0054 KSelectAction* mCopyAsSelectAction; 0055 }; 0056 0057 } 0058 0059 #endif