File indexing completed on 2025-01-05 05:23:47
0001 /* 0002 This file is part of the Okteta Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2022 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 STRUCTURESSELECTOR_HPP 0010 #define STRUCTURESSELECTOR_HPP 0011 0012 // tool 0013 #include "../structuremetadata.hpp" 0014 // Qt 0015 #include <QWidget> 0016 #include <QMap> 0017 0018 class KCategorizedView; 0019 class KCategoryDrawer; 0020 0021 class QLineEdit; 0022 0023 namespace Kasten { 0024 class StructureDefinitionFile; 0025 } 0026 class StructuresSelectionSortFilterProxyModel; 0027 class StructuresSelectionModel; 0028 class StructureItemDelegate; 0029 class StructureEnabledList; 0030 0031 class StructuresSelector : public QWidget 0032 { 0033 Q_OBJECT 0034 0035 public: 0036 explicit StructuresSelector(QWidget* parent = nullptr); 0037 0038 ~StructuresSelector() override; 0039 0040 public: 0041 void setStructures(const QMap<QString, Kasten::StructureDefinitionFile*>& structureDefs); 0042 void setEnabledStructures(const QStringList& enabledStructures); 0043 0044 QStringList enabledStructures() const; 0045 const StructureEnabledList& enabledList() const; 0046 0047 Q_SIGNALS: 0048 void enabledStructuresChanged(); 0049 0050 private: 0051 StructuresSelectionModel* m_structuresModel; 0052 StructuresSelectionSortFilterProxyModel* m_soirtFilterProxyModel; 0053 0054 QLineEdit* m_lineEdit; 0055 KCategorizedView* m_listView; 0056 KCategoryDrawer* m_categoryDrawer; 0057 StructureItemDelegate* m_structureDelegate; 0058 }; 0059 0060 #endif