InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TaskProgressInfo Class Reference

#include <TaskInfo.h>

Classes

struct  ProgressData
 

Public Types

typedef std::pair< uint32, uint32 > ProgressRange
 

Public Member Functions

bool GetCurrentData (ProgressData &data) const
 
PMString GetTaskStatusText () const
 
ProgressRange GetRange () const
 
uint32 GetCurrentPosition () const
 
PMReal GetTaskCompletionPercentage () const
 

Friends

class IDTaskAccessor
 

Detailed Description

This class is used to track the progress of background tasks. Each top level task registers with the TaskMonitor which will hold a pointer to that task info. A client can obtain a TaskInfo from the TaskMonitor, store it and poll it for status and progress information. Not all tasks have progress information but all should have a name and should support cancellation.

Member Typedef Documentation

typedef std::pair<uint32, uint32> TaskProgressInfo::ProgressRange

A simple range for position based progress tracking

Member Function Documentation

bool TaskProgressInfo::GetCurrentData (ProgressDatadata) const

Retrieves a snapshot of all progress data.

Parameters
[out]dataCurrent data. Only filled when the return value is true.
Returns
[false] if this task doesn't have a progress bar associated with it (its duration is indeterminate) [true] if the task has progress information. If the return value is [false] the data parameter is unchanged.
Note
{ NOTE: a task may return false if called early on startup when the task did not initialize any progress bars but return true later. }
uint32 TaskProgressInfo::GetCurrentPosition () const
inline

Get the current position within the active range

Returns
the current position.
ProgressRange TaskProgressInfo::GetRange (void ) const
inline

Get the current range for progress information

Returns
the current ProgressRange.
PMReal TaskProgressInfo::GetTaskCompletionPercentage () const
inline

Get the current completion percentage.

Returns
the completion percentage.
PMString TaskProgressInfo::GetTaskStatusText () const
inline

Get the status text

Returns
a PMString containing the current status text.