1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef BREAKPOINTITEM_H
6#define BREAKPOINTITEM_H
7
8#include "breakpoint.h"
9
10#include <QTreeView>
11#include <QObject>
12
13enum StackColumns {
14 kIndexColumn,
15 kFunctionNameColumn,
16 kFileNameColumn,
17 kLineNumberColumn,
18 kAddressColumn,
19 kStackColumnCount
20};
21
22class BreakpointItem : public QObject
23{
24 Q_OBJECT
25public:
26 explicit BreakpointItem(const Internal::Breakpoint &_bp);
27 explicit BreakpointItem(const BreakpointItem &_bp);
28 BreakpointItem();
29 ~BreakpointItem();
30
31 QVariant data(int row, int column, int role) const;
32 QString markerFileName() const;
33 int markerLineNumber() const;
34
35 int modelId() const;
36 QString displayName() const;
37 QString toolTip() const;
38
39 int lineNumber() const;
40 bool isEnabled() const;
41
42 void setEnabled(bool on);
43
44 const Internal::Breakpoint &breakpoint() const {return bp;}
45
46 BreakpointItem &operator=(const BreakpointItem &item)
47 {
48 bp = item.breakpoint();
49 return *this;
50 }
51
52 bool operator==(const BreakpointItem &item)
53 {
54 return bp == item.breakpoint();
55 }
56
57private:
58 Internal::Breakpoint bp;
59};
60
61using BreakpointItems = QVector<BreakpointItem>;
62#endif // BREAKPOINTITEM_H
63