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

This class represents a non-unix operating system. It inherits from UOperatingSystem and provides additional functionality specific to non-unix systems. More...

#include "OperatingSystemNonUnix.h"

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

Public Member Functions

 UOperatingSystemNonUnix ()
 
virtual UOperatingSystemDirectoryCreateDirectoryInPath (const FString &TargetPath, const FString &DirectoryName, TSoftClassPtr< UOperatingSystemDirectory > DirectoryClass, UOperatingSystemPartition *TargetPartition, const bool bIsFromSaveGame, FGenericError &OutError) override
 
- Public Member Functions inherited from UOperatingSystem
template<class T >
T * GetAs () const
 Get a pointer to the object casted as type T.
 
template<class T >
FORCEINLINE const T * GetAsConst () const
 Get a pointer to the object casted as type T.
 
OPERATINGSYSTEMSIMULATOR_API bool AddNotification (const FOperatingSystemNotification &NewNotification)
 Adds a notification to the operating system.
 
OPERATINGSYSTEMSIMULATOR_API bool AddNotification (const FGenericError &GenericError, const EOperatingSystemNotificationCategory &Category, const EOperatingSystemNotificationType Verbosity=EOperatingSystemNotificationType::Error)
 Adds a notification to the operating system. This method allows adding a notification to the operating system with the specified error, category, and verbosity.
 
void StartOperatingSystem (const TWeakObjectPtr< const UOperatingSystemSaveGame > LoadGameInstance, FGenericError &OutError)
 Start the operating system. This method starts the operating system. It performs the necessary initialization and loads the settings and programs.
 
void PostLoadOperatingSystem ()
 Calls the PostLoadOperatingSystemImpl method and handles any error that occurs.
 
void FinishInstallation ()
 Finish the installation of the operating system.
 
void InstallStartupPrograms ()
 Install the startup programs for the operating system.
 
void ShutdownOS ()
 Shuts down the operating system.
 
void RestartOS ()
 Restarts the operating system.
 
void DestroyOS ()
 Destroys the operating system instance.
 
int32 AddRunningProgram (UOperatingSystemBaseProgram *NewProgram, FGenericError &OutError)
 Adds a running program to the operating system.
 
void ProgramStarted (UOperatingSystemBaseProgram *StartedProgram, const bool bIsRestored)
 Notifies the operating system that a program has started.
 
bool IsProgramRunning (const TWeakObjectPtr< const UOperatingSystemBaseProgram > TestProgram) const
 Check if a program is running.
 
bool IsProgramRunning (const TSubclassOf< UOperatingSystemBaseProgram > TestProgramClass) const
 Checks if a program of the specified class is currently running.
 
UDraggableWindowCreateNewWindow (TWeakObjectPtr< UOperatingSystemBaseProgram > TargetProgram) const
 Creates a new window for the target program.
 
void BringWindowToFront (UDraggableWindow *TargetWindow)
 Bring the specified window to the front.
 
bool CreateProgramsFromRepository (const TSoftObjectPtr< UOperatingSystemProgramsCollection > &TargetRepository, const bool bIsInstalledWithOS)
 Create programs from a given repository.
 
void SetToInstallStartupPrograms (const bool bInstall)
 
bool ShouldInstallStartupPrograms () const
 
void SetDeviceName (const FText &NewName)
 
FText GetDeviceName () const
 
void SetAutoLogin (const bool bEnableAutoLogin)
 
bool CanAutoLogin () const
 
float GetInstallationTime () const
 
float GetLoadingTime () const
 
float GetInitialLoadingTime () const
 
const TArray< FOperatingSystemNotification > & GetNotifications () const
 
void ClearAllNotifications ()
 
OPERATINGSYSTEMSIMULATOR_API void ConsumeSpaceInMB (const float &NewSizeInMB, UOperatingSystemPartition *Partition, FGenericError &OutError)
 
OPERATINGSYSTEMSIMULATOR_API void ConsumeSpaceInGB (const float &NewSizeInGB, UOperatingSystemPartition *Partition, FGenericError &OutError)
 
