Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
UOperatingSystemBaseProgram Class Reference

#include "OperatingSystemBaseProgram.h"

Inheritance diagram for UOperatingSystemBaseProgram:
[legend]
Collaboration diagram for UOperatingSystemBaseProgram:
[legend]

Public Member Functions

 UOperatingSystemBaseProgram ()
 
UOperatingSystemBaseProgramStartProgram (FGenericError &OutError)
 
bool IsRunning () const
 
bool CanAddToDesktop () const
 
UOperatingSystemGetOperatingSystem () const
 
UOperatingSystemProgramIconWidgetCreateIconWidget ()
 
UOperatingSystemProgramIconWidgetGetIconWidget () const
 
void OpenFile (UOperatingSystemFile *TargetFile, FGenericError &OutError)
 
void CloseProgram (const bool bIsFullClose, FGenericError &OutError)
 
void BringToFront (FGenericError &OutError) const
 
UDraggableWindowGetParentWindow () const
 
void IsCompatibleWithOS (const TWeakObjectPtr< const UOperatingSystem > TestOS, FGenericError &OutError) const
 
bool CanSaveSettings () const
 
void SetParentPartition (TWeakObjectPtr< UOperatingSystemPartition > OwningPartition)
 
void OnProgramWindowStateChanged (const EOperatingSystemProgramViewState &NewState) const
 
bool IsWindowMaximized () const
 Checks whether the window of the operating system base program is maximized.
 
virtual OPERATINGSYSTEMSIMULATOR_API FString GetSaveSlotName () const
 
TOptional< FVector2D > GetWindowPosition () const
 Retrieves the position of the window associated with the operating system program.
 
TWeakObjectPtr< UOperatingSystemPartitionGetParentPartition () const
 Get the parent partition of the current operating system program.
 
TSoftClassPtr< UOperatingSystemProgramIconWidgetGetIconWidgetClass () const
 Retrieves the class of the icon widget for the operating system program.
 
TSoftClassPtr< UOperatingSystemProgramWidgetGetWidgetClass () const
 Retrieves the widget class associated with the operating system base program. This method returns the widget class that should be used to create the program widget for the specific program.
 
TSoftClassPtr< UOperatingSystemProgramSettingsGetSettingsClass () const
 Get the settings class associated with this program. This method returns the class type of the settings object specific to this program.
 
TSoftClassPtr< UOperatingSystemProgramDataGetDataClass () const
 Retrieves the data class associated with the program.
 
TSoftClassPtr< UOperatingSystemTaskbarButtonGetTaskbarButtonClass () const
 Retrieves the taskbar button class associated with the program.
 
TWeakObjectPtr< UOperatingSystemProgramSettingsGetSettings () const
 Get the settings object for the program.
 
TWeakObjectPtr< UOperatingSystemProgramDataGetDataObj () const
 Retrieves the data object associated with the operating system program.
 
TWeakObjectPtr< UOperatingSystemTaskbarButtonGetTaskbarButton () const
 Retrieves the taskbar button associated with the program.
 
UOperatingSystemProgramWidgetGetProgramWidget () const
 Returns the program widget associated with the operating system program.
 
template<class T >
T * GetSettings () const
 Get the settings object of type T.
 
template<class T >
T * GetDataObj () const
 Returns the data object associated with the program.
 
FORCEINLINE FString GetProgramName () const
 Returns the program name as a FString.
 
FORCEINLINE FName GetIdentifier () const
 Returns the identifier of the program. The identifier serves as a unique identification for the program.
 
FORCEINLINE bool IsSingleInstanceProgram () const
 Returns a boolean value indicating whether the program is a single instance program. A single instance program is a program that allows only one instance to run at a time.
 
FORCEINLINE bool IsSystemInstalledProgram () const
 Returns a boolean value indicating whether the program is installed on the system. If the program is installed, it will return true; otherwise, it will return false.
 
FORCEINLINE uint32 GetProcessID () const
 Retrieves the process ID of the current program. This method allows you to obtain the unique process ID of the program.
 
FORCEINLINE float GetSpaceRequiredInMB () const
 Get the space required by the program in megabytes. This method returns the space required by the program in megabytes.
 
FORCEINLINE bool ShouldRememberLastWindowPosition () const
 Indicates whether the program should remember the last window position.
 
OPERATINGSYSTEMSIMULATOR_API FORCEINLINE EOperatingSystemProgramCloseMethod GetCloseMethod () const
 Returns the close method of the operating system program.
 

Static Public Member Functions

