UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ApplicationLifecycleComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2// ApplicationLifecycleComponent.: See FCoreDelegates for details
3
4#pragma once
5
6#include "CoreMinimal.h"
10#include "ApplicationLifecycleComponent.generated.h"
11
12// A parallel enum to the temperature change severity enum in CoreDelegates
13// Note if you change this, then you must change the one in CoreDelegates
14UENUM(BlueprintType)
16{
17 Unknown,
18 Good,
19 Bad,
20 Serious,
22
24};
25static_assert((int)ETemperatureSeverityType::NumSeverities == (int)FCoreDelegates::ETemperatureSeverity::NumSeverities, "TemperatureSeverity enums are out of sync");
26
28UCLASS(ClassGroup=Utility, HideCategories=(Activation, "Components|Activation", Collision), meta=(BlueprintSpawnableComponent), MinimalAPI)
30{
32
36
37 // This is called when the application is about to be deactivated (e.g., due to a phone call or SMS or the sleep button).
38 // The game should be paused if possible, etc...
39 UPROPERTY(BlueprintAssignable)
40 FApplicationLifetimeDelegate ApplicationWillDeactivateDelegate;
41
42 // Called when the application has been reactivated (reverse any processing done in the Deactivate delegate)
43 UPROPERTY(BlueprintAssignable)
44 FApplicationLifetimeDelegate ApplicationHasReactivatedDelegate;
45
46 // This is called when the application is being backgrounded (e.g., due to switching
47 // to another app or closing it via the home button)
48 // The game should release shared resources, save state, etc..., since it can be
49 // terminated from the background state without any further warning.
50 UPROPERTY(BlueprintAssignable)
51 FApplicationLifetimeDelegate ApplicationWillEnterBackgroundDelegate; // for instance, hitting the home button
52
53 // Called when the application is returning to the foreground (reverse any processing done in the EnterBackground delegate)
54 UPROPERTY(BlueprintAssignable)
55 FApplicationLifetimeDelegate ApplicationHasEnteredForegroundDelegate;
56
57 // This *may* be called when the application is getting terminated by the OS.
58 // There is no guarantee that this will ever be called on a mobile device,
59 // save state when ApplicationWillEnterBackgroundDelegate is called instead.
60 UPROPERTY(BlueprintAssignable)
61 FApplicationLifetimeDelegate ApplicationWillTerminateDelegate;
62
63 // Called when the OS is running low on resources and asks the application to free up any cached resources, drop graphics quality etc.
64 UPROPERTY(BlueprintAssignable)
65 FApplicationLifetimeDelegate ApplicationShouldUnloadResourcesDelegate;
66
68
69 // Called with arguments passed to the application on statup, perhaps meta data passed on by another application which launched this one.
70 UPROPERTY(BlueprintAssignable)
71 FApplicationStartupArgumentsDelegate ApplicationReceivedStartupArgumentsDelegate;
72
73 // Called when temperature level has changed, and receives the severity
74 UPROPERTY(BlueprintAssignable)
76
77 // Called when we are in low power mode
78 UPROPERTY(BlueprintAssignable)
80
81public:
82 ENGINE_API void OnRegister() override;
83 ENGINE_API void OnUnregister() override;
84
87 void ApplicationWillDeactivateDelegate_Handler() { ApplicationWillDeactivateDelegate.Broadcast(); }
88 void ApplicationHasReactivatedDelegate_Handler() { ApplicationHasReactivatedDelegate.Broadcast(); }
89 void ApplicationWillEnterBackgroundDelegate_Handler() { ApplicationWillEnterBackgroundDelegate.Broadcast(); }
90 void ApplicationHasEnteredForegroundDelegate_Handler() { ApplicationHasEnteredForegroundDelegate.Broadcast(); }
91 void ApplicationWillTerminateDelegate_Handler() { ApplicationWillTerminateDelegate.Broadcast(); }
92 void ApplicationShouldUnloadResourcesDelegate_Handler() { ApplicationShouldUnloadResourcesDelegate.Broadcast(); }
93 void ApplicationReceivedStartupArgumentsDelegate_Handler(const TArray<FString>& StartupArguments) { ApplicationReceivedStartupArgumentsDelegate.Broadcast(StartupArguments); }
96};
97
98
99
ETemperatureSeverityType
Definition ApplicationLifecycleComponent.h:16
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE(DelegateName)
Definition DelegateCombinations.h:38
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type, Param1Name)
Definition DelegateCombinations.h:53
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
uint8_t uint8
Definition binka_ue_file_header.h:8
ETemperatureSeverity
Definition CoreDelegates.h:280
Definition Array.h:670
Definition ActorComponent.h:152
int
Definition TestServer.py:515