1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef PROJECTGENERATOR_H
6#define PROJECTGENERATOR_H
7
8#include "projectinfo.h"
9
10#include "common/common.h"
11
12#include <framework/framework.h>
13
14#include <QStandardItem>
15#include <QMenu>
16
17class QFileDialog;
18namespace dpfservice {
19
20class ProjectGenerator : public Generator
21{
22 Q_OBJECT
23public:
24 ProjectGenerator(){}
25 virtual QStringList supportLanguages();
26 virtual QStringList supportFileNames();
27 virtual QAction* openProjectAction(const QString &language, const QString &actionText);
28 virtual bool canOpenProject(const QString &kitName, const QString &language,
29 const QString &workspace);
30 virtual bool isOpenedProject(const QString &kitName, const QString &language,
31 const QString &workspace);
32 virtual void doProjectOpen(const QString &language, const QString &actionText,
33 const QString &workspace);
34 virtual QDialog* configureWidget(const QString &language, const QString &workspace);
35 virtual bool configure(const ProjectInfo &projectInfo);
36 virtual QStandardItem *createRootItem(const ProjectInfo &info);
37 virtual void removeRootItem(QStandardItem *root);
38 virtual QMenu* createItemMenu(const QStandardItem *item);
39 static QStandardItem *root(QStandardItem *child);
40 static const QModelIndex root(const QModelIndex &child);
41signals:
42 void itemChanged(QStandardItem *item, const QList<QStandardItem*> &newChilds);
43};
44} // namespace dpfservice
45
46#endif // PROJECTGENERATOR_H
47