1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef CODEPORTINGMANAGER_H
6#define CODEPORTINGMANAGER_H
7
8#include "codeporting.h"
9
10#include <QObject>
11
12class ConfigWidget;
13class OutputPane;
14class ReportPane;
15class CodePortingManager : public QObject
16{
17 Q_OBJECT
18public:
19 static CodePortingManager *instance();
20 OutputPane *getOutputPane() const;
21 QWidget *getReportPane() const;
22
23signals:
24
25public slots:
26 void slotShowConfigWidget();
27 void slotPortingStart(const QString &project, const QString &srcCPU, const QString &destCPU);
28 void slotAppendOutput(const QString &, OutputPane::OutputFormat format, OutputPane::AppendMode);
29 void slotPortingStatus(CodePorting::PortingStatus status);
30 void slotSelectedChanged(const QString &filePath, const QString &suggestion, int startLine, int endLine);
31
32private:
33 explicit CodePortingManager(QObject *parent = nullptr);
34 ~CodePortingManager();
35
36 void resetUI();
37
38 ConfigWidget *cfgWidget = nullptr;
39 OutputPane *outputPane = nullptr;
40 ReportPane *reportPane = nullptr;
41
42 CodePorting codeporting;
43};
44
45#endif // CODEPORTINGMANAGER_H
46