#include <IProgressBarManager.h>
|
| enum | { kDefaultIID = IID_IPROGRESSBARMANAGER } |
| |
| enum | ProgressType { kTaskProgress = 0x01, kRangeProgress = 0x02, kFoldupProgress = 0x04 } |
| |
|
| 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 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
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
| 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
| disable | kTrue to disable child progress bars, kFalse to enable child progress bars |
| virtual void IProgressBarManager::DoTask | ( | const PMString & | displayText, | | | 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
| displayText | Text for the current task to be displayed in ProgressBar |
| advanceNtasks | number of tasks to advance. Default is to advance 1 task |
| nBarID | identifier 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
| fParent | gets value of previously registered task set instead of the current task set, ignored if nBarID != -1 |
| nBarID | identifier 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, | | | PMString * | outCurrentSubTaskName = nil | | ) | | |
| pure virtual |
Get Info about a task set
- Parameters
| taskSetIndex | index of the task set in question |
| outTaskStart | on return, this is filled with the start value for the task set |
| outTaskEnd | on return, this is filled with the end value for the task set |
| outCurrentTask | on return, this is filled with the current value for the task set |
| outCurrentSubTaskName | on 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
| virtual int32 IProgressBarManager::RegisterTaskSet | ( | int32 | nType, | | | const PMString & | progressDialogTitle, | | | int32 | taskStart, | | | int32 | taskEnd, | | | bool8 | showImmediate = kFalse, | | | bool8 | showCancel = kTrue, | | | IProgressBarControlData * | customProgress = 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
| nType | specifies the type of progress bar, kTaskProgress, kRangeProgress or kFoldupProgress |
| progressDialogTitle | title of the progress bar dialog |
| taskStart | start value of the task |
| taskEnd | end value of the task |
| showImmediate | kTrue to show progress bar immediately, kFalse to put it up after a short delay if the task is not finished |
| showCancel | kTrue to show cancel button and allow task to be cancelled, kFalse to disallow cancel |
| customProgress | If you don't want to use the standard progress bar, you can provide your own progress bar widget that contains an IProgressBarControlData interface |
| useTwoBars | kTrue 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
| newPosition | new value for progress bar |
| fParent | sets value of previously registered task set instead of the current task set, ignored if nBarID != -1 |
| nBarID | identifier of a particular task set |
| virtual void IProgressBarManager::SetTaskStatus | ( | const PMString & | statusText, | | | bool16 | forceRedraw = kTrue, | | | int32 | nBarID = -1 | | ) | | |
| pure virtual |
Sets the "status" text line.
- Parameters
| statusText | |
| forceRedraw | kTrue to force redraw of the status text |
| nBarID | identifier of a particular task set |
| virtual void IProgressBarManager::SetTaskText | ( | const PMString & | newText, | | | bool16 | forceRedraw = kTrue, | | | int32 | nBarID = -1 | | ) | | |
| pure virtual |
Sets the task text of the progress bar.
- Parameters
| newText | text for task |
| forceRedraw | kTrue to forceRedraw of text |
| nBarID | identifier of a particular task set |
| virtual void IProgressBarManager::SetTaskTitle | ( | const PMString & | strTitle, | | | bool16 | forceRedraw, | | | int32 | nBarID = -1 | | ) | | |
| pure virtual |
Sets the task title.
- Parameters
| strTitle | |
| forceRedraw | kTrue to force redraw of the task title |
| nBarID | identifier of a particular task set |
| virtual bool IProgressBarManager::SkipCheckingForCancel | ( | bool | skip | ) | |
| pure virtual |
| virtual bool16 IProgressBarManager::SuppressProgressBarDisplay | ( | bool16 | suppressDisplay | ) | |
| pure virtual |
Call this to suppress the display of the progress bar.
- Parameters
| suppressDisplay | kTrue 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
| nBarID | if 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
| setGlobalErrorState | if kTrue, sets the global error state to kCancel if progress was cancelled |
- Returns
- bool16 kTrue if progress bar was cancelled