OPERATINGSYSTEMSIMULATOR_API FText GetSizeAsText (const EOperatingSystemSizeMethod SizeMethod, const UOperatingSystemPartition *Partition, FGenericError &OutError) const
 
OPERATINGSYSTEMSIMULATOR_API float GetStoragePercentage (const UOperatingSystemPartition *Partition, FGenericError &OutError) const
 
OPERATINGSYSTEMSIMULATOR_API double GetHardDiskSize (FGenericError &OutError, const EOperatingSystemSizeMethod SizeMethod=EOperatingSystemSizeMethod::GB) const
 
void UninstallProgram (const FName &ProgramIdentifier, FGenericError &OutErrorIfAny)
 
void UninstallProgramByClass (const TSoftClassPtr< UOperatingSystemBaseProgram > ProgramClass, FGenericError &OutErrorIfAny)
 
UOperatingSystemBaseProgramInstallProgramFromPackage (const FName &ProgramIdentifier, FGenericError &OutErrorIfAny)
 
UOperatingSystemBaseProgramInstallProgramFromClass (FGenericError &OutErrorIfAny, const TSoftClassPtr< UOperatingSystemBaseProgram > ProgramClass, UOperatingSystemPartition *TargetPartition=nullptr)
 
void BeginInstallation (UOperatingSystemPartition *TargetPartition, FGenericError &OutError)
 
UOperatingSystemPartitionAllocatePartition (const double SizeInBytes, FGenericError &OutError)
 
void RemovePartition (UOperatingSystemPartition *PartitionToDelete, FGenericError &OutError)
 
void RefreshPartitions ()
 
void InstallationCompleted (const bool bSwitchToDesktop=true)
 
bool CreateNewUser (const FOperatingSystemUser &NewUser, const bool bSetAsActive=false)
 
bool LoginUser (const FText &Username, const FText &Password)
 
bool UpdateCurrentUserDetails (const FOperatingSystemUser &UpdatedDetails)
 
bool HasEnoughSpace (const double &TestSizeInBytes, const UOperatingSystemPartition *InPartition) const
 
TArray< UOperatingSystemPartition * > GetDiskPartitions () const
 
UOperatingSystemPartitionGetOperatingSystemPartition () const
 
void CloseProgram (UOperatingSystemBaseProgram *TargetProgram, FGenericError &OutError)
 
bool BringBackgroundProgramToFront (UOperatingSystemBaseProgram *TargetProgram)
 
bool IsProgramInBackground (UOperatingSystemBaseProgram *TestProgram) const
 
void MinimizeProgram (UOperatingSystemBaseProgram *TargetProgram)
 
void CloseAllRunningPrograms ()
 
void RestoreMinimizedProgram (const UOperatingSystemBaseProgram *TargetProgram)
 Restores a minimized program to the foreground on the operating system's taskbar.
 
UObject * GetDirectoryIconObject (const FGameplayTag &TestTag) const
 
bool IsUnix () const
 
float GetBsodOnScreenTime () const
 
float GetToastNotificationDisplayTime () const
 
TArray< UOperatingSystemBaseProgram * > GetInstalledPrograms () const
 
void GetInstalledProgramsMap (TMap< FName, UOperatingSystemBaseProgram * > &OutInstalledPrograms)
 
UOperatingSystemBaseProgramGetInstalledProgram (const TSoftClassPtr< UOperatingSystemBaseProgram > TestClass) const
 
bool IsProgramInstalled (const TSoftClassPtr< UOperatingSystemBaseProgram > TestClass) const
 
UOperatingSystemBaseProgramGetRunningProgram (const TSoftClassPtr< UOperatingSystemBaseProgram > TestClass) const
 
bool IsPreInstalledOperatingSystem () const
 
UOperatingSystemSettingsDataGetSettings () const
 
bool IsRunningOnPortableDevice () const
 
virtual TOptional< FText > GetRootCommand () const
 Retrieves the root command associated with the operating system.
 
virtual TOptional< FOperatingSystemUserGetRootUser () const
 Returns the root user of the operating system. This method retrieves the root user of the operating system and returns it as an optional object. If the root user cannot be determined or is not available, an empty optional object is returned.
 
