![]() |
NDEVR
API Documentation
|
Creates a button for launching a 3rd party application. More...
Public Member Functions | |
| ApplicationLauncherButtonManager () | |
| Constructs an ApplicationLauncherButtonManager with no application or button set. | |
| ApplicationLauncherButtonManager (Button *button) | |
| Constructs an ApplicationLauncherButtonManager and associates it with the given button. | |
| ApplicationLauncherButtonManager (Button *button, const DynamicPointer< LocalApplicationLauncher > &launcher) | |
| Constructs an ApplicationLauncherButtonManager with a button and an application launcher. | |
| ApplicationLauncherButtonManager (Button *button, const File &application_file, const StringView &args=StringView()) | |
| Constructs an ApplicationLauncherButtonManager with a button, application file, and optional arguments. | |
| ApplicationLauncherButtonManager (const DynamicPointer< LocalApplicationLauncher > &launcher) | |
| Constructs an ApplicationLauncherButtonManager with the given application launcher. | |
| ApplicationLauncherButtonManager (const File &application_file, const StringView &args=StringView()) | |
| Constructs an ApplicationLauncherButtonManager from an application file path and optional arguments. | |
| Button * | createButton () |
| Creates a new Button configured to launch the application. | |
| void | killProcess () |
| Kills the currently running application process. | |
| void | launch () |
| Launches the application. | |
| const DynamicPointer< LocalApplicationLauncher > & | launcher () const |
| Returns the current application launcher. | |
| void | setAppFinishedCallback (std::function< void()> callback) |
| Sets a callback to be invoked when the launched application finishes execution. | |
| void | setAppLaunchCallback (std::function< void()> callback) |
| Sets a callback to be invoked when the application is launched. | |
| void | setApplication (DynamicPointer< LocalApplicationLauncher > launcher) |
| Sets the application launcher to use. | |
| void | setArgs (const StringView &args) |
| Sets the command-line arguments for the launched application. | |
| void | setBackupIcon (const StringView &backup_icon) |
| Sets a backup icon to use when the application's own icon cannot be found. | |
| void | setEnabled (bool enabled) |
| Enables or disables the ability to launch the application. | |
| void | setEnvironment (const StringView &env) |
| Sets the environment variables for the launched application. | |
| void | setIconToApp (Button *button) |
| Sets the given button's icon to the application's icon. | |
| void | setMakeChildProcess (bool is_child_process) |
| Sets whether the launched application should run as a child process. | |
| void | setNameToApp (Button *button) |
| Sets the given button's text to the application's name. | |
| void | setOverrideIcon (const StringView &override_icon) |
| Sets an icon that overrides the application's default icon. | |
| void | setupButton (Button *button) |
| Configures an existing button to launch the application and reflect its running state. | |
Protected Attributes | |
| String | m_backup_icon |
| Fallback icon name used when the application icon is unavailable. | |
| Buffer< QPointer< Button > > | m_buttons |
| All buttons associated with this launcher manager. | |
| std::function< void()> | m_callback_function |
| Callback invoked when the application finishes. | |
| bool | m_is_enabled = true |
| Whether launching the application is currently enabled. | |
| std::function< void()> | m_launch_function |
| Callback invoked when the application launches. | |
| BasicThread * | m_launch_thread = nullptr |
| Thread used to monitor the launched application process. | |
| DynamicPointer< LocalApplicationLauncher > | m_launcher |
| The application launcher instance. | |
| String | m_override_icon |
| Icon name that overrides the application's default icon. | |
Creates a button for launching a 3rd party application.
While the application is running the button is pressed. When application terminates button is unpressed automatically.
Definition at line 14 of file ApplicationLauncherButton.h.
| ApplicationLauncherButtonManager::ApplicationLauncherButtonManager | ( | const DynamicPointer< LocalApplicationLauncher > & | launcher | ) |
Constructs an ApplicationLauncherButtonManager with the given application launcher.
| [in] | launcher | The application launcher to manage. |
References launcher().
| ApplicationLauncherButtonManager::ApplicationLauncherButtonManager | ( | const File & | application_file, |
| const StringView & | args = StringView() ) |
Constructs an ApplicationLauncherButtonManager from an application file path and optional arguments.
| [in] | application_file | The file path to the application executable. |
| [in] | args | Optional command-line arguments to pass to the application. |
| ApplicationLauncherButtonManager::ApplicationLauncherButtonManager | ( | Button * | button | ) |
Constructs an ApplicationLauncherButtonManager and associates it with the given button.
| [in] | button | The button to associate with the application launch. |
| ApplicationLauncherButtonManager::ApplicationLauncherButtonManager | ( | Button * | button, |
| const File & | application_file, | ||
| const StringView & | args = StringView() ) |
Constructs an ApplicationLauncherButtonManager with a button, application file, and optional arguments.
| [in] | button | The button to associate with the application launch. |
| [in] | application_file | The file path to the application executable. |
| [in] | args | Optional command-line arguments to pass to the application. |
| ApplicationLauncherButtonManager::ApplicationLauncherButtonManager | ( | Button * | button, |
| const DynamicPointer< LocalApplicationLauncher > & | launcher ) |
Constructs an ApplicationLauncherButtonManager with a button and an application launcher.
| [in] | button | The button to associate with the application launch. |
| [in] | launcher | The application launcher to manage. |
References launcher().
| Button * ApplicationLauncherButtonManager::createButton | ( | ) |
| const DynamicPointer< LocalApplicationLauncher > & ApplicationLauncherButtonManager::launcher | ( | ) | const |
Returns the current application launcher.
Referenced by ApplicationLauncherButtonManager(), ApplicationLauncherButtonManager(), and setApplication().
| void ApplicationLauncherButtonManager::setAppFinishedCallback | ( | std::function< void()> | callback | ) |
Sets a callback to be invoked when the launched application finishes execution.
| [in] | callback | The function to call when the application terminates. |
| void ApplicationLauncherButtonManager::setAppLaunchCallback | ( | std::function< void()> | callback | ) |
Sets a callback to be invoked when the application is launched.
| [in] | callback | The function to call when the application starts. |
| void ApplicationLauncherButtonManager::setApplication | ( | DynamicPointer< LocalApplicationLauncher > | launcher | ) |
Sets the application launcher to use.
| [in] | launcher | The application launcher to manage. |
References launcher().
| void ApplicationLauncherButtonManager::setArgs | ( | const StringView & | args | ) |
Sets the command-line arguments for the launched application.
| [in] | args | The arguments string. |
| void ApplicationLauncherButtonManager::setBackupIcon | ( | const StringView & | backup_icon | ) |
Sets a backup icon to use when the application's own icon cannot be found.
| [in] | backup_icon | The name of the backup icon resource. |
| void ApplicationLauncherButtonManager::setEnabled | ( | bool | enabled | ) |
Enables or disables the ability to launch the application.
| [in] | enabled | Whether launching is enabled. |
| void ApplicationLauncherButtonManager::setEnvironment | ( | const StringView & | env | ) |
Sets the environment variables for the launched application.
| [in] | env | The environment variable string. |
| void ApplicationLauncherButtonManager::setIconToApp | ( | Button * | button | ) |
Sets the given button's icon to the application's icon.
| [in] | button | The button whose icon will be updated. |
| void ApplicationLauncherButtonManager::setMakeChildProcess | ( | bool | is_child_process | ) |
Sets whether the launched application should run as a child process.
| [in] | is_child_process | Whether to launch as a child process. |
| void ApplicationLauncherButtonManager::setNameToApp | ( | Button * | button | ) |
Sets the given button's text to the application's name.
| [in] | button | The button whose text will be updated. |
| void ApplicationLauncherButtonManager::setOverrideIcon | ( | const StringView & | override_icon | ) |
Sets an icon that overrides the application's default icon.
| [in] | override_icon | The name of the override icon resource. |
| void ApplicationLauncherButtonManager::setupButton | ( | Button * | button | ) |
Configures an existing button to launch the application and reflect its running state.
| [in] | button | The button to set up. |