| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef TASKMANAGER_H |
| 6 | #define TASKMANAGER_H |
| 7 | |
| 8 | #include "taskmodel.h" |
| 9 | #include "taskdelegate.h" |
| 10 | #include "taskview.h" |
| 11 | |
| 12 | /** |
| 13 | * @brief Used to manage and display the information about build error, |
| 14 | * move it to seperate plugin when more type information need be processed. |
| 15 | */ |
| 16 | class TaskManager : public QObject |
| 17 | { |
| 18 | Q_OBJECT |
| 19 | public: |
| 20 | static TaskManager *instance(); |
| 21 | |
| 22 | QListView *getView() const; |
| 23 | |
| 24 | void clearTasks(); |
| 25 | |
| 26 | signals: |
| 27 | |
| 28 | public slots: |
| 29 | void slotAddTask(const Task &task, int linkedOutputLines, int skipLines); |
| 30 | |
| 31 | void currentChanged(const QModelIndex &index); |
| 32 | void triggerDefaultHandler(const QModelIndex &index); |
| 33 | |
| 34 | private: |
| 35 | explicit TaskManager(QObject *parent = nullptr); |
| 36 | |
| 37 | TaskView *view = nullptr; |
| 38 | QSharedPointer<TaskModel> model; |
| 39 | }; |
| 40 | |
| 41 | #endif // TASKMANAGER_H |
| 42 | |