1#pragma once
2
3#include <QFrame>
4
5namespace DiffHelper
6{
7struct DiffChange;
8}
9
10class LineNumberArea;
11class FileDiffView;
12
13class PrChangeListItem : public QFrame
14{
15 Q_OBJECT
16
17signals:
18 void gotoReview(int linkId);
19 void addCodeReview(int line, const QString &path, const QString &body);
20
21public:
22 explicit PrChangeListItem(DiffHelper::DiffChange change, QWidget *parent = nullptr);
23
24 void setBookmarks(const QMap<int, int> &bookmarks);
25 int getStartingLine() const { return mNewFileStartingLine; }
26 int getEndingLine() const { return mNewFileEndingLine; }
27 QString getFileName() const { return mNewFileName; }
28
29private:
30 int mNewFileStartingLine = 0;
31 int mNewFileEndingLine = 0;
32 QString mOldFileName;
33 QString mNewFileName;
34 FileDiffView *mNewFileDiff = nullptr;
35 LineNumberArea *mNewNumberArea = nullptr;
36
37 void openReviewDialog(int line);
38};
39