static UE_NODISCARD UOperatingSystemBaseProgramCreateProgram (TWeakObjectPtr< UOperatingSystem > OwningOS, const TSoftClassPtr< UOperatingSystemBaseProgram > &ProgramClass, FGenericError &OutError, const bool bInstalledWithOS=false)
 
static OPERATINGSYSTEMSIMULATOR_API bool IsStoreItemFree (const FOperatingSystemStoreProgramData &ProgramData)
 

Public Attributes

FOnOperatingSystemProgramViewStateChanged OnOperatingSystemProgramViewStateChanged
 

Protected Member Functions

virtual OPERATINGSYSTEMSIMULATOR_API void OnValidate (FGenericError &OutError) const
 OnValidate method for validating program-specific logic.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnStart (FGenericError &OutError)
 Called when the program starts. It should be overridden in derived classes to provide the necessary functionality for the specific program.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnClose (FGenericError &OutError)
 Called when the program is requested to be closed. It can be overridden by derived classes to perform necessary cleanup operations before the program is closed. The function receives an FGenericError& object as a parameter, which can be used to report any error that occurred during the closing process.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnOpenFile (UOperatingSystemFile *TargetFile, FGenericError &OutError)
 Called when a file is opened in the operating system program. It provides the target file that was opened, as well as an output error parameter for reporting any errors that occurred during the file opening process.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnThemeChanged (UOperatingSystemSettingModule_Theme *ThemePayload)
 Virtual method called when the theme is changed.
 
void K2_OnCreate ()
 
void K2_OnInstall ()
 
FGenericError K2_OnStart ()
 
void K2_OnClose ()
 
void K2_OnSettingsLoad (UOperatingSystemProgramSettings *LoadedSettings)
 
void K2_OnOpenFile (FGenericError &OutError)
 
void K2_OnValidate (FGenericError &OutError) const
 
FString K2_GetSaveSlotName () const
 

Protected Attributes

FText Name
 
FText Author
 
FText Description
 
FName Identifier
 
FOperatingSystemVersion Version
 
FText StoreDisplayName
 
FText StoreType
 
float StorePrice
 
FGameplayTagContainer SupportedOperatingSystems
 
uint8 bRequireMinOperatingSystemVersion: 1
 
FOperatingSystemVersion MinOperatingSystemVersion
 
TSoftObjectPtr< UObject > IconObject
 
float SpaceRequiredInMB
 
TSoftClassPtr< UOperatingSystemProgramIconWidgetIconWidgetClass
 
TSoftClassPtr< UOperatingSystemProgramWidgetWidgetClass
 
EOperatingSystemProgramCloseMethod CloseMethod
 
EOperatingSystemProgramSaveMethod SaveMethod
 
TSoftClassPtr< UOperatingSystemProgramSettingsSettingsClass
 
TSoftClassPtr< UOperatingSystemProgramDataDataClass
 
uint8 bRequiresData: 1
 
uint8 bAddToDesktop: 1
 
uint8 bCreateNotification: 1
 
uint8 bSingleInstanceOnly: 1
 
uint8 bCanRunOnPortableDevice: 1
 
uint8 bCreateSettingsBeforeStarting: 1
 
uint8 bRememberLastWindowPosition: 1
 
uint8 bAllowDragging: 1
 
uint8 bAllowResizing: 1
 
uint8 bOverrideWindowSize: 1
 
FVector2D OverrideWindowSize
 
FVector2D MinimumWindowResize
 
EOperatingSystemWindowStartupState StartWindowState
 
TSoftClassPtr< UDraggableWindowOverrideWindowClass
 
TSoftClassPtr< UOperatingSystemTaskbarButtonTaskbarButtonClass
 
TWeakObjectPtr< UOperatingSystemPartitionParentPartition
 

Detailed Description

The base class for all operating system programs.

This class provides properties and functions that are common to all programs, such as the program name, author, description, version, and settings class.

To create a new program, derive from this class and implement the necessary functionality for the specific program.

See also
UOperatingSystemProgramWidget
UOperatingSystemProgramSettings

Constructor & Destructor Documentation

◆ UOperatingSystemBaseProgram()

UOperatingSystemBaseProgram::UOperatingSystemBaseProgram ( )

Member Function Documentation

◆ BringToFront()

void UOperatingSystemBaseProgram::BringToFront ( FGenericError & OutError) const
Here is the caller graph for this function:

◆ CanAddToDesktop()

bool UOperatingSystemBaseProgram::CanAddToDesktop ( ) const

Check if the program can be added to the desktop.

This function is used to determine if the program can be added to the desktop. It checks if the property bAddToDesktop is set to true and if the IconWidgetClass is not null.

Returns
True if the program can be added to the desktop, false otherwise.

