summaryrefslogtreecommitdiff
path: root/ui/possiblevaluesetdialog.h
blob: 9291e4ea7f791278a9f5825077923e8617b6bad8 (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
#pragma once

#include <QtWidgets/QDialog>
#include <QtWidgets/QLabel>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QLineEdit>

#include "uitypes.h"


/*!

    \ingroup uiapi
*/
class BINARYNINJAUIAPI PossibleValueSetDialog : public QDialog
{
	Q_OBJECT

	BinaryViewRef m_view;
	uint64_t m_addr;
	bool m_registerValueOnly;

	QComboBox* m_combo;
	QLineEdit* m_input;
	QPushButton* m_acceptButton;
	QLabel* m_formatLabel;
	QLabel* m_errorLabel;

	BNRegisterValueType m_curRegValueType;

	BinaryNinja::PossibleValueSet m_valueSet;

  public:
	PossibleValueSetDialog(
	    QWidget* parent, BinaryViewRef view, uint64_t addr, BinaryNinja::PossibleValueSet existingValue,
		const QString& title = "Set User Variable Value", bool registerValueOnly = false);

	BinaryNinja::PossibleValueSet getPossibleValueSet() const { return m_valueSet; }
	void validate(const QString& input);
};