summaryrefslogtreecommitdiff
path: root/ui/commentdialog.h
blob: c25e18570de44712eaffa14d67dc0ac7ddf4867b (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once

#include <QtWidgets/QDialog>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QTextEdit>
#include "binaryninjaapi.h"
#include "uicontext.h"
#include "uicomment.h"

/*!

	\defgroup commentdialog CommentDialog
 	\ingroup uiapi
*/

/*!

    \ingroup commentdialog
*/
class BINARYNINJAUIAPI CommentDialogTextEdit : public QTextEdit
{
	Q_OBJECT

public:
	CommentDialogTextEdit(QWidget* parent);

protected:
	virtual void keyPressEvent(QKeyEvent* event) override;

Q_SIGNALS:
	void contentAccepted();
};

/*!

    \ingroup commentdialog
*/
class BINARYNINJAUIAPI CommentDialog : public QDialog
{
	Q_OBJECT

	CommentDialogTextEdit* m_comment;
	UIComment m_uicomment;

  public:
	CommentDialog(QWidget* parent, const UIComment& comment);
	QString getNewComment();
	QString getCurrentComment();
	const FunctionRef& getCommentBackingFunction();
	const BinaryViewRef& getCommentBackingData();
	UICommentType getCommentType();
	uint64_t getCommentAddress();
};