◆ CanSaveSettings()

bool UOperatingSystemBaseProgram::CanSaveSettings ( ) const

Checks if the settings of the operating system base program can be saved.

Returns
true if the settings can be saved, false otherwise.
Here is the caller graph for this function:

◆ CloseProgram()

void UOperatingSystemBaseProgram::CloseProgram ( const bool bIsFullClose,
FGenericError & OutError )

Closes the program.

If the program has a blueprint on close, it calls the K2_OnClose() function. Then it calls the OnClose() function and provides an OutError parameter. The ProcessID is set to INVALID_PROCESS_ID. If a ChildFile object is valid, it closes the file, marks it as garbage, and sets it to nullptr.

If the SaveMethod is set to SaveOnExit or the ParentOS is shutting down or restarting and the SaveMethod is set to SaveOnOperatingSystemShutdown, it saves the program settings using the UOperatingSystemProgramSettings::SaveSettings() function.

If ProgramWidget is valid, it destroys the operating system base widget and sets ProgramWidget to nullptr.

If the Settings object is valid and the ParentOS is shutting down or restarting, it marks the Settings object as garbage and sets it to nullptr.

It then closes the ParentWindow and sets ParentWindow to nullptr.

Finally, it broadcasts the OnProgramClosed event with this program object as a parameter.

Parameters
bIsFullCloseDetermines if this program should be completely closed or not.
OutErrorThe reference to an FGenericError object to store any error that occurred during the closing process.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateIconWidget()

UOperatingSystemProgramIconWidget * UOperatingSystemBaseProgram::CreateIconWidget ( )

Creates an icon widget for the operating system program. This function creates an icon widget for the operating system program, if it has not been created before. If a cached icon widget exists, it is returned instead of creating a new one.

Returns
A pointer to the created icon widget.
Note
The returned icon widget is still owned by the program and should not be freed manually.
Here is the call graph for this function:

◆ CreateProgram()

UOperatingSystemBaseProgram * UOperatingSystemBaseProgram::CreateProgram ( TWeakObjectPtr< UOperatingSystem > OwningOS,
const TSoftClassPtr< UOperatingSystemBaseProgram > & ProgramClass,
FGenericError & OutError,
const bool bInstalledWithOS = false )
static

Creates a program instance.

Parameters
OwningOSOperating System that will own the program.
ProgramClassThe class of the program to create.
OutErrorThe error that occurred during program creation.
bInstalledWithOSWhether the program is installed with the operating system.
Returns
The created program instance if successful, nullptr otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCloseMethod()

OPERATINGSYSTEMSIMULATOR_API FORCEINLINE EOperatingSystemProgramCloseMethod UOperatingSystemBaseProgram::GetCloseMethod ( ) const
inline

Returns the close method of the operating system program.

This method returns the close method of the operating system program. The close method determines how the program will be closed or terminated. It is an enumerated value of type EOperatingSystemProgramCloseMethod.

Returns
The close method of the operating system program.
See also
EOperatingSystemProgramCloseMethod
Here is the caller graph for this function:

◆ GetDataClass()

TSoftClassPtr< UOperatingSystemProgramData > UOperatingSystemBaseProgram::GetDataClass ( ) const

Retrieves the data class associated with the program.

This function returns a TSoftClassPtr<UOperatingSystemProgramData> which represents the data class associated with the program. The data class stores the program's data and provides functionality for manipulating and accessing the data.

Returns
TSoftClassPtr<UOperatingSystemProgramData> - A soft reference to the data class associated with the program.
See also
UOperatingSystemProgramData

◆ GetDataObj() [1/2]

TWeakObjectPtr< UOperatingSystemProgramData > UOperatingSystemBaseProgram::GetDataObj ( ) const

Retrieves the data object associated with the operating system program.

This function returns the data object associated with the operating system program. The data object stores information specific to the program, such as program settings, state, and other relevant data.

Returns
A weak object pointer to the program's data object.
See also
UOperatingSystemProgramData
Note
The returned data object may be null if no data object has been set for the program.

◆ GetDataObj() [2/2]

template<class T >
T * UOperatingSystemBaseProgram::GetDataObj ( ) const
inline

Returns the data object associated with the program.

This method returns a pointer to the data object associated with the program. The data object is of type T, which must be derived from UOperatingSystemProgramData. If T is not derived from UOperatingSystemProgramData, a static_assert will trigger and an error message will be displayed.

Returns
A pointer to the data object of type T associated with the program.
See also
UOperatingSystemProgramData

◆ GetIconWidget()