bool HasValidRootCommandAndUser () const
 Determines whether the root command and user are valid.
 
bool IsShuttingDown () const
 Check if the operating system is in the process of shutting down.
 
bool IsRestarting () const
 Checks if the operating system is currently restarting.
 
TArray< FOperatingSystemUserGetAllUsers () const
 Returns an array of all users registered in the operating system. This function retrieves information about all users registered in the operating system.
 

Protected Member Functions

virtual void FinalizePreInstallation (FGenericError &OutError) override
 
virtual void PrepareOperatingSystemInstallImpl (FGenericError &OutError) override
 Finalizes the pre-installation process of the operating system for non-unix systems.
 
virtual bool StartOperatingSystemImpl (FGenericError &OutError) override
 Starts the operating system for non-unix systems. This method sets the disk letter for each disk partition.
 
virtual void PostLoadOperatingSystemImpl (FGenericError &OutError) override
 Performs post-loading operations for the operating system in non-Unix systems.
 
virtual void OnPartitionLoaded (UOperatingSystemPartition &LoadedPartition, const FOperatingSystemPartitionSaveLoad &SaveLoadData) override
 This method is called when a partition is loaded. This method sets the disk letter for the loaded partition, using the disk letter from the SaveLoadData if it is not empty, or the first disk letter found if it is empty.
 
virtual UOperatingSystemPartitionFindPartitionFromLetter (const FName &TargetDiskLetter) const override final
 Finds a partition on the non-Unix operating system that matches the given disk letter. This function searches for a partition in the list of disk partitions that has the specified disk letter.
 
FName FindDiskLetterAtIndex (const int32 &AtIndex) const
 
- Protected Member Functions inherited from UOperatingSystem
virtual OPERATINGSYSTEMSIMULATOR_API void OnShowNotification (const FOperatingSystemNotification &NewNotification)
 This method is called when a new notification should be shown on the operating system.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnAllOnNotificationsCleared ()
 Callback triggered when all notifications are cleared.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnValidate (FGenericError &OutError) const
 This method is called to validate the object's state. This method should be overridden by derived classes to provide specific validation logic for the object. The validation result should be stored in the OutError parameter. If there are any validation errors, they should be added to the OutError object using its MAKE_ERROR macro.
 
virtual OPERATINGSYSTEMSIMULATOR_API void FinishInstallationImpl ()
 Performs the finishing steps of the installation process.
 
virtual OPERATINGSYSTEMSIMULATOR_API void InstallStartupProgramsImpl ()
 Allows the derived classes to implement their own logic for installing startup programs. This method should be overridden in derived classes to define the actual logic for installing startup programs.
 
virtual OPERATINGSYSTEMSIMULATOR_API TSoftClassPtr< UOperatingSystemBaseProgramFindProgramFromPackage (const FName &ProgramIdentifier)
 Finds the program corresponding to the given package identifier. This method searches for a program based on the provided package identifier.
 
bool K2_CanStartOperatingSystem (FGenericError &ReturnError)
 Determines if the operating system can start.
 

Additional Inherited Members

- Static Public Member Functions inherited from UOperatingSystem
static FName GetOperatingSystemProgramRestoredEventName ()
 
static UE_NODISCARD UOperatingSystemCreateOperatingSystem (UOperatingSystemBaseDevice *OwningDevice, FGenericError &OutError)
 Creates a new instance of the operating system associated with the specified device.
 
static UE_NODISCARD FString GetOperatingSystemUniqueID (const UOperatingSystem *TestOperatingSystem)
 Gets the unique ID of the operating system. This method retrieves the unique ID of the operating system represented by the given TestOperatingSystem object.
 
- Public Attributes inherited from UOperatingSystem
FOperatingSystemProgramDelegate OnProgramStarted
 Delegate representing the event when a program starts in the operating system.
 
FOperatingSystemProgramDelegate OnProgramClosed
 Delegate for handling the program closed event.
 
FOperatingSystemProgramDelegate OnProgramInstalled
 Delegate representing the event when a program is installed in the operating system.
 
