File indexing completed on 2024-09-22 05:16:07

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2006-2008 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_SELECTCONTROLLER_HPP
0010 #define KASTEN_SELECTCONTROLLER_HPP
0011 
0012 // Kasten gui
0013 #include <Kasten/AbstractXmlGuiController>
0014 
0015 class KXMLGUIClient;
0016 class QAction;
0017 
0018 namespace Kasten {
0019 
0020 namespace If {
0021 class DataSelectable;
0022 }
0023 
0024 class SelectController : public AbstractXmlGuiController
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit SelectController(KXMLGUIClient* guiClient);
0030 
0031 public: // AbstractXmlGuiController API
0032     void setTargetModel(AbstractModel* model) override;
0033 
0034 private Q_SLOTS: // action slots
0035     void selectAll();
0036     void unselect();
0037 
0038 private Q_SLOTS:
0039     void onHasSelectedDataChanged(bool hasSelectedData);
0040 
0041 private:
0042     AbstractModel* mModel = nullptr;
0043     If::DataSelectable* mSelectControl = nullptr;
0044 
0045     QAction* mSelectAllAction;
0046     QAction* mDeselectAction;
0047 };
0048 
0049 }
0050 
0051 #endif