6 #ifndef SWIFT_GUI_GUIAPPLICATION_H
7 #define SWIFT_GUI_GUIAPPLICATION_H
9 #include <QCommandLineOption>
14 #include <QScopedPointer>
21 #include "gui/mainwindowaccess.h"
36 class CLogCategoryList;
40 class CApplicationCloseDialog;
41 class CUpdateInfoDialog;
70 static const QString &settingsOrganization();
73 static bool removeAllWindowsSwiftRegistryEntries();
77 const QString &applicationName = executable(),
85 void addWindowStateOption();
88 void addWindowModeOption();
91 void addWindowResetSizeOption();
100 void processEventsToRefreshGui()
const;
104 void initMainApplicationWidget(
QWidget *mainWidget);
111 QWidget *mainWindowWidget = mainApplicationWidget())
const;
115 void cmdLineErrorMessage(
const QString &text,
const QString &informativeText)
const override;
120 bool isCmdWindowSizeResetSet()
const;
126 std::chrono::milliseconds timeout = std::chrono::milliseconds(0))
override;
128 std::chrono::milliseconds timeout = std::chrono::milliseconds(0))
override;
129 bool displayInOverlayWindow(
const QString &html,
130 std::chrono::milliseconds timeout = std::chrono::milliseconds(0))
override;
135 void splashScreen(
const QPixmap &pixmap);
140 void addMenuForSettingsAndCache(
QMenu &menu);
143 void addMenuForStyleSheets(
QMenu &menu);
146 void addMenuFile(
QMenu &menu);
149 void addMenuInternals(
QMenu &menu);
152 void addMenuWindow(
QMenu &menu);
158 void addMenuHelp(
QMenu &menu);
161 void showHelp(
const QString &subpath = {})
const;
164 void showChangelog()
const;
170 QString getWidgetStyle()
const;
173 bool reloadStyleSheets();
176 bool openStandardWidgetStyleSheet();
179 bool openStandardLogDirectory();
182 bool openStandardCrashDumpDirectory();
189 bool updateFont(
const QString &qss);
196 void setMinimumSizeInCharacters(
int widthChars,
int heightChars);
206 void triggerNewVersionCheck(
int delayedMs);
209 void gracefulShutdown()
override;
212 bool toggleStayOnTop();
216 void windowToFront();
218 void windowToFrontBackToggle();
222 void windowMinimizeNormalToggle();
231 void resetWindowGeometryAndState();
238 static void setWindowIcon(
const QPixmap &icon);
241 static QWidget *mainApplicationWidget();
244 void registerMainApplicationWidget(
QWidget *mainWidget);
247 bool hasMinimumMappingVersion()
const override;
256 static void exit(
int retcode = 0);
259 static QScreen *currentScreen();
263 static QRect currentScreenGeometry();
266 static void modalWindowToFront();
283 bool parsingHookIn()
override;
286 void onCoreFacadeStarted()
override;
289 void onStartUpCompleted()
override;
292 void checkNewVersion(
bool onlyIfNew);
304 int m_minWidthChars = -1;
305 int m_minHeightChars = -1;
309 CStyleSheetUtility m_styleSheetUtility {
this };
310 bool m_uiSetupCompleted =
false;
311 bool m_saveMainWidgetState =
true;
312 bool m_frontBack =
true;
313 bool m_normalizeMinimize =
true;
315 components::CUpdateInfoDialog *m_updateDialog =
nullptr;
316 components::CApplicationCloseDialog *m_closeDialog =
324 void settingsChanged();
327 void checkNewVersionMenu();
330 void adjustPalette();
333 void onStyleSheetsChanged();
336 void setCurrentFontValues();
339 void superviseWindowMinSizes();
342 static const QString &fileForWindowGeometryAndStateSettings();
345 static int hashForStateSettingsSchema(
const QMainWindow *window);
GUI application, a specialized version of swift::core::CApplication for GUI applications.
void fontChanged()
Font has been changed.
void setSaveMainWidgetState(bool save)
Save the main widget state?
void alwaysOnTop(bool onTop)
always on top
static QMainWindow * mainApplicationWindow()
Main application window.
void uiObjectTreeReady()
Object tree ready (means ui->setupUi() completed)
void styleSheetsChanged()
Style sheet changed.
Reads and provides style sheets.
Direct acccess to main window`s status bar, info bar and such.
Application
Enumeration of application roles.
static const QPixmap & swift64()
swift icon
Class template for accessing a specific value in the CSettingsCache.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
High level reusable GUI components.
void registerMetadata()
Register metadata for GUI.
Free functions in swift::misc.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.