summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/commentdialog.h11
-rw-r--r--ui/uicomment.h46
2 files changed, 55 insertions, 2 deletions
diff --git a/ui/commentdialog.h b/ui/commentdialog.h
index 803fcd3b..ddff7f06 100644
--- a/ui/commentdialog.h
+++ b/ui/commentdialog.h
@@ -5,14 +5,21 @@
#include "binaryninjaapi.h"
#include "dialogtextedit.h"
#include "uicontext.h"
+#include "uicomment.h"
class BINARYNINJAUIAPI CommentDialog: public QDialog
{
Q_OBJECT
DialogTextEdit* m_comment;
+ UIComment m_uicomment;
public:
- CommentDialog(QWidget* parent, const QString& comment = "");
- QString getComment();
+ CommentDialog(QWidget* parent, const UIComment& comment);
+ QString getNewComment();
+ QString getCurrentComment();
+ const FunctionRef& getCommentBackingFunction();
+ const BinaryViewRef& getCommentBackingData();
+ UICommentType getCommentType();
+ uint64_t getCommentAddress();
};
diff --git a/ui/uicomment.h b/ui/uicomment.h
new file mode 100644
index 00000000..6fd74917
--- /dev/null
+++ b/ui/uicomment.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#include "binaryninjaapi.h"
+#include "uicontext.h"
+
+// these are only intended to be used for the ui
+typedef enum
+{
+ FunctionComment,
+ AddressComment
+}UICommentType;
+
+class UIComment
+{
+ public:
+ UICommentType type;
+ FunctionRef func;
+ BinaryViewRef data;
+ uint64_t address;
+ QString content;
+
+ UIComment( UICommentType type,
+ FunctionRef func,
+ uint64_t address,
+ QString content):
+ type(type), func(func),
+ address(address), content(content)
+ {}
+
+ UIComment( UICommentType type,
+ BinaryViewRef data,
+ uint64_t address,
+ QString content):
+ type(type), data(data),
+ address(address), content(content)
+ {}
+
+ UIComment(const UIComment& rhs)
+ {
+ type = rhs.type;
+ func = rhs.func;
+ data = rhs.data;
+ address = rhs.address;
+ content = rhs.content;
+ }
+}; \ No newline at end of file