A class representing a widget for an operating system simulator.
More...
#include "OperatingSystemWidget.h"
A class representing a widget for an operating system simulator.
◆ UOperatingSystemWidget()
UOperatingSystemWidget::UOperatingSystemWidget |
( |
| ) |
|
◆ AllNotificationsCleared()
void UOperatingSystemWidget::AllNotificationsCleared |
( |
| ) |
|
Notifies that all notifications have been cleared.
This method is called when all notifications in the operating system widget have been cleared.
◆ BeginRestartOS()
void UOperatingSystemWidget::BeginRestartOS |
( |
| ) |
|
Initiates the process of restarting the operating system.
This method triggers the restart process of the operating system. It calls the OnBeginRestartOS callback and switches the tab to the restart tab. The callback can be implemented by the user to perform any necessary actions before restarting the system. After the callback is executed, the tab is switched to the restart tab.
◆ BeginShutdownOS()
void UOperatingSystemWidget::BeginShutdownOS |
( |
| ) |
|
Initiates the shutdown process of the operating system.
This method is used to initiate the shutdown process of the operating system in the UOperatingSystemWidget class. It calls the OnBeginShutdownOS breakpoint and switches the tab to OSWidget_Shutdown_Tag.
◆ BringWindowToFront()
void UOperatingSystemWidget::BringWindowToFront |
( |
UDraggableWindow * | TargetWindow, |
|
|
const int32 & | NewZOrder ) |
Brings the specified window to the front with the specified new Z-order.
- Parameters
-
TargetWindow | The window to bring to the front. |
NewZOrder | The new Z-order of the window. |
- Warning
- This method is only implemented if the corresponding Widget Blueprint has implemented the BringWindowToFront function. If not implemented, it logs a warning message and does nothing.
- See also
- UOperatingSystemWidget::K2_BringWindowToFront
◆ CreateNewWindow()
Creates a new window for a given operating system program.
This method generates a new window for the specified program. If the program has implemented the CreateNewWindow event in a Blueprint, it will be called. If the Blueprint does not implement the event or returns nullptr, an error message will be logged and the method will return nullptr.
- Parameters
-
Program | Pointer to the operating system program for which to create a new window. |
- Returns
- Pointer to the newly created window. If the window creation fails or the CreateNewWindow event returns nullptr, nullptr will be returned.
◆ CreateOperatingSystemWidget()
Creates an instance of the UOperatingSystemWidget class.
This method creates a widget for an operating system simulator and returns an instance of the UOperatingSystemWidget class. The created widget is based on the provided operating system object.
- Parameters
-
OS | A pointer to the operating system object that the widget will be created for. |
- Returns
- An instance of the UOperatingSystemWidget class.
◆ FinishInstallation()
void UOperatingSystemWidget::FinishInstallation |
( |
| ) |
|
Finishes the installation of the operating system.
This method is called to finish the installation of the operating system. It is typically called after the installation has been completed.
It performs the following tasks:
- Logs the finishing installation process using the "Finishing installation" log category.
- Checks if the parent device's startup type is set to "Default". If so, it performs additional steps.
- Calls the Internal_CreateDefaultDirectories() function to create default directories.
- Calls the InstallStartupPrograms() function to install startup programs.
- Calls the FinishInstallationImpl() function to perform any additional finishing installation steps.
- Calls the FinishInstallation() method of the UOperatingSystemWidget class to finish the installation on the operating system widget.
- Calls the OnFinishOperatingSystemInstallation() method of the parent device and checks its return value.
- Exceptions
-
Any | exceptions thrown by the called functions/methods are propagated to the caller. |
◆ IsCurrentlyViewingDesktop()
bool UOperatingSystemWidget::IsCurrentlyViewingDesktop |
( |
| ) |
const |
Check if the user is currently viewing the desktop.
This method returns a boolean value indicating whether the user is currently viewing the desktop in the operating system simulator.
- Returns
- true if the user is currently viewing the desktop, false otherwise.
◆ K2_BringWindowToFront()
void UOperatingSystemWidget::K2_BringWindowToFront |
( |
UDraggableWindow * | Window, |
|
|
const int32 & | NewZOrder ) |
|
protected |
Brings a window to the front of the operating system widget.
This method is a Blueprint Implementable Event, which means it can be overridden in Blueprint subclasses of OperatingSystemWidget. It is used to bring a specified window to the front of the widget's z-ordering.
- Parameters
-
Window | A pointer to the UDraggableWindow object representing the window to bring to the front. |
NewZOrder | The new z-order to set for the window. |
- Note
- This method is triggered when the "OnBringWindowToFront" event is called.
◆ K2_CreateNewWindow()
Creates a new window for the operating system widget.
This method creates a new window for the operating system widget and associates it with the specified program.
- Parameters
-
Program | The program to associate with the new window. |
- Returns
- A pointer to the newly created draggable window.
◆ K2_OnBeginInstall()
void UOperatingSystemWidget::K2_OnBeginInstall |
( |
const float & | InstallationTime | ) |
|
|
protected |
BlueprintImplementableEvent method for handling the beginning of an installation process in the OperatingSystemWidget class. This method is responsible for initiating the installation and taking necessary actions during the process.
- Parameters
-
InstallationTime | A constant reference to a float value representing the estimated time for completion of installation. This value is provided by the caller of the method. |
- Note
- This method is implemented as a BlueprintImplementableEvent, which means it can be overridden in Blueprints and additional functionality can be added.
◆ K2_OnBeginRestartOS()
void UOperatingSystemWidget::K2_OnBeginRestartOS |
( |
| ) |
|
|
protected |
BlueprintImplementableEvent for handling the beginning of the restart process for the operating system.
This method is called when the restart process for the operating system is about to begin. It is blueprint implementable, which means it can be overridden in Blueprint subclasses of OperatingSystemWidget to provide custom behavior when the restart process starts.
- Note
- This method should not be called directly, as it is meant to be used as an event. Instead, subclass this OperatingSystemWidget and override this method in Blueprint subclasses to provide custom behavior.
- See also
- K2_OnEndRestartOS
◆ K2_OnBeginShutdownOS()
void UOperatingSystemWidget::K2_OnBeginShutdownOS |
( |
| ) |
|
|
protected |
Called when the operating system begins shutting down.
- Note
- This method is implemented as a BlueprintImplementableEvent, which means it can be overridden in Blueprints and additional functionality can be added.
◆ K2_OnClearAllNotification()
void UOperatingSystemWidget::K2_OnClearAllNotification |
( |
| ) |
|
|
protected |
Clears all notifications.
- Note
- This method is implemented as a BlueprintImplementableEvent, which means it can be overridden in Blueprints and additional functionality can be added.
◆ K2_OnFinishInstall()
void UOperatingSystemWidget::K2_OnFinishInstall |
( |
| ) |
|
|
protected |
BlueprintImplementableEvent that can be overridden in blueprint subclasses of OperatingSystemWidget. It is triggered when the installation process of the operating system finishes.
- Note
- Make sure to override this event in blueprint subclasses if you want to add custom functionality after the installation process finishes.
◆ K2_OnInitialStartup()
void UOperatingSystemWidget::K2_OnInitialStartup |
( |
| ) |
|
|
protected |
BlueprintImplementableEvent for handling the initial startup of the operating system widget.
This event is called when the operating system widget is initially started up. It provides a hook for derived classes to perform any necessary initialization tasks. This event can be overridden in blueprint subclasses of the operating system widget to provide custom logic.
- Note
- This method is implemented as a BlueprintImplementableEvent, which means it can be overridden in Blueprints and additional functionality can be added.
- See also
- UOperatingSystemWidget
-
K2_OnShutdown
◆ K2_OnPrepareInstall()
void UOperatingSystemWidget::K2_OnPrepareInstall |
( |
| ) |
|
|
protected |
Triggered when the widget needs to prepare for installation.
- Note
- This method is implemented as a BlueprintImplementableEvent, which means it can be overridden in Blueprints and additional functionality can be added.
◆ K2_OnShowDesktop()
void UOperatingSystemWidget::K2_OnShowDesktop |
( |
| ) |
|
|
protected |
Called when the "Show Desktop" action is triggered.
- Note
- This event is blueprint implementable, allowing subclasses to define their own behavior when the desktop is shown.
◆ K2_OnShowLogonScreen()
void UOperatingSystemWidget::K2_OnShowLogonScreen |
( |
| ) |
|
|
protected |
This event is called when the logon screen needs to be shown.
- Note
- This method is implemented as a BlueprintImplementableEvent, which means it can be overridden in Blueprints and additional functionality can be added.
◆ K2_OnShowNotification()
This method is called when a notification needs to be shown.
- Parameters
-
NewNotification | The new notification to be shown. |
This method is called internally to display a notification. The NewNotification parameter contains the information about the notification to be displayed. It is recommended to provide an implementation of this method in the subclass of UOperatingSystemWidget
to handle the display of notifications. However, this method can also be called directly to show a notification externally. The FOperatingSystemNotification
struct contains the necessary information about the notification, such as the title, message, and icon.
- Note
- This method is implemented as a BlueprintImplementableEvent, which means that it can be overridden in Blueprint classes that inherit from
UOperatingSystemWidget
. This allows you to customize the behavior of how notifications are displayed without modifying the C++ code. To override this event in a Blueprint, simply create a new event with this same name and signature in the Blueprint class.
- See also
- FOperatingSystemNotification
◆ K2_OnStartOS()
void UOperatingSystemWidget::K2_OnStartOS |
( |
const bool | bIsInitialStartup | ) |
|
|
protected |
A BlueprintImplementableEvent that is called when the operating system starts.
- Parameters
-
bIsInitialStartup | Whether it is the initial startup of the operating system. |
- Note
- This event is called during the startup of the operating system and should perform any necessary actions when the operating system starts.
◆ K2_OnSwitchTab()
void UOperatingSystemWidget::K2_OnSwitchTab |
( |
const FGameplayTag & | WidgetTag | ) |
|
|
protected |
BlueprintImplementableEvent handler for when a tab is switched in the Operating System Widget.
This method is called when a tab is switched in the Operating System Widget. It is a BlueprintImplementableEvent, which means it can be overridden and implemented in Blueprint subclasses of OperatingSystemWidget. The WidgetTag parameter represents the gameplay tag of the tab that was switched to.
- Parameters
-
WidgetTag | The gameplay tag of the tab that was switched to. |
◆ LoadOsWidget()
void UOperatingSystemWidget::LoadOsWidget |
( |
const bool | bIsInitialStartup | ) |
|
Loads the operating system widget.
It displays the widget on the screen and performs necessary initialization.
- Parameters
-
bIsInitialStartup | Specifies whether the operating system is being started for the first time. If true, it indicates that it is the initial startup of the operating system. If false, it indicates that it is a regular startup. |
◆ PrepareToInstall()
void UOperatingSystemWidget::PrepareToInstall |
( |
| ) |
|
Prepares for the installation of the operating system.
This method is called to prepare for the installation of the operating system. It triggers the "OnPrepareInstall" blueprint event and switches the tab to "OSWidget_Installation_Tag
". It is typically called before starting the installation process.
◆ ShowDesktop()
void UOperatingSystemWidget::ShowDesktop |
( |
| ) |
|
Displays the desktop on the screen.
This method is called to display the desktop on the screen. It triggers the "OnShowDesktop" blueprint event. The desktop represents the main user interface of the operating system.
◆ ShowInitialStartupScreen()
void UOperatingSystemWidget::ShowInitialStartupScreen |
( |
| ) |
|
Displays the initial startup screen of the operating system.
This method is called to display the initial startup screen of the operating system. It triggers the "OnInitialStartup" blueprint event and switches the tab to "OSWidget_InitialStartup_Tag".
◆ ShowLogonScreen()
void UOperatingSystemWidget::ShowLogonScreen |
( |
| ) |
|
Displays the logon screen of the operating system.
This method is called to display the logon screen of the operating system. It triggers the "OnShowLogonScreen" blueprint event and switches the tab to "OSWidget_Logon_Tag".
◆ ShowNotification()
Displays a notification on the operating system widget.
This method is called to show a notification on the operating system widget.
- Parameters
-
◆ SwitchTab()
void UOperatingSystemWidget::SwitchTab |
( |
const FGameplayTag | Tag | ) |
|
Switches to the tab specified by the given gameplay tag.
This method switches the current tab to the tab specified by the given gameplay tag. If the specified tag is different from the current tab tag, the method performs the following actions:
- Updates the current tab tag to the specified tag.
- Outputs a log message indicating the switch from the current tab to the specified tab.
- Checks if there is a Blueprint override for the K2_OnSwitchTab event in the Widget Blueprint.
- If the override exists, the method calls K2_OnSwitchTab with the specified tag.
- If the override does not exist, the method outputs a warning log message indicating that K2_OnSwitchTab is not implemented in the Widget Blueprint.
- If the current tab tag is OSWidget_Desktop_Tag, the method calls ShowDesktop.
- Parameters
-
Tag | The gameplay tag specifying the tab to switch to. |
◆ CurrentTabTag
FGameplayTag UOperatingSystemWidget::CurrentTabTag |
|
protected |
The current tab tag representing the currently active tab in the operating system widget.
This variable is of type FGameplayTag
and is marked as Transient
, meaning its value is not serialized. It holds the gameplay tag of the currently active tab in the operating system widget. The tag represents the type or category of the tab, allowing for easy identification and switching between tabs.
The value of this variable is updated when the SwitchTab
function is called, and it is used to determine whether the currently active tab is the desktop or not in the UOperatingSystemWidget::IsCurrentlyViewingDesktop function.
◆ ParentOS
A pointer to the parent operating system of the widget.
The documentation for this class was generated from the following files: