1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef RECENTDISPLAY_H |
6 | #define RECENTDISPLAY_H |
7 | |
8 | #include <QWidget> |
9 | #include "common/common.h" |
10 | |
11 | class RecentDisplayPrivate; |
12 | class RecentDisplay : public QWidget |
13 | { |
14 | Q_OBJECT |
15 | RecentDisplayPrivate *const d; |
16 | public: |
17 | enum ItemRole{ |
18 | ProjectKitName = Qt::ItemDataRole::UserRole, |
19 | ProjectLanguage, |
20 | ProjectWorkspace, |
21 | }; |
22 | explicit RecentDisplay(QWidget *parent = nullptr); |
23 | virtual ~RecentDisplay(); |
24 | static RecentDisplay *instance(); |
25 | |
26 | public slots: |
27 | void addDocument(const QString &filePath); |
28 | void addProject(const QString &kitName, |
29 | const QString &language, |
30 | const QString &workspace); |
31 | |
32 | private slots: |
33 | void doDoubleClickedProject(const QModelIndex &index); |
34 | void doDoubleCliekedDocument(const QModelIndex &index); |
35 | }; |
36 | |
37 | #endif // RECENTDISPLAY_H |
38 |