File indexing completed on 2025-01-26 05:24:15
0001 /* 0002 This file is part of the Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2021 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_VIEWAREACONTEXTMENUCONTROLLER_HPP 0010 #define KASTEN_VIEWAREACONTEXTMENUCONTROLLER_HPP 0011 0012 // Kasten gui 0013 #include <Kasten/AbstractXmlGuiController> 0014 0015 class KXMLGUIClient; 0016 class QPoint; 0017 class QAction; 0018 0019 namespace Kasten { 0020 0021 class MultiViewAreas; 0022 class AbstractGroupedViews; 0023 class AbstractView; 0024 class DocumentSyncManager; 0025 class AbstractDocument; 0026 0027 class ViewAreaContextMenuController : public AbstractXmlGuiController 0028 { 0029 Q_OBJECT 0030 0031 public: 0032 ViewAreaContextMenuController(MultiViewAreas* multiViewAreas, 0033 DocumentSyncManager* syncManager, 0034 KXMLGUIClient* guiClient); 0035 0036 public: // AbstractXmlGuiController API 0037 void setTargetModel(AbstractModel* model) override; 0038 0039 private Q_SLOTS: // slots 0040 void showContextMenu(AbstractGroupedViews* viewArea, AbstractView* view, QPoint pos); 0041 0042 void reload(); 0043 void close(); 0044 void closeAll(); 0045 void closeAllOther(); 0046 0047 private: 0048 AbstractGroupedViews* mViewArea = nullptr; 0049 AbstractView* mView = nullptr; 0050 AbstractDocument* mDocument = nullptr; 0051 0052 KXMLGUIClient* const mGuiClient; 0053 MultiViewAreas* const mMultiViewAreas; 0054 DocumentSyncManager* const mSyncManager; 0055 0056 QAction* mReloadAction; 0057 QAction* mCloseAction; 0058 QAction* mCloseAllAction; 0059 QAction* mCloseAllOtherAction; 0060 }; 0061 0062 } 0063 0064 #endif