summaryrefslogtreecommitdiff
path: root/ui/reportwidget.h
blob: 22d51604ac26a81ffd3cc97f50640d5c29c50fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include <QtWidgets/QWidget>
#include <QtWidgets/QTextBrowser>
#include <QtWidgets/QScrollArea>
#include "binaryninjaapi.h"
#include "action.h"

class BINARYNINJAUIAPI ReportWidget: public QScrollArea, public UIActionHandler
{
	Q_OBJECT

	QTextBrowser* m_contents;
	BinaryViewRef m_view;
	std::string m_original;
	std::string m_title;
	BNReportType m_type;
	std::string m_plaintext;

private Q_SLOTS:
	void onLinkClicked(QUrl url);

public:
	ReportWidget(QWidget* parent, BinaryViewRef view, const std::string& contents,
		BNReportType type, const std::string& title, const std::string& plaintext = "");
	std::string getContents() const { return m_original; }
	std::string getTitle() const { return m_title; }
	BNReportType getType() const { return m_type; }
	std::string getPlainText() const { return m_plaintext; }

	void save();
	void saveAs();
};