CCIMXDesktop
 
Loading...
Searching...
No Matches
ApplicationWrapper Class Reference

The ApplicationWrapper class is the process wrapper. More...

#include <applicationwrapper.h>

Inheritance diagram for ApplicationWrapper:
AppLaunchLauncher SettingsLaunch

Public Types

using AppCode = QString
 AppCode is used to uniquely identify applications.
 
using HandlingFinHook = void(*)(ApplicationWrapper *wrapper, int exit_hook, QProcess::ExitStatus status)
 Function pointer type for handling application finish hooks.
 
using ErrorDepatchHook = void(*)(ApplicationWrapper *wrapper)
 Function pointer type for handling depatch errors.
 

Signals

void self_depatched_success ()
 self_depatched_success signals is using for depatch time success
 
void self_mission_finished ()
 self_mission_finished mission finished
 

Public Member Functions

 ApplicationWrapper (QObject *parent, DesktopMainWindow *desktopWindow)
 Constructs an ApplicationWrapper instance.
 
 Q_DISABLE_COPY (ApplicationWrapper)
 Disable copy constructor and assignment operator. This class is not copyable.
 
void bindAppWidget (AppWidget *appWidget) noexcept
 Bind the UI widget associated with the application.
 
AppWidgetapp_widget () const
 Returns the bound application widget.
 
AppCode app_code () const
 Returns the installed app code.
 
void set_app_path (const QString &app_path) noexcept
 Sets the file system path to the application executable.
 
QString get_app_path () const
 Returns the application executable path.
 
void install_args (const QStringList &args) noexcept
 Sets the arguments to pass to the application on launch.
 
QStringList args () const
 Returns the argument list for the application.
 
QProcess * process_handle () const
 Returns the internal QProcess handle.
 
virtual void depatch_app ()
 Launches the application (depatch).
 
virtual bool depatchable ()
 depatchable
 
void install_finhook (HandlingFinHook hook)
 Installs a hook called when the application finishes.
 
void install_error_handler (ErrorDepatchHook hook)
 Installs an error handler hook for depatch failures.
 

Friends

bool operator== (const ApplicationWrapper &application_wrapper_a, const ApplicationWrapper &application_wrapper_b)
 provide a function for compares
 

Detailed Description

The ApplicationWrapper class is the process wrapper.

This class manages launching, monitoring, and interacting with external applications through QProcess.

Constructor & Destructor Documentation

◆ ApplicationWrapper()

ApplicationWrapper::ApplicationWrapper ( QObject *  parent,
DesktopMainWindow desktopWindow 
)
explicit

Constructs an ApplicationWrapper instance.

Parameters
parentThe parent QObject.
desktopWindowPointer to the main desktop window.

Member Function Documentation

◆ app_code()

AppCode ApplicationWrapper::app_code ( ) const
inline

Returns the installed app code.

Returns
The app code.

◆ app_widget()

AppWidget * ApplicationWrapper::app_widget ( ) const
inline

Returns the bound application widget.

Returns
Pointer to the AppWidget instance.

◆ args()

QStringList ApplicationWrapper::args ( ) const
inline

Returns the argument list for the application.

Returns
QStringList of arguments.

◆ bindAppWidget()

void ApplicationWrapper::bindAppWidget ( AppWidget appWidget)
inlinenoexcept

Bind the UI widget associated with the application.

Parameters
appWidgetPointer to the AppWidget instance.

◆ depatch_app()

void ApplicationWrapper::depatch_app ( )
virtual

Launches the application (depatch).

This is the core function to start the external process.

Reimplemented in AppLaunchLauncher, and SettingsLaunch.

◆ depatchable()

virtual bool ApplicationWrapper::depatchable ( )
inlinevirtual

depatchable

Returns
if the app is actually internal depatchable;

◆ get_app_path()

QString ApplicationWrapper::get_app_path ( ) const
inline

Returns the application executable path.

Returns
The application path as QString.

◆ install_args()

void ApplicationWrapper::install_args ( const QStringList &  args)
inlinenoexcept

Sets the arguments to pass to the application on launch.

Parameters
argsList of arguments.

◆ install_error_handler()

void ApplicationWrapper::install_error_handler ( ErrorDepatchHook  hook)
inline

Installs an error handler hook for depatch failures.

Parameters
hookThe function pointer to the error handler.

◆ install_finhook()

void ApplicationWrapper::install_finhook ( HandlingFinHook  hook)
inline

Installs a hook called when the application finishes.

Parameters
hookThe function pointer to the finish hook.

◆ process_handle()

QProcess * ApplicationWrapper::process_handle ( ) const
inline

Returns the internal QProcess handle.

Note
Use this to access detailed process control or signals.
Returns
Pointer to QProcess managing the application.

◆ set_app_path()

void ApplicationWrapper::set_app_path ( const QString &  app_path)
inlinenoexcept

Sets the file system path to the application executable.

The path must be accessible and executable for launching the process.

Parameters
app_pathThe file path of the application executable.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const ApplicationWrapper application_wrapper_a,
const ApplicationWrapper application_wrapper_b 
)
friend

provide a function for compares

Parameters
application_wrapper_a
application_wrapper_b
Returns
results

The documentation for this class was generated from the following files: