cutter/src/MainWindow.h

215 lines
5.1 KiB
C
Raw Normal View History

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
2017-10-02 09:41:28 +00:00
#include <memory>
2017-10-22 10:21:44 +00:00
#include "cutter.h" // only needed for ut64
#include "widgets/DisassemblyWidget.h"
#include "widgets/SidebarWidget.h"
#include "widgets/HexdumpWidget.h"
#include "widgets/PseudocodeWidget.h"
#include "utils/Configuration.h"
2017-10-22 10:21:44 +00:00
#include <QMainWindow>
#include <QList>
2017-09-25 12:55:41 +00:00
class CutterCore;
class Omnibar;
class PreviewWidget;
class Notepad;
class Highlighter;
class AsciiHighlighter;
class VisualNavbar;
class FunctionsWidget;
class ImportsWidget;
class ExportsWidget;
class SymbolsWidget;
class RelocsWidget;
class CommentsWidget;
class StringsWidget;
class FlagsWidget;
class Dashboard;
class QLineEdit;
class SdbDock;
class QAction;
class SectionsDock;
class ConsoleWidget;
class EntrypointWidget;
2017-10-22 10:21:44 +00:00
class DisassemblerGraphView;
class QDockWidget;
2017-04-09 19:55:06 +00:00
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
bool responsive;
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void openNewFile(const QString &fn, int anal_level = -1, QList<QString> advanced = QList<QString>());
void openProject(const QString &project_name);
void initUI();
void finalizeOpen();
/*!
* @param quit whether to show destructive button in dialog
* @return if quit is true, false if the application should not close
*/
bool saveProject(bool quit = false);
/*!
* @param quit whether to show destructive button in dialog
* @return if quit is true, false if the application should not close
*/
bool saveProjectAs(bool quit = false);
void closeEvent(QCloseEvent *event) override;
void readSettings();
void setFilename(const QString &fn);
void addOutput(const QString &msg);
void addDebugOutput(const QString &msg);
void sendToNotepad(const QString &txt);
2017-11-18 14:57:00 +00:00
void toggleTheme();
void refreshOmniBar(const QStringList &flags);
public slots:
void refreshAll();
2017-11-20 11:23:37 +00:00
void setDarkTheme();
void setDefaultTheme();
void on_actionEntry_points_triggered();
void on_actionFunctions_triggered();
void on_actionImports_triggered();
void on_actionExports_triggered();
void on_actionSymbols_triggered();
void on_actionReloc_triggered();
void on_actionStrings_triggered();
void on_actionSections_triggered();
void on_actionFlags_triggered();
void on_actionComents_triggered();
void on_actionNotepad_triggered();
void on_actionLock_triggered();
void on_actionLockUnlock_triggered();
void on_actionTabs_triggered();
void lockUnlock_Docks(bool what);
void on_actionDashboard_triggered();
void on_actionDark_Theme_triggered();
void on_actionRun_Script_triggered();
void toggleResponsive(bool maybe);
2017-09-02 08:46:48 +00:00
void backButton_clicked();
2017-04-05 09:35:19 +00:00
private slots:
void on_actionAbout_triggered();
void on_actionRefresh_Panels_triggered();
void on_actionDisasAdd_comment_triggered();
void on_actionDefaut_triggered();
void on_actionFunctionsRename_triggered();
void on_actionNew_triggered();
void on_actionSave_triggered();
void on_actionSaveAs_triggered();
2017-11-27 17:28:44 +00:00
void on_actionUndoSeek_triggered();
void on_actionRedoSeek_triggered();
void on_actionWhite_Theme_triggered();
void on_actionSDBBrowser_triggered();
void on_actionLoad_triggered();
void on_actionForward_triggered();
void on_actionTabs_on_Top_triggered();
void on_actionReset_settings_triggered();
void on_actionQuit_triggered();
void on_actionRefresh_contents_triggered();
void on_actionAsmOptions_triggered();
2017-09-02 08:17:48 +00:00
void projectSaved(const QString &name);
private:
2017-10-09 18:08:35 +00:00
CutterCore *core;
2017-10-24 08:18:16 +00:00
Notepad *notepadDock;
DisassemblyWidget *disassemblyDock;
SidebarWidget *sidebarDock;
HexdumpWidget *hexdumpDock;
PseudocodeWidget *pseudocodeDock;
QDockWidget *graphDock;
2017-10-22 10:21:44 +00:00
DisassemblerGraphView *graphView;
QDockWidget *asmDock;
QDockWidget *calcDock;
Omnibar *omnibar;
2017-11-18 14:57:00 +00:00
//SideBar *sideBar;
Configuration *configuration;
bool doLock;
ut64 hexdumpTopOffset;
ut64 hexdumpBottomOffset;
QString filename;
QList<QDockWidget *> dockWidgets;
2017-10-02 09:41:28 +00:00
std::unique_ptr<Ui::MainWindow> ui;
Highlighter *highlighter;
AsciiHighlighter *hex_highlighter;
VisualNavbar *visualNavbar;
EntrypointWidget *entrypointDock;
FunctionsWidget *functionsDock;
ImportsWidget *importsDock;
ExportsWidget *exportsDock;
SymbolsWidget *symbolsDock;
RelocsWidget *relocsDock;
CommentsWidget *commentsDock;
StringsWidget *stringsDock;
FlagsWidget *flagsDock;
Dashboard *dashboardDock;
QLineEdit *gotoEntry;
SdbDock *sdbDock;
2017-11-18 14:57:00 +00:00
//QAction *sidebar_action;
SectionsDock *sectionsDock;
ConsoleWidget *consoleDock;
void toggleDockWidget(QDockWidget *dock_widget);
void resetToDefaultLayout();
void restoreDocks();
void hideAllDocks();
void showDefaultDocks();
public:
QString getFilename() const { return filename; }
};
#endif // MAINWINDOW_H