File indexing completed on 2025-01-05 05:23:46

0001 /*
0002     This file is part of the Okteta Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2009, 2012 Alex Richardson <alex.richardson@gmx.de>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_STRUCTUREADDREMOVEWIDGET_HPP
0010 #define KASTEN_STRUCTUREADDREMOVEWIDGET_HPP
0011 
0012 #include <QWidget>
0013 
0014 class QPushButton;
0015 class QLabel;
0016 class QTreeWidget;
0017 
0018 namespace Kasten {
0019 class StructureDefinitionFile;
0020 }
0021 class StructureEnabledList;
0022 
0023 class StructureAddRemoveWidget : public QWidget
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit StructureAddRemoveWidget(const QMap<QString, Kasten::StructureDefinitionFile*>& structureDefs,
0029                                       const StructureEnabledList& enabledList, QWidget* parent = nullptr);
0030     ~StructureAddRemoveWidget() override;
0031 
0032 public:
0033     QStringList values() const;
0034 
0035 private Q_SLOTS:
0036     void moveLeft();
0037     void moveRight();
0038     void moveUp();
0039     void moveDown();
0040 
0041 private:
0042     void buildAvailableList(const QMap<QString, Kasten::StructureDefinitionFile*>& structureDefs,
0043                             const StructureEnabledList& enabledList);
0044     void appendEnabledStructureItem(const QString& id, const QString& structure, bool isOnlyOne);
0045 
0046 private:
0047     QLabel* mTree1Label;
0048     QTreeWidget* mTreeAvailable;
0049 
0050     QLabel* mTree2Label;
0051     QTreeWidget* mTreeSelected;
0052 
0053     QPushButton* mRightButton;
0054     QPushButton* mLeftButton;
0055 
0056     QPushButton* mUpButton;
0057     QPushButton* mDownButton;
0058 };
0059 
0060 #endif // KASTEN_STRUCTUREADDREMOVEWIDGET_HPP