Skip to content

UOperatingSystemWidget

#include <OperatingSystemSimulator/Public/Widgets/OperatingSystemWidget.h>
class UOperatingSystemWidget

Defined in OperatingSystemWidget.h:19

Inherits: UCommonUserWidget

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemWidget["UOperatingSystemWidget"]
  class UCommonUserWidget["UCommonUserWidget"]
  UCommonUserWidget <|-- UOperatingSystemWidget
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemWidget["UOperatingSystemWidget"]
  class UOperatingSystem["UOperatingSystem"]
  UOperatingSystemWidget *-- UOperatingSystem
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemWidget {
    +UOperatingSystemWidget()
    +LoadOsWidget(const bool bIsInitialStartup)
    +ShowInitialStartupScreen()
    +ShowLogonScreen()
    +ShowDesktop()
    +PrepareToInstall()
    +FinishInstallation()
    +BeginRestartOS()
    +BeginShutdownOS()
    +CreateNewWindow(UOperatingSystemBaseProgram *Program) UDraggableWindow() *
    +ShowNotification(const FOperatingSystemNotification &NewNoti
    +AllNotificationsCleared()
    +BringWindowToFront(UDraggableWindow *TargetWindow, const int32
    +SwitchTab(const FGameplayTag Tag)
    +IsCurrentlyViewingDesktop() const bool
    +CreateOperatingSystemWidget(UOperatingSystem *OS) UOperatingSystemWidget() *
    +ParentOS : TObjectPtr< UOperatingSystem() >
    +CurrentTabTag : FGameplayTag
    +K2_OnPrepareInstall()
    +K2_OnBeginInstall(const float &InstallationTime)
    +K2_OnFinishInstall()
    +K2_OnStartOS(const bool bIsInitialStartup)
    +K2_OnInitialStartup()
    +K2_OnShowLogonScreen()
    +K2_OnShowDesktop()
    +K2_OnBeginRestartOS()
    +K2_OnBeginShutdownOS()
    +K2_CreateNewWindow(UOperatingSystemBaseProgram *Program) UDraggableWindow() *
    +K2_OnSwitchTab(const FGameplayTag &WidgetTag)
    +K2_BringWindowToFront(UDraggableWindow *Window, const int32 &NewZ
    +K2_OnShowNotification(const FOperatingSystemNotification &NewNoti
    +K2_OnClearAllNotification()
    +bHasBlueprintOnStartOS : uint16
    +bHasBlueprintOnInitialStartup : uint16
    +bHasBlueprintOnShowLogonScreen : uint16
    +bHasBlueprintOnShowDesktop : uint16
    +bHasBlueprintOnPrepareInstall : uint16
    +bHasBlueprintOnFinishInstall : uint16
    +bHasBlueprintOnBeginRestartOS : uint16
    +bHasBlueprintOnBeginShutdownOS : uint16
    +bHasBlueprintCreateNewWindow : uint16
    +bHasBlueprintOnShowNotification : uint16
    +bHasBlueprintOnClearAllNotification : uint16
    +bHasBlueprintBringWindowToFront : uint16
    +bHasBlueprintOnSwitchTab : uint16
  }

Documented call sites inside the plugin (6):

flowchart LR
  UOperatingSystemWidget__SwitchTab["UOperatingSystemWidget::SwitchTab"]
  UOperatingSystemWidget__BeginRestartOS["UOperatingSystemWidget::BeginRestartOS"]
  UOperatingSystemWidget__BeginRestartOS --> UOperatingSystemWidget__SwitchTab
  UOperatingSystemWidget__BeginShutdownOS["UOperatingSystemWidget::BeginShutdownOS"]
  UOperatingSystemWidget__BeginShutdownOS --> UOperatingSystemWidget__SwitchTab
  UOperatingSystemWidget__LoadOsWidget["UOperatingSystemWidget::LoadOsWidget"]
  UOperatingSystemWidget__LoadOsWidget --> UOperatingSystemWidget__SwitchTab
  UOperatingSystemWidget__PrepareToInstall["UOperatingSystemWidget::PrepareToInstall"]
  UOperatingSystemWidget__PrepareToInstall --> UOperatingSystemWidget__SwitchTab
  UOperatingSystemWidget__ShowInitialStartupScreen["UOperatingSystemWidget::ShowInitialStartupScreen"]
  UOperatingSystemWidget__ShowInitialStartupScreen --> UOperatingSystemWidget__SwitchTab
  UOperatingSystemWidget__ShowLogonScreen["UOperatingSystemWidget::ShowLogonScreen"]
  UOperatingSystemWidget__ShowLogonScreen --> UOperatingSystemWidget__SwitchTab

A class representing a widget for an operating system simulator.

ReturnNameDescription
UOperatingSystemWidget
voidLoadOsWidgetLoads the operating system widget.
voidShowInitialStartupScreenDisplays the initial startup screen of the operating system.
voidShowLogonScreenDisplays the logon screen of the operating system.
voidShowDesktopDisplays the desktop on the screen.
voidPrepareToInstallPrepares for the installation of the operating system.
voidFinishInstallationFinishes the installation of the operating system.
voidBeginRestartOSInitiates the process of restarting the operating system.
voidBeginShutdownOSInitiates the shutdown process of the operating system.
UDraggableWindow *CreateNewWindowCreates a new window for a given operating system program.
voidShowNotificationDisplays a notification on the operating system widget.
voidAllNotificationsClearedNotifies that all notifications have been cleared.
voidBringWindowToFrontBrings the specified window to the front with the specified new Z-order.
voidSwitchTabSwitches to the tab specified by the given gameplay tag.
boolIsCurrentlyViewingDesktop constCheck if the user is currently viewing the desktop.

UOperatingSystemWidget()

Defined in OperatingSystemWidget.h:60


void LoadOsWidget(const bool bIsInitialStartup)

Defined in OperatingSystemWidget.h:81 Loads the operating system widget.

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

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

void ShowInitialStartupScreen()

Defined in OperatingSystemWidget.h:89 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”.


void ShowLogonScreen()

Defined in OperatingSystemWidget.h:97 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”.


void ShowDesktop()

Defined in OperatingSystemWidget.h:105 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.


void PrepareToInstall()

Defined in OperatingSystemWidget.h:114 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.


void FinishInstallation()

Defined in OperatingSystemWidget.h:134 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.

  • Any exceptions thrown by the called functions/methods are propagated to the caller.
  • CALL_BP

void BeginRestartOS()

Defined in OperatingSystemWidget.h:144 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.


void BeginShutdownOS()

Defined in OperatingSystemWidget.h:152 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.


UDraggableWindow * CreateNewWindow(UOperatingSystemBaseProgram * Program)

Defined in OperatingSystemWidget.h:167 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.

  • Program Pointer to the operating system program for which to create a new window.

Pointer to the newly created window. If the window creation fails or the CreateNewWindow event returns nullptr, nullptr will be returned.


void ShowNotification(const FOperatingSystemNotification & NewNotification)

Defined in OperatingSystemWidget.h:177 Displays a notification on the operating system widget.

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


void AllNotificationsCleared()

Defined in OperatingSystemWidget.h:184 Notifies that all notifications have been cleared.

This method is called when all notifications in the operating system widget have been cleared.

  • CALL_BP

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

Defined in OperatingSystemWidget.h:197 Brings the specified window to the front with the specified new Z-order.

  • TargetWindow The window to bring to the front.

  • NewZOrder The new Z-order of the window.

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


void SwitchTab(const FGameplayTag Tag)

Defined in OperatingSystemWidget.h:214 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.

  1. If the current tab tag is OSWidget_Desktop_Tag, the method calls ShowDesktop.
  • Tag The gameplay tag specifying the tab to switch to.

const

bool IsCurrentlyViewingDesktop() const

Defined in OperatingSystemWidget.h:225 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.

true if the user is currently viewing the desktop, false otherwise.

ReturnNameDescription
UOperatingSystemWidget *CreateOperatingSystemWidget staticCreates an instance of the UOperatingSystemWidget class.

static

static UOperatingSystemWidget * CreateOperatingSystemWidget(UOperatingSystem * OS)

Defined in OperatingSystemWidget.h:71 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.

  • OS A pointer to the operating system object that the widget will be created for.

An instance of the UOperatingSystemWidget class.

  • CreateFromSoftWidget
ReturnNameDescription
TObjectPtr< UOperatingSystem >ParentOSA pointer to the parent operating system of the widget.
FGameplayTagCurrentTabTagThe current tab tag representing the currently active tab in the operating system widget.

TObjectPtr< UOperatingSystem > ParentOS

Defined in OperatingSystemWidget.h:27 A pointer to the parent operating system of the widget.


FGameplayTag CurrentTabTag

Defined in OperatingSystemWidget.h:40 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.

ReturnNameDescription
voidK2_OnPrepareInstallTriggered when the widget needs to prepare for installation.
voidK2_OnBeginInstallBlueprintImplementableEvent 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.
voidK2_OnFinishInstallBlueprintImplementableEvent that can be overridden in blueprint subclasses of OperatingSystemWidget. It is triggered when the installation process of the operating system finishes.
voidK2_OnStartOSA BlueprintImplementableEvent that is called when the operating system starts.
voidK2_OnInitialStartupBlueprintImplementableEvent for handling the initial startup of the operating system widget.
voidK2_OnShowLogonScreenThis event is called when the logon screen needs to be shown.
voidK2_OnShowDesktopCalled when the “Show Desktop” action is triggered.
voidK2_OnBeginRestartOSBlueprintImplementableEvent for handling the beginning of the restart process for the operating system.
voidK2_OnBeginShutdownOSCalled when the operating system begins shutting down.
UDraggableWindow *K2_CreateNewWindowCreates a new window for the operating system widget.
voidK2_OnSwitchTabBlueprintImplementableEvent handler for when a tab is switched in the Operating System Widget.
voidK2_BringWindowToFrontBrings a window to the front of the operating system widget.
voidK2_OnShowNotificationThis method is called when a notification needs to be shown.
voidK2_OnClearAllNotificationClears all notifications.

void K2_OnPrepareInstall()

Defined in OperatingSystemWidget.h:235 Triggered when the widget needs to prepare for installation.


void K2_OnBeginInstall(const float & InstallationTime)

Defined in OperatingSystemWidget.h:247 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.

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

void K2_OnFinishInstall()

Defined in OperatingSystemWidget.h:256 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)

Defined in OperatingSystemWidget.h:266 A BlueprintImplementableEvent that is called when the operating system starts.

  • bIsInitialStartup Whether it is the initial startup of the operating system.

void K2_OnInitialStartup()

Defined in OperatingSystemWidget.h:281 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.

See also: UOperatingSystemWidget

See also: K2_OnShutdown


void K2_OnShowLogonScreen()

Defined in OperatingSystemWidget.h:289 This event is called when the logon screen needs to be shown.


void K2_OnShowDesktop()

Defined in OperatingSystemWidget.h:297 Called when the “Show Desktop” action is triggered.


void K2_OnBeginRestartOS()

Defined in OperatingSystemWidget.h:312 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.

See also: K2_OnEndRestartOS


void K2_OnBeginShutdownOS()

Defined in OperatingSystemWidget.h:320 Called when the operating system begins shutting down.


UDraggableWindow * K2_CreateNewWindow(UOperatingSystemBaseProgram * Program)

Defined in OperatingSystemWidget.h:332 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.

  • Program The program to associate with the new window.

A pointer to the newly created draggable window.


void K2_OnSwitchTab(const FGameplayTag & WidgetTag)

Defined in OperatingSystemWidget.h:344 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.

  • WidgetTag The gameplay tag of the tab that was switched to.

void K2_BringWindowToFront(UDraggableWindow * Window, const int32 & NewZOrder)

Defined in OperatingSystemWidget.h:358 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.

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


void K2_OnShowNotification(const FOperatingSystemNotification & NewNotification)

Defined in OperatingSystemWidget.h:376 This method is called when a notification needs to be shown.

  • 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](#uoperatingsystemwidget) to handle the display of notifications. However, this method can also be called directly to show a notification externally. The [FOperatingSystemNotification](/api-reference/operating-system-simulator/types/foperatingsystemnotification/#foperatingsystemnotification) struct contains the necessary information about the notification, such as the title, message, and icon.

See also: FOperatingSystemNotification


void K2_OnClearAllNotification()

Defined in OperatingSystemWidget.h:384 Clears all notifications.

ReturnNameDescription
uint16bHasBlueprintOnStartOS
uint16bHasBlueprintOnInitialStartup
uint16bHasBlueprintOnShowLogonScreen
uint16bHasBlueprintOnShowDesktop
uint16bHasBlueprintOnPrepareInstall
uint16bHasBlueprintOnFinishInstall
uint16bHasBlueprintOnBeginRestartOS
uint16bHasBlueprintOnBeginShutdownOS
uint16bHasBlueprintCreateNewWindow
uint16bHasBlueprintOnShowNotification
uint16bHasBlueprintOnClearAllNotification
uint16bHasBlueprintBringWindowToFront
uint16bHasBlueprintOnSwitchTab

uint16 bHasBlueprintOnStartOS

Defined in OperatingSystemWidget.h:44


uint16 bHasBlueprintOnInitialStartup
uint16 bHasBlueprintOnShowLogonScreen
uint16 bHasBlueprintOnShowDesktop
uint16 bHasBlueprintOnPrepareInstall
uint16 bHasBlueprintOnFinishInstall
uint16 bHasBlueprintOnBeginRestartOS
uint16 bHasBlueprintOnBeginShutdownOS
uint16 bHasBlueprintCreateNewWindow

Defined in OperatingSystemWidget.h:52


uint16 bHasBlueprintOnShowNotification
uint16 bHasBlueprintOnClearAllNotification
uint16 bHasBlueprintBringWindowToFront

Defined in OperatingSystemWidget.h:55


uint16 bHasBlueprintOnSwitchTab

Defined in OperatingSystemWidget.h:56