1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef NINJAWIDGET_H
6#define NINJAWIDGET_H
7
8#include "services/option/toolchaindata.h"
9#include "common/widget/pagewidget.h"
10
11struct NinjaConfig{
12 ToolChainData::ToolChainParam version;
13};
14
15class ToolChainData;
16class NinjaWidgetPrivate;
17class NinjaWidget : public PageWidget
18{
19 Q_OBJECT
20public:
21 explicit NinjaWidget(QWidget *parent = nullptr);
22 ~NinjaWidget() override;
23
24 void setUserConfig(const QMap<QString, QVariant> &map) override;
25 void getUserConfig(QMap<QString, QVariant> &map) override;
26
27signals:
28
29public slots:
30
31private:
32 void setupUi();
33 void updateUi();
34
35 bool dataToMap(const NinjaConfig &config, QMap<QString, QVariant> &map);
36 bool mapToData(const QMap<QString, QVariant> &map, NinjaConfig &config);
37
38 bool getControlValue(QMap<QString, QVariant> &map);
39 void setControlValue(const QMap<QString, QVariant> &map);
40
41 NinjaWidgetPrivate *const d;
42};
43
44#endif // NINJAWIDGET_H
45