summaryrefslogtreecommitdiff
path: root/ui/getsymbolslistthread.h
blob: 220c8f84f0cb824967929ca2217db831294fb9d0 (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
#pragma once

#ifndef BINARYNINJAUI_BINDINGS
	#include <QtCore/QThread>
	#include <QtCore/QEvent>
#endif
#include "binaryninjaapi.h"
#include "uitypes.h"


#ifdef BINARYNINJAUI_BINDINGS
// QThread has issues working in the bindings on some platforms
class GetSymbolsListThread;
#else
class BINARYNINJAUIAPI GetSymbolsListThread : public QThread
{
	Q_OBJECT

	QStringList m_allSymbols;
	std::function<void()> m_completeFunc;
	std::mutex m_mutex;
	bool m_done;
	BinaryViewRef m_view;

  protected:
	virtual void run() override;

  public:
	GetSymbolsListThread(BinaryViewRef view, const std::function<void()>& completeFunc);
	void cancel();

	static int m_eventType;
	int GetEventType() { return GetSymbolsListThread::m_eventType; }

	const QStringList& getSymbols() const { return m_allSymbols; }
};
#endif