File indexing completed on 2024-05-05 04:39:18

0001 /*
0002     SPDX-FileCopyrightText: 2020 Friedrich W. H. Kossebau <kossebau@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVCLAZY_CHECKSETSELECTIONCOMBOBOX_H
0008 #define KDEVCLAZY_CHECKSETSELECTIONCOMBOBOX_H
0009 
0010 // plugin
0011 #include "checksetselection.h"
0012 // KF
0013 #include <KComboBox>
0014 // Qt
0015 #include <QVector>
0016 
0017 
0018 namespace Clazy {
0019 
0020 class CheckSetSelectionComboBox : public KComboBox
0021 {
0022     Q_OBJECT
0023     Q_PROPERTY(QString selection READ selection WRITE setSelection NOTIFY selectionChanged USER true)
0024 
0025 public:
0026     explicit CheckSetSelectionComboBox(QWidget* parent = nullptr);
0027 
0028 public:
0029     void setCheckSetSelections(const QVector<CheckSetSelection>& checkSetSelections,
0030                                const QString& defaultCheckSetSelectionId);
0031 
0032 public:
0033     QString selection() const;
0034     void setSelection(const QString& selection);
0035 
0036 Q_SIGNALS:
0037     void selectionChanged(const QString& selection);
0038 
0039 private Q_SLOTS:
0040     void onCurrentIndexChanged();
0041 };
0042 
0043 }
0044 
0045 #endif