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

A class representing a widget for an operating system simulator. More...

#include "OperatingSystemWidget.h"

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

Public Member Functions

 UOperatingSystemWidget ()
 
void LoadOsWidget (const bool bIsInitialStartup)
 Loads the operating system widget.
 
void ShowInitialStartupScreen ()
 Displays the initial startup screen of the operating system.
 
void ShowLogonScreen ()
 Displays the logon screen of the operating system.
 
void ShowDesktop ()
 Displays the desktop on the screen.
 
void PrepareToInstall ()
 Prepares for the installation of the operating system.
 
void FinishInstallation ()
 Finishes the installation of the operating system.
 
void BeginRestartOS ()
 Initiates the process of restarting the operating system.
 
void BeginShutdownOS ()
 Initiates the shutdown process of the operating system.
 
UDraggableWindowCreateNewWindow (UOperatingSystemBaseProgram *Program)
 Creates a new window for a given operating system program.
 
void ShowNotification (const FOperatingSystemNotification &NewNotification)
 Displays a notification on the operating system widget.
 
void AllNotificationsCleared ()
 Notifies that all notifications have been cleared.
 
void BringWindowToFront (UDraggableWindow *TargetWindow, const int32 &NewZOrder)
 Brings the specified window to the front with the specified new Z-order.
 
void SwitchTab (const FGameplayTag Tag)
 Switches to the tab specified by the given gameplay tag.
 
bool IsCurrentlyViewingDesktop () const
 Check if the user is currently viewing the desktop.
 

Static Public Member Functions

static UE_NODISCARD UOperatingSystemWidgetCreateOperatingSystemWidget (UOperatingSystem *OS)
 Creates an instance of the UOperatingSystemWidget class.
 

Protected Member Functions

void K2_OnPrepareInstall ()
 
void K2_OnBeginInstall (const float &InstallationTime)
 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.
 
void K2_OnFinishInstall ()
 BlueprintImplementableEvent that can be overridden in blueprint subclasses of OperatingSystemWidget. It is triggered when the installation process of the operating system finishes.
 
void K2_OnStartOS (const bool bIsInitialStartup)
 A BlueprintImplementableEvent that is called when the operating system starts.
 
void K2_OnInitialStartup ()
 BlueprintImplementableEvent for handling the initial startup of the operating system widget.
 
void K2_OnShowLogonScreen ()
 
void K2_OnShowDesktop ()
 
void K2_OnBeginRestartOS ()
 BlueprintImplementableEvent for handling the beginning of the restart process for the operating system.
 
void K2_OnBeginShutdownOS ()
 Called when the operating system begins shutting down.
 
UDraggableWindowK2_CreateNewWindow (UOperatingSystemBaseProgram *Program)
 Creates a new window for the operating system widget.
 
void K2_OnSwitchTab (const FGameplayTag &WidgetTag)
 BlueprintImplementableEvent handler for when a tab is switched in the Operating System Widget.
 
void K2_BringWindowToFront (UDraggableWindow *Window, const int32 &NewZOrder)
 Brings a window to the front of the operating system widget.
 
void K2_OnShowNotification (const FOperatingSystemNotification &NewNotification)
 This method is called when a notification needs to be shown.
 
void K2_OnClearAllNotification ()
 Clears all notifications.
 

Protected Attributes

TObjectPtr< UOperatingSystemParentOS
 
FGameplayTag CurrentTabTag
 The current tab tag representing the currently active tab in the operating system widget.
 

Detailed Description

A class representing a widget for an operating system simulator.

Constructor & Destructor Documentation

◆ UOperatingSystemWidget()

UOperatingSystemWidget::UOperatingSystemWidget ( )
Here is the call graph for this function:

Member Function Documentation

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ BringWindowToFront()

void UOperatingSystemWidget::BringWindowToFront ( UDraggableWindow * TargetWindow,
const int32 & NewZOrder )

Brings the specified window to the front with the specified new Z-order.

Parameters
TargetWindowThe window to bring to the front.
NewZOrderThe 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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateNewWindow()

UDraggableWindow * UOperatingSystemWidget::CreateNewWindow ( UOperatingSystemBaseProgram * Program)

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
ProgramPointer 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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateOperatingSystemWidget()

UOperatingSystemWidget * UOperatingSystemWidget::CreateOperatingSystemWidget ( UOperatingSystem * OS)
static

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
OSA pointer to the operating system object that the widget will be created for.
Returns
An instance of the UOperatingSystemWidget class.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
Anyexceptions 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
WindowA pointer to the UDraggableWindow object representing the window to bring to the front.
NewZOrderThe new z-order to set for the window.
Note
This method is triggered when the "OnBringWindowToFront" event is called.
Here is the caller graph for this function:

◆ K2_CreateNewWindow()

UDraggableWindow * UOperatingSystemWidget::K2_CreateNewWindow ( UOperatingSystemBaseProgram * Program)
protected

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
ProgramThe program to associate with the new window.
Returns
A pointer to the newly created draggable window.
Here is the caller graph for this function:

◆ 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
InstallationTimeA 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()

void UOperatingSystemWidget::K2_OnShowNotification ( const FOperatingSystemNotification & NewNotification)
protected

This method is called when a notification needs to be shown.

Parameters
NewNotificationThe 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
Here is the caller graph for this function:

◆ K2_OnStartOS()

void UOperatingSystemWidget::K2_OnStartOS ( const bool bIsInitialStartup)
protected

A BlueprintImplementableEvent that is called when the operating system starts.

Parameters
bIsInitialStartupWhether 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.
Here is the caller graph for this function:

◆ 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
WidgetTagThe gameplay tag of the tab that was switched to.
Here is the caller graph for this function:

◆ LoadOsWidget()

void UOperatingSystemWidget::LoadOsWidget ( const bool bIsInitialStartup)

Loads the operating system widget.

It displays the widget on the screen and performs necessary initialization.

Parameters
bIsInitialStartupSpecifies 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.
Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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".

Here is the call graph for this function:

◆ 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".

Here is the call graph for this function:

◆ ShowNotification()

void UOperatingSystemWidget::ShowNotification ( const FOperatingSystemNotification & NewNotification)

Displays a notification on the operating system widget.

This method is called to show a notification on the operating system widget.

Parameters
NewNotificationThe notification to be displayed. It is of type FOperatingSystemNotification.
Here is the call graph for this function:

◆ 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:

  1. Updates the current tab tag to the specified tag.
  2. Outputs a log message indicating the switch from the current tab to the specified tab.
  3. 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.
  4. If the current tab tag is OSWidget_Desktop_Tag, the method calls ShowDesktop.
Parameters
TagThe gameplay tag specifying the tab to switch to.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ 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

TObjectPtr<UOperatingSystem> UOperatingSystemWidget::ParentOS
protected

A pointer to the parent operating system of the widget.


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