1#ifndef SYSTEM_OVERRIDE_MANAGER_H
2#define SYSTEM_OVERRIDE_MANAGER_H
54 static bool IsRunningAsAdmin();
62 static bool RelaunchAsAdmin(
const QStringList& arguments = QStringList());
162 static LRESULT CALLBACK LowLevelKeyboardProc(
int n_code, WPARAM w_param, LPARAM l_param);
168 static bool InstallKeyboardHook();
173 static void UninstallKeyboardHook();
175 static HHOOK keyboard_hook_;
185 static LRESULT CALLBACK LowLevelMouseProc(
int n_code, WPARAM w_param, LPARAM l_param);
191 static bool InstallMouseHook();
196 static void UninstallMouseHook();
198 static HHOOK mouse_hook_;
void RestoreSystemState()
Restores the system state to normal. Uninstalls input hooks (Windows), restores the original wallpape...
Definition system_override_manager.cpp:322
QString original_wallpaper_path_
Stores the path to the user's original desktop wallpaper.
Definition system_override_manager.h:138
void HandleFloatingWidgetClosed()
Slot called when the FloatingEnergySphereWidget emits its widgetClosed signal. Cleans up the widget p...
Definition system_override_manager.cpp:316
void InitiateOverrideSequence(bool is_first_time)
Initiates the full system override sequence. Installs input hooks (Windows), changes wallpaper,...
Definition system_override_manager.cpp:86
bool SendSystemNotification(const QString &title, const QString &message) const
Sends a system notification using QSystemTrayIcon. Ensures the tray icon is visible before sending.
Definition system_override_manager.cpp:238
SystemOverrideManager(QObject *parent=nullptr)
Constructs a SystemOverrideManager. Initializes member variables, sets up the system tray icon for no...
Definition system_override_manager.cpp:39
FloatingEnergySphereWidget * floating_widget_
Pointer to the floating energy sphere widget instance.
Definition system_override_manager.h:135
static bool RelaunchNormally(const QStringList &arguments=QStringList())
Attempts to relaunch the application without administrative privileges (Windows only)....
Definition system_override_manager.cpp:378
static bool RestoreWallpaper()
Restores the original desktop wallpaper saved by ChangeWallpaper(). Also removes the temporary black ...
Definition system_override_manager.cpp:202
~SystemOverrideManager() override
Destructor. Ensures the system state is restored if the override is active. Cleans up the floating wi...
Definition system_override_manager.cpp:64
bool override_active_
Flag indicating if the system override sequence is currently active.
Definition system_override_manager.h:142
void overrideFinished()
Emitted when the system override sequence has finished and the system state has been restored.
QString temp_black_wallpaper_path_
Stores the path to the temporary black wallpaper image file.
Definition system_override_manager.h:140
void ShowFloatingAnimationWidget(bool is_first_time)
Creates, configures, positions, and shows the FloatingEnergySphereWidget. Connects the necessary sign...
Definition system_override_manager.cpp:285
QSystemTrayIcon * tray_icon_
System tray icon used for displaying notifications.
Definition system_override_manager.h:133
static bool MinimizeAllWindows()
Minimizes all open windows on the desktop (Windows only). Uses COM or a fallback method.
Definition system_override_manager.cpp:261
static bool ChangeWallpaper()
Saves the current wallpaper path and sets the desktop wallpaper to a temporary black image.
Definition system_override_manager.cpp:145