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
11class RecentDisplayPrivate;
12class RecentDisplay : public QWidget
13{
14 Q_OBJECT
15 RecentDisplayPrivate *const d;
16public:
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
26public slots:
27 void addDocument(const QString &filePath);
28 void addProject(const QString &kitName,
29 const QString &language,
30 const QString &workspace);
31
32private slots:
33 void doDoubleClickedProject(const QModelIndex &index);
34 void doDoubleCliekedDocument(const QModelIndex &index);
35};
36
37#endif // RECENTDISPLAY_H
38