InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IProgressBarManager Class Referenceabstract

#include <IProgressBarManager.h>

Inheritance diagram for IProgressBarManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPROGRESSBARMANAGER }
 
enum  ProgressType { kTaskProgress = 0x01, kRangeProgress = 0x02, kFoldupProgress = 0x04 }
 

Public Member Functions

virtual int32 RegisterTaskSet (int32 nType, const PMString &progressDialogTitle, int32 taskStart, int32 taskEnd, bool8 showImmediate=kFalse, bool8 showCancel=kTrue, IProgressBarControlData *customProgress=nil, bool32 useTwoBars=kFalse)=0
 
virtual void UnregisterTaskSet (int32 nBarID=-1)=0
 
virtual void DoTask (const PMString &displayText, int32 advanceNtasks=1, int32 nBarID=-1)=0
 
virtual void SetPosition (int32 newPosition, bool16 fParent=kFalse, int32 nBarID=-1)=0
 
virtual int32 GetPosition (bool16 fParent=kFalse, int32 nBarID=-1)=0
 
virtual void SetTaskText (const PMString &newText, bool16 forceRedraw=kTrue, int32 nBarID=-1)=0
 
virtual bool16 WasCancelled (bool8 setGlobalErrorState=kTrue)=0
 
virtual void Abort ()=0
 
virtual int32 GetNumTaskSets ()=0
 
virtual void GetTaskSetInfo (int32 taskSetIndex, int32 *outTaskStart, int32 *outTaskEnd=nil, int32 *outCurrentTask=nil, PMString *outCurrentSubTaskName=nil)=0
 
virtual void Cancel ()=0
 
virtual void DisableChildProgressBars (bool16 disable)=0
 
virtual bool16 SuppressProgressBarDisplay (bool16 suppressDisplay)=0
 
virtual bool16 IsDisplaySuppressed ()=0
 
virtual bool16 IsRegisterDisabled ()=0
 
virtual void SetTaskStatus (const PMString &statusText, bool16 forceRedraw=kTrue, int32 nBarID=-1)=0
 
virtual void SetTaskTitle (const PMString &strTitle, bool16 forceRedraw, int32 nBarID=-1)=0
 
virtual bool SkipCheckingForCancel (bool skip)=0
 
virtual void RegisterCloseNotifier (std::function< void()> callback)=0
 
virtual void ClearCloseNotifier ()=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This interface is used to manage progress bars. Although it can be used directly, most client code uses the helper classes RangeProgressBar and TaskProgressBar found in ProgressBar.h

Member Enumeration Documentation

Progress bar type

Member Function Documentation

virtual void IProgressBarManager::Abort ()
pure virtual

Call this anytime during the tasks to immediately terminate the entire progress bar process. Usually called when an error condition is encountered during one of the sub tasks.

virtual void IProgressBarManager::Cancel ()
pure virtual

This is called by the Cancel button and should not be called by users. Use Abort() instead.

virtual void IProgressBarManager::DisableChildProgressBars (bool16 disable)
pure virtual

Disabling child progress bars will keep any subsequent progress bars from registering, so they cannot subdivide your tasks and they cannot be cancelled.

Parameters
disablekTrue to disable child progress bars, kFalse to enable child progress bars
virtual void IProgressBarManager::DoTask (const PMStringdisplayText,
int32 advanceNtasks = 1,
int32 nBarID = -1 
)
pure virtual

Call this before processing a task. This is usually used to move the progress bar one task at a time, however, you can move more by passing in a value to advanceNtasks.

Parameters
displayTextText for the current task to be displayed in ProgressBar
advanceNtasksnumber of tasks to advance. Default is to advance 1 task
nBarIDidentifier of a particular task set
virtual int32 IProgressBarManager::GetNumTaskSets ()
pure virtual

Returns the number of currently registered task sets

virtual int32 IProgressBarManager::GetPosition (bool16 fParent = kFalse,
int32 nBarID = -1 
)
pure virtual

Gets the absolute position of the progress bar.

Parameters
fParentgets value of previously registered task set instead of the current task set, ignored if nBarID != -1
nBarIDidentifier of a particular task set
Returns
int32 returns current position for progress bar requested
virtual void IProgressBarManager::GetTaskSetInfo (int32 taskSetIndex,
int32 * outTaskStart,
int32 * outTaskEnd = nil,
int32 * outCurrentTask = nil,
PMStringoutCurrentSubTaskName = nil 
)
pure virtual

Get Info about a task set

