UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FProgressCancel Class Reference

#include <ProgressCancel.h>

Classes

struct  FMessageInfo
 
class  FProgressScope
 

Public Types

enum class  EMessageLevel {
  Internal = 0 , UserMessage = 1 , UserNotification = 2 , UserWarning = 3 ,
  UserError = 4
}
 

Public Member Functions

void SetMaxMessageDepth (int32 ScopeDepth)
 
void ClearMaxMessageDepth ()
 
bool Cancelled ()
 
float GetProgress () const
 
FText GetProgressMessage () const
 
void SetProgressMessage (const FText &Message)
 
void AdvanceCurrentScopeProgressBy (float Amount)
 
void AdvanceCurrentScopeProgressToward (float TargetProgressFrac, float FractionToward)
 
float GetCurrentScopeProgress ()
 
float GetCurrentScopeDistanceTo (float TargetProgressFrac)
 
void SetCurrentScopeProgressTo (float NewProgressFrac)
 
void AddWarning (const FText &MessageText, EMessageLevel MessageLevel)
 

Static Public Member Functions

static GEOMETRYCORE_API FProgressScope CreateScopeTo (FProgressCancel *ProgressCancel, float ProgressTo, const FText &Message=FText())
 

Public Attributes

TFunction< bool()> CancelF = []() { return false; }
 
TArray< FMessageInfoWarnings
 

Friends

class FProgressScope
 

Detailed Description

FProgressCancel is intended to be passed to long-running computes to do two things: 1) provide progress info back to caller 2) allow caller to cancel the computation

Member Enumeration Documentation

◆ EMessageLevel

Enumerator
Internal 

Development message goes into development log

UserMessage 

User message should appear in user-facing log

UserNotification 

Notification message should be shown in a non-modal notification window

UserWarning 

Warning message should be shown in a non-modal notification window with panache

UserError 

Error message should be shown in a modal notification window

Member Function Documentation

◆ AddWarning()

void FProgressCancel::AddWarning ( const FText MessageText,
EMessageLevel  MessageLevel 
)
inline

◆ AdvanceCurrentScopeProgressBy()

void FProgressCancel::AdvanceCurrentScopeProgressBy ( float  Amount)
inline
Parameters
AmountAmount to increase the progress fraction, as a fraction of the current active progress range

◆ AdvanceCurrentScopeProgressToward()

void FProgressCancel::AdvanceCurrentScopeProgressToward ( float  TargetProgressFrac,
float  FractionToward 
)
inline

Advance current progress a fraction of the way toward a target value For example: if progress is .5, AdvanceProgressToward(1, .5) will take a half step to 1 and set progress to .75 As with all public progress function, progress is expressed relative to the current active progress range and cannot go backward.

◆ Cancelled()

bool FProgressCancel::Cancelled ( )
inline
Returns
true if client would like to cancel operation

◆ ClearMaxMessageDepth()

void FProgressCancel::ClearMaxMessageDepth ( )
inline

◆ CreateScopeTo()

FProgressCancel::FProgressScope FProgressCancel::CreateScopeTo ( FProgressCancel ProgressCancel,
float  ProgressTo,
const FText Message = FText() 
)
static
Parameters
ProgressCancelProgress will be tracked on this. If null, the FProgressScope will do nothing.
ProgressToTarget value to increase progress to w/in this scope (as a fraction of the current outer-scope active progress range)
MessageOptional message describing the work to be done
Returns
A new FProgressScope that covers work from the current progress to the target progress value (relative to the current scope)

◆ GetCurrentScopeDistanceTo()

float FProgressCancel::GetCurrentScopeDistanceTo ( float  TargetProgressFrac)
inline
Parameters
TargetProgressFracTarget progress value as a fraction of the current scope's active progress range
Returns
Amount to progress in the current scope to reach the target progress value

◆ GetCurrentScopeProgress()

float FProgressCancel::GetCurrentScopeProgress ( )
inline
Returns
Progress as a fraction of the current scope's active progress range

◆ GetProgress()

float FProgressCancel::GetProgress ( ) const
inline

◆ GetProgressMessage()

FText FProgressCancel::GetProgressMessage ( ) const
inline

◆ SetCurrentScopeProgressTo()

void FProgressCancel::SetCurrentScopeProgressTo ( float  NewProgressFrac)
inline

Note: This function will leave the current progress unchanged if the target value is less than the current progress – it will not allow the progress value to go backward.

Parameters
ProgressFracValue to set current progress to, as a fraction of the current active progress range

◆ SetMaxMessageDepth()

void FProgressCancel::SetMaxMessageDepth ( int32  ScopeDepth)
inline

◆ SetProgressMessage()

void FProgressCancel::SetProgressMessage ( const FText Message)
inline

Friends And Related Symbol Documentation

◆ FProgressScope

friend class FProgressScope
friend

Member Data Documentation

◆ CancelF

TFunction<bool()> FProgressCancel::CancelF = []() { return false; }

◆ Warnings

TArray<FMessageInfo> FProgressCancel::Warnings

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