UOperatingSystemProgramIconWidget * UOperatingSystemBaseProgram::GetIconWidget ( ) const

Gets the icon widget for the Operating System program.

Returns
The icon widget associated with this program.

◆ GetIconWidgetClass()

TSoftClassPtr< UOperatingSystemProgramIconWidget > UOperatingSystemBaseProgram::GetIconWidgetClass ( ) const

Retrieves the class of the icon widget for the operating system program.

This method returns the class of the widget that represents the icon of the operating system program. The widget class is a subclass of UOperatingSystemProgramIconWidget.

Returns
A soft class pointer to the widget class for the program icon.

◆ GetIdentifier()

FORCEINLINE FName UOperatingSystemBaseProgram::GetIdentifier ( ) const
inline

Returns the identifier of the program. The identifier serves as a unique identification for the program.

Returns
The identifier of the program.
Here is the caller graph for this function:

◆ GetOperatingSystem()

UOperatingSystem * UOperatingSystemBaseProgram::GetOperatingSystem ( ) const

Get the operating system associated with this program.

Returns
A pointer to the operating system.
Here is the caller graph for this function:

◆ GetParentPartition()

TWeakObjectPtr< UOperatingSystemPartition > UOperatingSystemBaseProgram::GetParentPartition ( ) const

Get the parent partition of the current operating system program.

This method returns a weak pointer to the parent partition of the program. The parent partition represents the operating system partition to which the program belongs.

To access the properties or call functions of the parent partition, you can use the returned weak pointer.

Returns
A weak pointer to the parent partition of the program.
See also
UOperatingSystemPartition

◆ GetParentWindow()

UDraggableWindow * UOperatingSystemBaseProgram::GetParentWindow ( ) const

Get the parent window of the program.

This function returns the parent window of the program. The parent window is the draggable window that contains the program's UI elements.

Returns
A pointer to the parent window.

◆ GetProcessID()

FORCEINLINE uint32 UOperatingSystemBaseProgram::GetProcessID ( ) const
inline

Retrieves the process ID of the current program. This method allows you to obtain the unique process ID of the program.

Returns
The process ID of the program.
Here is the caller graph for this function:

◆ GetProgramName()

FORCEINLINE FString UOperatingSystemBaseProgram::GetProgramName ( ) const
inline

Returns the program name as a FString.

Returns
The program name as a FString.
Here is the caller graph for this function:

◆ GetProgramWidget()

UOperatingSystemProgramWidget * UOperatingSystemBaseProgram::GetProgramWidget ( ) const

Returns the program widget associated with the operating system program.

Returns
The program widget instance for the operating system program.
See also
UOperatingSystemProgramWidget
Here is the caller graph for this function:

◆ GetSaveSlotName()

FString UOperatingSystemBaseProgram::GetSaveSlotName ( ) const
virtual

Retrieves the name of the save slot for the operating system program.

This method returns the name of the save slot for the operating system program. If the program has a blueprint implementation of K2_GetSaveSlotName, that will be used to retrieve the save slot name. If the blueprint implementation returns a non-empty string, that string will be returned. Otherwise, the save slot name will be generated using the program's identifier and the unique ID of the parent device.

Returns
The name of the save slot for the operating system program.
See also
UOperatingSystemBaseProgram::K2_GetSaveSlotName()
UOperatingSystemBaseProgram::Identifier
UOperatingSystemBaseProgram::ParentOS
UOperatingSystemBaseProgram::ParentDevice
UOperatingSystemBaseProgram::ParentDeviceActor

Reimplemented in UOperatingSystemStore.

Here is the call graph for this function:

◆ GetSettings() [1/2]

TWeakObjectPtr< UOperatingSystemProgramSettings > UOperatingSystemBaseProgram::GetSettings ( ) const

Get the settings object for the program.

This method returns the settings object associated with the program. The settings object contains various properties and configurations specific to the program.

Returns
A weak pointer to the settings object. Use TWeakObjectPtr<T> to handle the object safely. The returned pointer will be null if no settings object has been assigned.
See also
UOperatingSystemProgramSettings
Here is the caller graph for this function:

◆ GetSettings() [2/2]

template<class T >
T * UOperatingSystemBaseProgram::GetSettings ( ) const
inline

Get the settings object of type T.

This method returns the settings object of type T associated with the program. It is important that T is derived from UOperatingSystemProgramSettings. If T is not derived from UOperatingSystemProgramSettings, a compilation error will occur.

Returns
A pointer to the settings object of type T.
Warning
Only use this method if you are certain that the settings object of type T exists. Otherwise, it may result in unexpected behavior.
See also
UOperatingSystemProgramSettings

