Change from QListWidget to QTreeWidget
[frida/frida.git] / src / gui / Mainwindow.hxx
1 #ifndef INCLUDE__Mainwindow_hxx_
2 #define INCLUDE__Mainwindow_hxx_
3
4 #include <memory>
5 #include <map>
6
7 #include <QTextEdit>
8 #include <QPushButton>
9 #include <QMainWindow>
10 #include <QTreeWidget>
11 #include <QStackedWidget>
12
13 #include <log4cxx/logger.h>
14
15 class Disassembler;
16 class Function;
17 class InformationManager;
18 class FunctionWidget;
19 class BasicBlockWidget;
20 class ScriptingDock;
21
22 class Mainwindow : public QMainWindow {
23 Q_OBJECT
24 public:
25 Mainwindow(InformationManager* mgr);
26
27 public Q_SLOTS:
28 void switchMainPlaneToAddress(uint64_t);
29 void requestNewFunctionByAddress(uint64_t address);
30
31 private:
32 void addFunction(Function* fun);
33 void setGlobalHotkeys();
34
35 QTextEdit *textEdit;
36 QPushButton *quitButton;
37 QMenu *fileMenu;
38
39 QTabWidget * tabwidget;
40 QTreeWidget * listWidget;
41 QStackedWidget * stackedWidget;
42 QDockWidget * dockWidget;
43 ScriptingDock * scripting;
44
45 QAction *exitAction;
46 QAction *openAction;
47 QAction *saveAction;
48
49 std::map<uint64_t, BasicBlockWidget*> blocks;
50 std::map<uint64_t, Function*> functions;
51 std::map<QTreeWidgetItem*, FunctionWidget*> objects_list;
52 std::map<uint64_t, QTreeWidgetItem*> objects_list_by_address;
53
54 InformationManager* manager;
55 log4cxx::LoggerPtr logger;
56
57 private Q_SLOTS:
58 void quit();
59 void open();
60 void save();
61 void switchMainPlane(QTreeWidgetItem* item);
62 void showListContextMenu(const QPoint&);
63 void requestNewFunction();
64 void renameFunction(Function* function);
65 };
66
67 #endif /* INCLUDE__Mainwindow_hxx_ */