Plasma Engine  2.0
Loading...
Searching...
No Matches
plProgress Class Reference

Manages the way a progress bar is subdivided and advanced. More...

#include <Progress.h>

Public Member Functions

float GetCompletion () const
 Returns the current overall progress in [0; 1] range.
 
void SetCompletion (float fCompletion)
 Sets the current overall progress in [0; 1] range. Should not be called directly, typically called by plProgreesRange.
 
plStringView GetMainDisplayText () const
 Returns the current 'headline' text for the progress bar.
 
plStringView GetStepDisplayText () const
 Returns the current detail text for the progress bar.
 
void UserClickedCancel ()
 Used to inform plProgress of outside user input. May have an effect or not.
 
bool WasCanceled () const
 Whether the user requested to cancel the operation.
 
bool AllowUserCancel () const
 Returns whether the current operations may be canceled or not.
 

Static Public Member Functions

static plProgressGetGlobalProgressbar ()
 Returns the currently set default plProgress instance. This will always be valid.
 
static void SetGlobalProgressbar (plProgress *pProgress)
 Allows to set a custom plProgress instance as the global default instance.
 

Public Attributes

plEvent< const plProgressEvent & > m_Events
 Events are sent when the progress changes.
 
void * m_pUserData = nullptr
 Custom user data.
 

Friends

class plProgressRange
 

Detailed Description

Manages the way a progress bar is subdivided and advanced.

plProgress represents a single progress bar. It can be sub-divided into groups and sub-groups using plProgressbarRange. From the ranges and the current advancement, a final progress percentage is computed. Every time a significant change takes place, an event is broadcast. This allows other code to display the progress, either in a GUI application or in a fullscreen loading screen or in any other way appropriate.


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