◆ GetSettingsClass()

TSoftClassPtr< UOperatingSystemProgramSettings > UOperatingSystemBaseProgram::GetSettingsClass ( ) const

Get the settings class associated with this program. This method returns the class type of the settings object specific to this program.

Returns
The class type of the settings object specific to this program.
See also
UOperatingSystemProgramSettings

◆ GetSpaceRequiredInMB()

FORCEINLINE float UOperatingSystemBaseProgram::GetSpaceRequiredInMB ( ) const
inline

Get the space required by the program in megabytes. This method returns the space required by the program in megabytes.

Returns
The space required by the program in megabytes.

◆ GetTaskbarButton()

TWeakObjectPtr< UOperatingSystemTaskbarButton > UOperatingSystemBaseProgram::GetTaskbarButton ( ) const

Retrieves the taskbar button associated with the program.

This method returns a pointer to the taskbar button associated with the program. If the program does not have a taskbar button, the method returns nullptr.

Returns
A pointer to the taskbar button associated with the program. If the program does not have a taskbar button, the method returns nullptr.
Note
The returned taskbar button should not be modified or destroyed by the caller. It is managed internally by the program.
See also
UOperatingSystemTaskbarButton
Here is the caller graph for this function:

◆ GetTaskbarButtonClass()

TSoftClassPtr< UOperatingSystemTaskbarButton > UOperatingSystemBaseProgram::GetTaskbarButtonClass ( ) const

Retrieves the taskbar button class associated with the program.

This method retrieves the taskbar button class associated with the program. It returns a soft object pointer to the taskbar button class.

Returns
A soft object pointer to the taskbar button class. If the program's taskbar button class is null, the method returns nullptr.
See also
UOperatingSystemTaskbarButton
Here is the caller graph for this function:

◆ GetWidgetClass()

TSoftClassPtr< UOperatingSystemProgramWidget > UOperatingSystemBaseProgram::GetWidgetClass ( ) const

Retrieves the widget class associated with the operating system base program. This method returns the widget class that should be used to create the program widget for the specific program.

Returns
The widget class that should be used to create the program widget. Returns nullptr if no widget class is defined.
See also
UOperatingSystemProgramWidget

◆ GetWindowPosition()

TOptional< FVector2D > UOperatingSystemBaseProgram::GetWindowPosition ( ) const

Retrieves the position of the window associated with the operating system program.

If the program has a parent window, the method will call the GetWindowPosition() method of the parent window and return the result. If the program does not have a parent window, the method returns an empty optional value.

Returns
The position of the window associated with the program, or an empty optional value if the program does not have a parent window.

◆ IsCompatibleWithOS()

void UOperatingSystemBaseProgram::IsCompatibleWithOS ( const TWeakObjectPtr< const UOperatingSystem > TestOS,
FGenericError & OutError ) const

Checks if the given operating system is compatible with this program.

Parameters
TestOSThe operating system to test compatibility with.
OutErrorThe error message in case of incompatibility.

◆ IsRunning()

bool UOperatingSystemBaseProgram::IsRunning ( ) const

Checks if the program is running.

Returns
True if the program is running. False otherwise.
Here is the caller graph for this function:

◆ IsSingleInstanceProgram()

FORCEINLINE bool UOperatingSystemBaseProgram::IsSingleInstanceProgram ( ) const
inline

Returns a boolean value indicating whether the program is a single instance program. A single instance program is a program that allows only one instance to run at a time.

Returns
True if the program is a single instance program, false otherwise.
See also
UOperatingSystemBaseProgram
Here is the caller graph for this function:

◆ IsStoreItemFree()

bool UOperatingSystemBaseProgram::IsStoreItemFree ( const FOperatingSystemStoreProgramData & ProgramData)
static

Checks if a store item is free.

This function takes a FOperatingSystemStoreProgramData object as input and checks if the program associated with it is free. It returns true if the program is free, and false otherwise.

Parameters
ProgramDataThe store program data to check.
Returns
bool True if the program is free, false otherwise.

◆ IsSystemInstalledProgram()

FORCEINLINE bool UOperatingSystemBaseProgram::IsSystemInstalledProgram ( ) const
inline

Returns a boolean value indicating whether the program is installed on the system. If the program is installed, it will return true; otherwise, it will return false.

◆ IsWindowMaximized()

bool UOperatingSystemBaseProgram::IsWindowMaximized ( ) const

Checks whether the window of the operating system base program is maximized.

This method checks if the window of the operating system base program is currently maximized. If the window is maximized, the method returns true; otherwise, it returns false.

