| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef KIT_H |
| 6 | #define KIT_H |
| 7 | |
| 8 | #include <QHash> |
| 9 | #include <QVariant> |
| 10 | |
| 11 | #include <memory> |
| 12 | |
| 13 | class KitPrivate; |
| 14 | class Kit : public QObject |
| 15 | { |
| 16 | Q_OBJECT |
| 17 | public: |
| 18 | explicit Kit(QString id = "", QObject *parent = nullptr); |
| 19 | explicit Kit(const QVariantMap &data); |
| 20 | ~Kit(); |
| 21 | |
| 22 | QString displayName() const; |
| 23 | void setUnexpandedDisplayName(const QString &name); |
| 24 | QString id() const; |
| 25 | QList<QString> allKeys() const; |
| 26 | QVariant value(QString key, const QVariant &unset = QVariant()) const; |
| 27 | bool hasValue(QString key) const; |
| 28 | void setValue(QString key, const QVariant &value); |
| 29 | |
| 30 | void setDefaultOutput(QString &defaultOutput); |
| 31 | const QString &getDefaultOutput() const; |
| 32 | |
| 33 | void copyFrom(const Kit &k); |
| 34 | |
| 35 | Kit(const Kit &other); |
| 36 | Kit &operator=(const Kit &other); |
| 37 | signals: |
| 38 | |
| 39 | public slots: |
| 40 | |
| 41 | private: |
| 42 | QVariantMap toMap() const; |
| 43 | |
| 44 | const std::unique_ptr<KitPrivate> d; |
| 45 | }; |
| 46 | |
| 47 | #endif // KIT_H |
| 48 |