Parameters
taskSetIndexindex of the task set in question
outTaskStarton return, this is filled with the start value for the task set
outTaskEndon return, this is filled with the end value for the task set
outCurrentTaskon return, this is filled with the current value for the task set
outCurrentSubTaskNameon return, this is filled with the subtask name for the task set
virtual bool16 IProgressBarManager::IsDisplaySuppressed ()
pure virtual

Call this to see if the progress bar display is currently being suppressed.

virtual bool16 IProgressBarManager::IsRegisterDisabled ()
pure virtual

This is basically asking "If I register, will it be successful?" Register will fail if child progress bars are disabled via DisableChildProgressBars(), of if the progress bar is suppressed.

virtual void IProgressBarManager::RegisterCloseNotifier (std::function< void()> callback)
pure virtual

Registers a notifier which will be called when a progress bar is canceled

Parameters
callback
virtual int32 IProgressBarManager::RegisterTaskSet (int32 nType,
const PMStringprogressDialogTitle,
int32 taskStart,
int32 taskEnd,
bool8 showImmediate = kFalse,
bool8 showCancel = kTrue,
IProgressBarControlDatacustomProgress = nil,
bool32 useTwoBars = kFalse 
)
pure virtual

Registers a new task set. Multiple task sets can be registered at a time. Standard behavior is for second task set to subdivide first task set.

Parameters
nTypespecifies the type of progress bar, kTaskProgress, kRangeProgress or kFoldupProgress
progressDialogTitletitle of the progress bar dialog
taskStartstart value of the task
taskEndend value of the task
showImmediatekTrue to show progress bar immediately, kFalse to put it up after a short delay if the task is not finished
showCancelkTrue to show cancel button and allow task to be cancelled, kFalse to disallow cancel
customProgressIf you don't want to use the standard progress bar, you can provide your own progress bar widget that contains an IProgressBarControlData interface
useTwoBarskTrue to use 2 bars when multiple tasks are registered. kFalse to limit to 1 bar.
Returns
int32 task set identifier
virtual void IProgressBarManager::SetPosition (int32 newPosition,
bool16 fParent = kFalse,
int32 nBarID = -1 
)
pure virtual

Sets the absolute position of the progress bar, as opposed to DoTask, which moves the progress bar forward the specified amount. Position must be within range specified in the RegisterTaskSet.

Parameters
newPositionnew value for progress bar
fParentsets value of previously registered task set instead of the current task set, ignored if nBarID != -1
nBarIDidentifier of a particular task set
virtual void IProgressBarManager::SetTaskStatus (const PMStringstatusText,
bool16 forceRedraw = kTrue,
int32 nBarID = -1 
)
pure virtual

Sets the "status" text line.

Parameters
statusText
forceRedrawkTrue to force redraw of the status text
nBarIDidentifier of a particular task set
virtual void IProgressBarManager::SetTaskText (const PMStringnewText,
bool16 forceRedraw = kTrue,
int32 nBarID = -1 
)
pure virtual

Sets the task text of the progress bar.

Parameters
newTexttext for task
forceRedrawkTrue to forceRedraw of text
nBarIDidentifier of a particular task set
virtual void IProgressBarManager::SetTaskTitle (const PMStringstrTitle,
bool16 forceRedraw,
int32 nBarID = -1 
)
pure virtual

Sets the task title.

Parameters
strTitle
forceRedrawkTrue to force redraw of the task title
nBarIDidentifier of a particular task set
virtual bool IProgressBarManager::SkipCheckingForCancel (bool skip)
pure virtual

For internal use only

virtual bool16 IProgressBarManager::SuppressProgressBarDisplay (bool16 suppressDisplay)
pure virtual

Call this to suppress the display of the progress bar.

Parameters
suppressDisplaykTrue to suppress display of progress bar, kFalse to enable display of progress bar
Returns
bool16 kFalse if a progress bar already is shown, since it will not suppress display if the progress bar is already displayed
virtual void IProgressBarManager::UnregisterTaskSet (int32 nBarID = -1)
pure virtual

Unregisters the specified task set, or the current task set.

Parameters
nBarIDif specified, identifies the task set to unregister. If not specified, current task set is unregistered
virtual bool16 IProgressBarManager::WasCancelled (bool8 setGlobalErrorState = kTrue)
pure virtual

Check this to see if the user cancelled the action.

Parameters
setGlobalErrorStateif kTrue, sets the global error state to kCancel if progress was cancelled
Returns
bool16 kTrue if progress bar was cancelled