Returns
True if the window is maximized, false otherwise.
See also
UOperatingSystemBaseProgram
UOperatingSystemBaseProgram::ParentWindow
UOperatingSystemBaseProgram::ParentWindow::IsMaximized

◆ K2_GetSaveSlotName()

FString UOperatingSystemBaseProgram::K2_GetSaveSlotName ( ) const
protected

Retrieves the save slot name.

This function is a Blueprint implementable event that allows getting the save slot name in Unreal Engine. It returns a FString object representing the name of the save slot.

Returns
FString - The save slot name.
See also
K2_GetSaveSlotName
Here is the caller graph for this function:

◆ K2_OnClose()

void UOperatingSystemBaseProgram::K2_OnClose ( )
protected

BlueprintImplementableEvent for closing the operating system program.

This event is called when the operating system program needs to be closed.

See also
K2_OnClose()
Here is the caller graph for this function:

◆ K2_OnCreate()

void UOperatingSystemBaseProgram::K2_OnCreate ( )
protected

Implementable event called when the program is created.

◆ K2_OnInstall()

void UOperatingSystemBaseProgram::K2_OnInstall ( )
protected

UFunction declaration for the blueprint implementable event K2_OnInstall.

This function should be used to handle the installation logic for the operating system program. It is a blueprint implementable event, which means it can be overridden and implemented in blueprint classes.

◆ K2_OnOpenFile()

void UOperatingSystemBaseProgram::K2_OnOpenFile ( FGenericError & OutError)
protected

Implementable event triggered when a file is opened. This event is called before calling ProgramWidget->OpenFile.

This event can be implemented in Blueprint to handle the opening of a file.

Here is the caller graph for this function:

◆ K2_OnSettingsLoad()

void UOperatingSystemBaseProgram::K2_OnSettingsLoad ( UOperatingSystemProgramSettings * LoadedSettings)
protected

Blueprint event called when settings are loaded.

It is called when settings are loaded for an operating system program.

Parameters
LoadedSettingsThe loaded settings object.

◆ K2_OnStart()

FGenericError UOperatingSystemBaseProgram::K2_OnStart ( )
protected

A function that is called when the operating system program starts.

This function is a blueprint implementable event. It is called when the operating system program is started. It returns an object of type FGenericError.

Returns
FGenericError - The result of the function call.
Note
This function is associated with the "OnStart" category in the OperatingSystemProgram blueprint. It can be implemented and customized in blueprints to define specific behavior when the program starts.
Here is the caller graph for this function:

◆ K2_OnValidate()

void UOperatingSystemBaseProgram::K2_OnValidate ( FGenericError & OutError) const
protected

Implementable event triggered when validating this program. If you set the Output Error return value to something valid, this program will not be created at all.

Parameters
OutErrorOutputs error.

◆ OnClose()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemBaseProgram::OnClose ( FGenericError & OutError)
inlineprotectedvirtual

Called when the program is requested to be closed. It can be overridden by derived classes to perform necessary cleanup operations before the program is closed. The function receives an FGenericError& object as a parameter, which can be used to report any error that occurred during the closing process.

Parameters
OutErrorThe error object to report any error that occurred during the closing process.
See also
FGenericError

Reimplemented in UOperatingSystemAudioPlayer, and UOperatingSystemVideoPlayer.

Here is the caller graph for this function:

◆ OnOpenFile()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemBaseProgram::OnOpenFile ( UOperatingSystemFile * TargetFile,
FGenericError & OutError )
inlineprotectedvirtual

Called when a file is opened in the operating system program. It provides the target file that was opened, as well as an output error parameter for reporting any errors that occurred during the file opening process.

Parameters
TargetFileThe pointer to the UOperatingSystemFile object representing the opened file.
OutErrorThe reference to the FGenericError object for reporting any errors occurred during the file opening process.
Warning
DO NOT call this function directly. Use UOperatingSystemStatics::OpenFile function instead.
See also
UOperatingSystemFile
FGenericError

Reimplemented in UOperatingSystemAudioPlayer, and UOperatingSystemVideoPlayer.

Here is the caller graph for this function:

◆ OnProgramWindowStateChanged()

void UOperatingSystemBaseProgram::OnProgramWindowStateChanged ( const EOperatingSystemProgramViewState & NewState) const

Called when the program window's state changes.

Parameters
NewStateThe new state of the program window.
Here is the caller graph for this function:

◆ OnStart()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemBaseProgram::OnStart ( FGenericError & OutError)
inlineprotectedvirtual

Called when the program starts. It should be overridden in derived classes to provide the necessary functionality for the specific program.