FOperatingSystemProgramDelegate OnProgramUninstalled
 
- Protected Attributes inherited from UOperatingSystem
FTimerHandle TimerHandle_OperatingSystemInstallation
 
FTimerHandle TimerHandle_LoadingTime
 
FText Name
 
FText CompanyName
 
FOperatingSystemVersion Version
 
TSoftObjectPtr< UObject > Icon
 
TMap< FGameplayTag, TSoftObjectPtr< UObject > > DirectoryIcons
 
float InstallationSpace
 
FGameplayTagContainer SupportedDevices
 
TSoftObjectPtr< UOperatingSystemProgramsCollectionMustHavePrograms
 
TSoftObjectPtr< UOperatingSystemProgramsCollectionPostInstallStartupPrograms
 
TSoftObjectPtr< UOperatingSystemDirectoriesCollectionDefaultDirectories
 
TSoftClassPtr< UOperatingSystemSettingsDataSettingsDataClass
 
TSoftClassPtr< UOperatingSystemWidgetWidgetClass
 
TSoftClassPtr< UOperatingSystemBsodWidgetBsodWidgetClass
 
FOperatingSystemNotificationSettings NotificationSettings
 
FOperatingSystemRangeTime InstallationTime
 
FOperatingSystemRangeTime LoadingTime
 
FOperatingSystemRangeTime LoadingTimeInitial
 
FOperatingSystemRangeTime LogonToDesktopTime
 
FOperatingSystemRangeTime BsodOnScreenTime
 
FGameplayTag OperatingSystemTag
 
TWeakObjectPtr< UOperatingSystemBaseDeviceParentDevice
 
TObjectPtr< UOperatingSystemSettingsDataOperatingSystemSettingsData
 
TObjectPtr< UOperatingSystemWidgetOperatingSystemWidget
 
TMap< int32, TObjectPtr< UOperatingSystemBaseProgram > > RunningPrograms
 
TMap< int32, TObjectPtr< UOperatingSystemBaseProgram > > BackgroundRunningPrograms
 
TMap< FName, UOperatingSystemBaseProgram * > InstalledPrograms
 
FOperatingSystemUser CurrentUser
 
uint8 bIsStartingForTheFirstTime: 1
 
int32 TotalNotifications
 
int32 TotalErrorNotifications
 
int32 TotalWarningNotifications
 
TObjectPtr< UOperatingSystemBsodWidgetBSODWidget
 
TMap< int32, TWeakObjectPtr< UOperatingSystemTaskbarButton > > TaskbarButtons
 Transient variable representing the taskbar buttons. It is a TMap that associates integer keys with weak object pointers to UOperatingSystemTaskbarButton objects. Key will be the process ID. Value will be the program.
 
FOperatingSystemUniqueId TargetPartitionID
 Structure representing a unique identifier for a target partition in the operating system.
 
TWeakObjectPtr< UDraggableWindowLastBroughtToFrontWindow
 Transient variable representing the last draggable window brought to the front.
 
uint8 bAutoLogin: 1
 
uint8 bInstallStartupPrograms: 1
 Specifies whether to install startup programs on the operating system.
 
FText DeviceName
 

Detailed Description

This class represents a non-unix operating system. It inherits from UOperatingSystem and provides additional functionality specific to non-unix systems.

Constructor & Destructor Documentation

◆ UOperatingSystemNonUnix()

UOperatingSystemNonUnix::UOperatingSystemNonUnix ( )

Member Function Documentation

◆ CreateDirectoryInPath()

UOperatingSystemDirectory * UOperatingSystemNonUnix::CreateDirectoryInPath ( const FString & TargetPath,
const FString & DirectoryName,
TSoftClassPtr< UOperatingSystemDirectory > DirectoryClass,
UOperatingSystemPartition * TargetPartition,
const bool bIsFromSaveGame,
FGenericError & OutError )
overridevirtual

Creates a directory in the specified path.

