6#ifndef SWIFT_GUI_GUIAPPLICATION_H
7#define SWIFT_GUI_GUIAPPLICATION_H
9#include <QCommandLineOption>
14#include <QScopedPointer>
21#include "gui/mainwindowaccess.h"
126 std::chrono::milliseconds timeout = std::chrono::milliseconds(0))
override;
128 std::chrono::milliseconds timeout = std::chrono::milliseconds(0))
override;
130 std::chrono::milliseconds timeout = std::chrono::milliseconds(0))
override;
231 void resetWindowGeometryAndState();
238 static void setWindowIcon(
const QPixmap &icon);
241 static QWidget *mainApplicationWidget();
244 void registerMainApplicationWidget(
QWidget *mainWidget);
247 bool hasMinimumMappingVersion()
const override;
253 static swift::gui::IMainWindowAccess *mainWindowAccess();
256 static void exit(
int retcode = 0);
259 static QScreen *currentScreen();
263 static QRect currentScreenGeometry();
266 static void modalWindowToFront();
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;
314 QScopedPointer<CSplashScreen> m_splashScreen;
315 components::CUpdateInfoDialog *m_updateDialog =
nullptr;
316 components::CApplicationCloseDialog *m_closeDialog =
318 swift::misc::CSettingReadOnly<settings::TGeneralGui> m_guiSettings {
this, &CGuiApplication::settingsChanged };
319 swift::misc::CSettingReadOnly<settings::TUpdateNotificationSettings> m_updateSetting {
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);
static const QString & executable()
executable name
GUI application, a specialized version of swift::core::CApplication for GUI applications.
bool openStandardWidgetStyleSheet()
Opens the standard stylesheet.
bool isCmdWindowSizeResetSet() const
Window size reset mode set.
QString setExtraWindowTitle(const QString &extraInfo, QWidget *mainWindowWidget=mainApplicationWidget()) const
Set window title.
QString getFontInfo() const
Info about font.
void onCoreFacadeStarted()
Called when facade/contexts have been started.
void addWindowResetSizeOption()
CMD line arguments (reset size store).
void addWindowStateOption()
CMD line arguments.
void processEventsToRefreshGui() const
Allow the GUI to refresh by processing events, call the event loop.
Qt::WindowState getWindowState() const
Window state.
static const QString & settingsOrganization()
Organization string used for settings, is the registry key under windows.
void addWindowModeOption()
CMD line arguments.
void triggerNewVersionCheck(int delayedMs)
Trigger new version check.
bool openStandardCrashDumpDirectory()
Opens the standard dumps directory.
static CGuiApplication * instance()
Similar to.
void windowToFront()
Window to front/back.
CEnableForFramelessWindow::WindowMode getWindowMode() const
Window mode (window flags).
void addMenuHelp(QMenu &menu)
Help operations.
void addMenuForStyleSheets(QMenu &menu)
Add menu for style sheets.
bool reloadStyleSheets()
Reload style sheets.
void cmdLineErrorMessage(const QString &text, const QString &informativeText) const
print messages generated during parsing / cmd handling
void addMenuFile(QMenu &menu)
File menu.
void addMenuInternals(QMenu &menu)
Internals menu.
bool displayInOverlayWindow(const swift::misc::CStatusMessage &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
direct access to main application window
void checkNewVersion(bool onlyIfNew)
Check for a new version (update).
void splashScreen(const QPixmap &pixmap)
Add a splash screen based on resource, empty means remove splash screen.
void fontChanged()
Font has been changed.
const CStyleSheetUtility & getStyleSheetUtility() const
Style sheet handling.
QDialog::DialogCode showCloseDialog(QMainWindow *mainWindow, QCloseEvent *closeEvent)
Show close dialog.
void windowToBack()
Window to front/back.
void gracefulShutdown()
Graceful shutdown.
void onStartUpCompleted()
Startup completed.
bool toggleStayOnTop()
Toggle stay on top.
void windowToFrontBackToggle()
Window to front/back.
static void registerMetadata()
Register metadata.
bool resetFont()
Reset the font to default.
void setSaveMainWidgetState(bool save)
Save the main widget state?
void displaySetupLoadFailure(swift::misc::CStatusMessageList msgs)
Display the failures caused by loading the setup file.
void windowMinimizeNormalToggle()
Window minimize/normalize.
void addMenuForSettingsAndCache(QMenu &menu)
Add menu items for settings and cache.
bool updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor)
Update the fonts.
void showHelp(const QString &subpath={}) const
Show help page (online help).
bool displayInStatusBar(const swift::misc::CStatusMessage &message)
direct access to main application window
void alwaysOnTop(bool onTop)
always on top
static QWidget * mainApplicationWidget()
Main application window widget.
static QMainWindow * mainApplicationWindow()
Main application window.
bool parsingHookIn()
Handle parsing of special GUI cmd arguments.
void uiObjectTreeReady()
Object tree ready (means ui->setupUi() completed).
static bool removeAllWindowsSwiftRegistryEntries()
Remove all registry entries.
void openUrl(const swift::misc::network::CUrl &url)
Open a given URL.
bool openStandardLogDirectory()
Opens the standard log directory.
static const QStringList & getLogCategories()
Own log categories.
void addMenuWindow(QMenu &menu)
Window operations.
void initMainApplicationWidget(QWidget *mainWidget)
Init the main application window based on information in this application.
void addWindowFlags(Qt::WindowFlags flags)
Set window flag on main application window.
QString getWidgetStyle() const
Current widget style.
void showChangelog() const
Show changelog popup.
void styleSheetsChanged()
Style sheet changed.
void setMinimumSizeInCharacters(int widthChars, int heightChars)
Set minimum width/height in characters.
CGuiApplication(const QString &applicationName=executable(), swift::misc::CApplicationInfo::Application application=swift::misc::CApplicationInfo::Unknown, const QPixmap &icon=swift::misc::CIcons::swift64())
Constructor.
Reads and provides style sheets.
Close dialog for application.
Download and install swift.
Application
Enumeration of application roles.
static const QPixmap & swift64()
swift icon
A sequence of log categories.
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...
High level reusable GUI components.
Free functions in swift::misc.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.