Parameters
OutErrorA reference to the FGenericError object, used to report any errors that occur during startup.
See also
FGenericError

Reimplemented in UOperatingSystemStore, and UOperatingSystemTerminal.

◆ OnThemeChanged()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemBaseProgram::OnThemeChanged ( UOperatingSystemSettingModule_Theme * ThemePayload)
inlineprotectedvirtual

Virtual method called when the theme is changed.

This method is called when the theme is changed. It can be overridden by derived classes to handle theme change events.

Parameters
ThemePayloadA pointer to the UOperatingSystemSettingModule_Theme object that represents the new

◆ OnValidate()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemBaseProgram::OnValidate ( FGenericError & OutError) const
inlineprotectedvirtual

OnValidate method for validating program-specific logic.

This method is a virtual function that can be overridden by derived classes to perform additional validation specific to the program's requirements. The method takes an FGenericError& parameter, which can be used to report any validation errors encountered during the validation process.

Parameters
OutErrorThe error object used to report any validation errors.
See also
FGenericError

Reimplemented in UOperatingSystemStore, and UOperatingSystemTerminal.

◆ OpenFile()

void UOperatingSystemBaseProgram::OpenFile ( UOperatingSystemFile * TargetFile,
FGenericError & OutError )

Opens a file in the operating system.

Warning
DO NOT call this function directly. Use UOperatingSystemStatics::OpenFile function instead.
Parameters
TargetFileThe file to be opened.
OutErrorThe error message if the file fails to open.
Here is the call graph for this function:

◆ SetParentPartition()

void UOperatingSystemBaseProgram::SetParentPartition ( TWeakObjectPtr< UOperatingSystemPartition > OwningPartition)

Sets the parent partition of the program to the specified operating system partition.

Parameters
OwningPartitionA weak object pointer to the operating system partition that owns this program.

◆ ShouldRememberLastWindowPosition()

FORCEINLINE bool UOperatingSystemBaseProgram::ShouldRememberLastWindowPosition ( ) const
inline

Indicates whether the program should remember the last window position.

This method returns a boolean value indicating whether the program should remember the last window position or not. If the value is true, the program should remember the last window position, otherwise it should not.

Returns
true if the program should remember the last window position, false otherwise.

◆ StartProgram()

UOperatingSystemBaseProgram * UOperatingSystemBaseProgram::StartProgram ( FGenericError & OutError)

Starts a program in the operating system.

This function is used to start a program in the operating system. It checks if the program is already running. If the program is set to run in a single instance only and is already running, it returns the currently running instance. Otherwise, it creates a new instance of the program and initializes it.

Parameters
OutErrorThe error message in case of any error during program start.
Returns
A pointer to the started program, or nullptr if there was an error.
Here is the call graph for this function:

Member Data Documentation

◆ Author

FText UOperatingSystemBaseProgram::Author
protected

The company or individual who created this program.

◆ bAddToDesktop

uint8 UOperatingSystemBaseProgram::bAddToDesktop
protected

If true, add this program to the desktop after install.

◆ bAllowDragging

uint8 UOperatingSystemBaseProgram::bAllowDragging
protected

Allows the user to drag the window of this program.

◆ bAllowResizing

uint8 UOperatingSystemBaseProgram::bAllowResizing
protected

Allows the draggable window of this program to be resized by user.

◆ bCanRunOnPortableDevice

uint8 UOperatingSystemBaseProgram::bCanRunOnPortableDevice
protected

If true, this program can run on portable device too.

◆ bCreateNotification

uint8 UOperatingSystemBaseProgram::bCreateNotification
protected

If true, add a notification to the Operating System that this program installed.

◆ bCreateSettingsBeforeStarting

uint8 UOperatingSystemBaseProgram::bCreateSettingsBeforeStarting
protected

Some programs might need access to its settings class before they are started. For example, to determine if the program itself should start automatically when os is started. In this case, you need to enable this.

See:

: K2_OnSettingsLoad

◆ bOverrideWindowSize

uint8 UOperatingSystemBaseProgram::bOverrideWindowSize
protected

Disables auto determining and set the window size as set by Override Window Size variable.

◆ bRememberLastWindowPosition

uint8 UOperatingSystemBaseProgram::bRememberLastWindowPosition
protected

Set to true if the window position should be saved and restored automatically.

◆ bRequireMinOperatingSystemVersion

uint8 UOperatingSystemBaseProgram::bRequireMinOperatingSystemVersion
protected

◆ bRequiresData

uint8 UOperatingSystemBaseProgram::bRequiresData
protected

If true, then this program must have a valid data class set and the data object must return ShouldCreate true (by default it is). If not, program will not create.

