1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef FILELISTWIDGET_H
6#define FILELISTWIDGET_H
7
8#include "basetype.h"
9
10#include <QTableView>
11#include <QFileIconProvider>
12
13class QStandardItem;
14class FileListDelegate; // gitqlient class;
15class FileModifyViewPrivate;
16class FileModifyView : public QTableView
17{
18 Q_OBJECT
19 FileModifyViewPrivate *const d;
20signals:
21 void diffChecked(const RevisionFile &file);
22 void menuRequest(const RevisionFile &file, const QPoint &global);
23
24public:
25 explicit FileModifyView(QWidget *parent = nullptr);
26 RevisionFile file(int row);
27 RevisionFiles files();
28 void clean();
29 void addFile(const RevisionFile &file);
30 void addFiles(const RevisionFiles &files);
31 void setFiles(const RevisionFiles &files);
32 bool removeFile(const RevisionFile &file);
33 int rowCount();
34private:
35 void showContextMenu(const QPoint &);
36 QList<QStandardItem *> createRows(const RevisionFile &file);
37 RevisionFile createFile(int row);
38};
39
40#endif // FILELISTWIDGET_H
41