UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NotificationManager.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "SlateFwd.h"
8#include "Layout/SlateRect.h"
9#include "Widgets/SWindow.h"
10
11#include "HAL/IConsoleManager.h"
13
15
16template <class T> class TLockFreePointerListLIFO;
17
23{
25
29
30 void Reset() { Id = INDEX_NONE; }
31 bool IsValid() const { return Id != INDEX_NONE; }
32
34 {
35 return Id == OtherHandle.Id;
36 }
37private:
39 : Id(InId)
40 {}
41
42 int32 Id;
43};
44
77{
78 friend class SNotificationList;
79
80public:
85
87 SLATE_API void Tick();
88
91
97
103
113
123
128
134
142
148
156 {
157 this->bAllowNotifications = bShouldAllow;
158 }
159
166 {
167 return this->bAllowNotifications;
168 }
169
174
179
180protected:
183
186
189
190private:
191
193 struct FRegionalNotificationList
194 {
196 FRegionalNotificationList(const FSlateRect& InRectangle);
197
199 void Arrange();
200
202 void RemoveDeadNotifications();
203
206
208 FSlateRect Region;
209 };
210
212 IProgressNotificationHandler* ProgressNotificationHandler = nullptr;
213
215 TWeakPtr<SWindow> RootWindowPtr;
216
219
222
225
227 FCriticalSection StagedNotificationCS;
228
230 static SLATE_API int32 ProgressHandleCounter;
231
233 bool bAllowNotifications = true;
234
236 FAutoConsoleVariableRef CVarAllowNotifications;
237
238 // On Linux there is a hack in SDL to already delayed the showing of notification that is not interacting well with this optimization.
239 static constexpr bool bShowNotificationImmediately = PLATFORM_LINUX;
240};
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define PLATFORM_LINUX
Definition Platform.h:52
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
Definition IConsoleManager.h:1580
Definition NotificationManager.h:77
SLATE_API void UnregisterStagedNotification(TSharedPtr< IAsyncTaskNotificationImpl > InNotification)
Definition NotificationManager.cpp:384
SLATE_API void ForceNotificationsInFront(const TSharedRef< SWindow > InWindow)
Definition NotificationManager.cpp:347
bool AreNotificationsAllowed() const
Definition NotificationManager.h:165
SLATE_API TSharedPtr< SNotificationItem > AddNotification(const FNotificationInfo &Info)
Definition NotificationManager.cpp:219
SLATE_API void QueueNotification(FNotificationInfo *Info)
Definition NotificationManager.cpp:249
SLATE_API FSlateNotificationManager()
Definition NotificationManager.cpp:105
SLATE_API void CancelProgressNotification(FProgressNotificationHandle InHandle)
Definition NotificationManager.cpp:275
SLATE_API FProgressNotificationHandle StartProgressNotification(FText DisplayText, int32 TotalWorkToDo)
Definition NotificationManager.cpp:254
SLATE_API void ShutdownOnPreExit()
Definition NotificationManager.cpp:113
SLATE_API void SetRootWindow(const TSharedRef< SWindow > InRootWindow)
Definition NotificationManager.cpp:124
SLATE_API void RegisterStagedNotification(TSharedPtr< IAsyncTaskNotificationImpl > InNotification)
Definition NotificationManager.cpp:377
void SetAllowNotifications(const bool bShouldAllow)
Definition NotificationManager.h:155
SLATE_API void UpdateProgressNotification(FProgressNotificationHandle InHandle, int32 TotalWorkDone, int32 UpdatedTotalWorkToDo=0, FText UpdatedDisplayText=FText::GetEmpty())
Definition NotificationManager.cpp:267
SLATE_API void SetProgressNotificationHandler(IProgressNotificationHandler *NewHandler)
Definition NotificationManager.cpp:283
SLATE_API TSharedRef< SNotificationList > CreateStackForArea(const FSlateRect &InRectangle, TSharedPtr< SWindow > Window)
Definition NotificationManager.cpp:129
SLATE_API void Tick()
Definition NotificationManager.cpp:304
static SLATE_API FSlateNotificationManager & Get()
Definition NotificationManager.cpp:99
SLATE_API void GetWindows(TArray< TSharedRef< SWindow > > &OutWindows) const
Definition NotificationManager.cpp:289
Definition SlateRect.h:26
Definition Text.h:385
static CORE_API const FText & GetEmpty()
Definition Text.cpp:252
Definition NotificationManager.h:47
virtual void CancelProgressNotification(FProgressNotificationHandle Handle)=0
virtual void UpdateProgressNotification(FProgressNotificationHandle Handle, int32 TotalWorkDone, int32 UpdatedTotalWorkToDo, FText UpdatedDisplayText)=0
virtual void StartProgressNotification(FProgressNotificationHandle Handle, FText DisplayText, int32 TotalWorkToDo)=0
virtual ~IProgressNotificationHandler()
Definition NotificationManager.h:49
Definition SNotificationList.h:262
Definition Array.h:670
Definition LockFreeList.h:898
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition SNotificationList.h:128
Definition NotificationManager.h:23
bool IsValid() const
Definition NotificationManager.h:31
void Reset()
Definition NotificationManager.h:30
bool operator==(const FProgressNotificationHandle &OtherHandle) const
Definition NotificationManager.h:33
FProgressNotificationHandle()
Definition NotificationManager.h:26