◆ bSingleInstanceOnly

uint8 UOperatingSystemBaseProgram::bSingleInstanceOnly
protected

If true, only one instance of this program is allowed to run.

◆ CloseMethod

EOperatingSystemProgramCloseMethod UOperatingSystemBaseProgram::CloseMethod
protected

Determines how the program should close. For a phone type of device, typically this should be set to Background.

◆ DataClass

TSoftClassPtr<UOperatingSystemProgramData> UOperatingSystemBaseProgram::DataClass
protected

◆ Description

FText UOperatingSystemBaseProgram::Description
protected

A simple description for this program. Typically used on store apps.

◆ IconObject

TSoftObjectPtr<UObject> UOperatingSystemBaseProgram::IconObject
protected

Obvious right? C'mon its just an Icon. What you need a tooltip for ¯_(ツ)_/¯

◆ IconWidgetClass

TSoftClassPtr<UOperatingSystemProgramIconWidget> UOperatingSystemBaseProgram::IconWidgetClass
protected

Icon widget that represents this program.

◆ Identifier

FName UOperatingSystemBaseProgram::Identifier
protected

A unique identifier (UID) for this program. Useful for terminal commands.

◆ MinimumWindowResize

FVector2D UOperatingSystemBaseProgram::MinimumWindowResize
protected

If non zero, window can only resize upto this value. Resizing will not go lower than this.

◆ MinOperatingSystemVersion

FOperatingSystemVersion UOperatingSystemBaseProgram::MinOperatingSystemVersion
protected

If enabled, this program will not install/run on an Operating System less than this version.

◆ Name

FText UOperatingSystemBaseProgram::Name
protected

Name of this program.

◆ OnOperatingSystemProgramViewStateChanged

FOnOperatingSystemProgramViewStateChanged UOperatingSystemBaseProgram::OnOperatingSystemProgramViewStateChanged

A Blueprint assignable delegate that is triggered when the view state of an operating system program changes. This delegate can be used to handle view state changes of an operating system program, such as when a program window is minimized or maximized.

See also
OnOperatingSystemProgramViewStateChanged
UOperatingSystemBaseProgram

◆ OverrideWindowClass

TSoftClassPtr<UDraggableWindow> UOperatingSystemBaseProgram::OverrideWindowClass
protected

If not null, then use this class as draggable window when starting this program. If null, new window class should be set inside UOperatingSystemWidget::K2_CreateNewWindow

◆ OverrideWindowSize

FVector2D UOperatingSystemBaseProgram::OverrideWindowSize
protected

Forcefully set a window size instead of auto-determining

◆ ParentPartition

TWeakObjectPtr<UOperatingSystemPartition> UOperatingSystemBaseProgram::ParentPartition
protected

◆ SaveMethod

EOperatingSystemProgramSaveMethod UOperatingSystemBaseProgram::SaveMethod
protected

Determines when this program saves.

◆ SettingsClass

TSoftClassPtr<UOperatingSystemProgramSettings> UOperatingSystemBaseProgram::SettingsClass
protected

An optional class where you can save custom settings for this program. Example: Customizable options for a browser.

◆ SpaceRequiredInMB

float UOperatingSystemBaseProgram::SpaceRequiredInMB
protected

How much space does this program consume once installed.

◆ StartWindowState

EOperatingSystemWindowStartupState UOperatingSystemBaseProgram::StartWindowState
protected

Set the startup window state.

◆ StoreDisplayName

FText UOperatingSystemBaseProgram::StoreDisplayName
protected

Only for store app. Overrides the name to show on store. If this is unset, Name property is used.

◆ StorePrice

float UOperatingSystemBaseProgram::StorePrice
protected

Only for store app. What price should be displayed on store. Set to 0 to make this free.

◆ StoreType

FText UOperatingSystemBaseProgram::StoreType
protected

Only for store app. What category or type is this program? Example: Entertainment, Productivity, Financial, Game, Utilities, Tool etc.

◆ SupportedOperatingSystems

FGameplayTagContainer UOperatingSystemBaseProgram::SupportedOperatingSystems
protected

If this container is empty, it is assumed all Operating Systems are supported.

◆ TaskbarButtonClass

TSoftClassPtr<UOperatingSystemTaskbarButton> UOperatingSystemBaseProgram::TaskbarButtonClass
protected

◆ Version

FOperatingSystemVersion UOperatingSystemBaseProgram::Version
protected

Program version

◆ WidgetClass

TSoftClassPtr<UOperatingSystemProgramWidget> UOperatingSystemBaseProgram::WidgetClass
protected

Widget associated with this program.


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