Parameters
TargetPathThe target path where the directory will be created.
DirectoryNameThe name of the directory to create.
DirectoryClassThe class of the directory to be created.
TargetPartitionThe target partition where the directory will be created.
bIsFromSaveGameIndicates if the directory is created from a save game.
OutErrorAn output parameter to store any errors that occur during the creation of the directory.
Returns
A pointer to the created directory, or nullptr if the directory creation fails.

Reimplemented from UOperatingSystem.

Here is the call graph for this function:

◆ FinalizePreInstallation()

void UOperatingSystemNonUnix::FinalizePreInstallation ( FGenericError & OutError)
overrideprotectedvirtual

Finalizes the pre-installation process of the operating system for non-unix systems.

This method performs the following steps:

  1. Retrieves the hard disk for the operating system.
  2. Allocates a new partition on the hard disk.
  3. Begins the installation process on the new partition.
  4. Clears the installation timer.
  5. Finishes the installation process.
Parameters
OutError[in,out] The output parameter to store any errors that occur during the finalization process.

Reimplemented from UOperatingSystem.

Here is the call graph for this function:

◆ FindDiskLetterAtIndex()

FName UOperatingSystemNonUnix::FindDiskLetterAtIndex ( const int32 & AtIndex) const
protected

FindDiskLetterAtIndex method returns the disk letter at the specified index.

Parameters
AtIndex- The index of the disk letter to find.
Returns
The disk letter at the specified index, or NAME_None if the index is invalid.
Here is the caller graph for this function:

◆ FindPartitionFromLetter()

UOperatingSystemPartition * UOperatingSystemNonUnix::FindPartitionFromLetter ( const FName & TargetDiskLetter) const
finaloverrideprotectedvirtual

Finds a partition on the non-Unix operating system that matches the given disk letter. This function searches for a partition in the list of disk partitions that has the specified disk letter.

Parameters
TargetDiskLetterThe disk letter to search for.
Returns
A pointer to the UOperatingSystemPartition object representing the partition if found, nullptr otherwise.

Reimplemented from UOperatingSystem.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPartitionLoaded()

void UOperatingSystemNonUnix::OnPartitionLoaded ( UOperatingSystemPartition & LoadedPartition,
const FOperatingSystemPartitionSaveLoad & SaveLoadData )
overrideprotectedvirtual

This method is called when a partition is loaded. This method sets the disk letter for the loaded partition, using the disk letter from the SaveLoadData if it is not empty, or the first disk letter found if it is empty.

Parameters
LoadedPartitionThe partition that is loaded.
SaveLoadDataThe data used to load the partition.

Reimplemented from UOperatingSystem.

Here is the call graph for this function:

◆ PostLoadOperatingSystemImpl()

void UOperatingSystemNonUnix::PostLoadOperatingSystemImpl ( FGenericError & OutError)
overrideprotectedvirtual

Performs post-loading operations for the operating system in non-Unix systems.

This method is called after the operating system is loaded in non-Unix systems. It performs the necessary post-loading tasks based on the current state of the system.

Parameters
OutError[out] An output parameter to store any errors that occur during the post-loading process.

Reimplemented from UOperatingSystem.

◆ PrepareOperatingSystemInstallImpl()

void UOperatingSystemNonUnix::PrepareOperatingSystemInstallImpl ( FGenericError & OutError)
overrideprotectedvirtual

Finalizes the pre-installation process of the operating system for non-unix systems.

This method retrieves the hard disk for the operating system, allocates a new partition on the hard disk, begins the installation process on the new partition, clears the installation timer, and finishes the installation process.

Parameters
OutError[out] The output parameter to store any errors that occur during the finalization process.

Reimplemented from UOperatingSystem.

Here is the call graph for this function:

◆ StartOperatingSystemImpl()

bool UOperatingSystemNonUnix::StartOperatingSystemImpl ( FGenericError & OutError)
overrideprotectedvirtual

Starts the operating system for non-unix systems. This method sets the disk letter for each disk partition.

Parameters
OutErrorThe output parameter to store any errors that occur during the startup process.
Returns
Returns true if the operating system starts successfully, false otherwise.

Reimplemented from UOperatingSystem.

Here is the call graph for this function:

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