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 | |
11 | struct NinjaConfig{ |
12 | ToolChainData::ToolChainParam version; |
13 | }; |
14 | |
15 | class ToolChainData; |
16 | class NinjaWidgetPrivate; |
17 | class NinjaWidget : public PageWidget |
18 | { |
19 | Q_OBJECT |
20 | public: |
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 | |
27 | signals: |
28 | |
29 | public slots: |
30 | |
31 | private: |
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 |