cutter/src/CutterApplication.h

72 lines
1.6 KiB
C
Raw Normal View History

#ifndef CUTTERAPPLICATION_H
#define CUTTERAPPLICATION_H
#include <QEvent>
#include <QApplication>
#include <QList>
#include <QProxyStyle>
#include "core/MainWindow.h"
2021-01-24 14:50:13 +00:00
enum class AutomaticAnalysisLevel { Ask, None, AAA, AAAA };
2021-01-24 14:50:13 +00:00
struct CutterCommandLineOptions
{
QStringList args;
AutomaticAnalysisLevel analysisLevel = AutomaticAnalysisLevel::Ask;
InitialOptions fileOpenOptions;
QString pythonHome;
bool outputRedirectionEnabled = true;
bool enableCutterPlugins = true;
bool enableRizinPlugins = true;
};
class CutterApplication : public QApplication
{
Q_OBJECT
public:
CutterApplication(int &argc, char **argv);
2018-02-27 13:06:04 +00:00
~CutterApplication();
2021-01-24 14:50:13 +00:00
MainWindow *getMainWindow() { return mainWindow; }
void launchNewInstance(const QStringList &args = {});
2021-01-24 14:50:13 +00:00
protected:
bool event(QEvent *e);
private:
2019-03-06 20:30:39 +00:00
/**
* @brief Load and translations depending on Language settings
* @return true on success
*/
bool loadTranslations();
/**
* @brief Parse commandline options and store them in a structure.
* @return false if options have error
*/
bool parseCommandLineOptions();
2021-01-24 14:50:13 +00:00
private:
bool m_FileAlreadyDropped;
CutterCore core;
2018-02-27 13:06:04 +00:00
MainWindow *mainWindow;
CutterCommandLineOptions clOptions;
};
2019-03-06 20:30:39 +00:00
/**
* @brief CutterProxyStyle is used to force shortcuts displaying in context menu
*/
class CutterProxyStyle : public QProxyStyle
{
Q_OBJECT
public:
2019-03-06 20:30:39 +00:00
/**
* @brief it is enough to get notification about QMenu polishing to force shortcut displaying
*/
void polish(QWidget *widget) override;
};
#endif // CUTTERAPPLICATION_H