Basic implementation of a CJob with a progress bar to indicate the progress of the job being processed.
More...
#include <ProgressJob.h>
|
const char * | GetType () const override |
| Function that returns the type of job. More...
|
|
bool | operator== (const CJob *job) const override |
|
bool | ShouldCancel (unsigned int progress, unsigned int total) const override |
| Function for longer jobs to report progress and check whether they have been cancelled. More...
|
|
bool | DoModal () |
| Executes the job showing a modal progress dialog.
|
|
void | SetProgressIndicators (CGUIDialogProgressBarHandle *progressBar, CGUIDialogProgress *progressDialog, bool updateProgress=true, bool updateInformation=true) |
| Sets the given progress indicators to be used during execution of the job. More...
|
|
bool | HasProgressIndicator () const |
|
virtual | ~CJob ()=default |
| Destructor for job objects. More...
|
|
virtual bool | DoWork ()=0 |
| Main workhorse function of CJob instances. More...
|
|
|
enum | PRIORITY {
PRIORITY_LOW_PAUSABLE = 0,
PRIORITY_LOW,
PRIORITY_NORMAL,
PRIORITY_HIGH,
PRIORITY_DEDICATED
} |
| Priority levels for jobs, specified by clients when adding jobs to the CJobManager. More...
|
|
Basic implementation of a CJob with a progress bar to indicate the progress of the job being processed.
◆ GetType()
const char* CProgressJob::GetType |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ SetProgress() [1/2]
void CProgressJob::SetProgress |
( |
float |
percentage | ) |
const |
|
protected |
Sets the progress of the progress bar to the given value in percentage.
- Parameters
-
[in] | percentage | Percentage to be set as the current progress |
◆ SetProgress() [2/2]
void CProgressJob::SetProgress |
( |
int |
currentStep, |
|
|
int |
totalSteps |
|
) |
| const |
|
protected |
Sets the progress of the progress bar to the given value.
- Parameters
-
[in] | currentStep | Current step being processed |
[in] | totalSteps | Total steps to be processed |
◆ SetProgressIndicators()
Sets the given progress indicators to be used during execution of the job.
This automatically disables auto-closing the given progress indicators once the job has been finished.
- Parameters
-
progressBar | Progress bar handle to be used. |
progressDialog | Progress dialog to be used. |
updateProgress | (optional) Whether to show progress updates. |
updateInformation | (optional) Whether to show progress information. |
◆ SetText()
void CProgressJob::SetText |
( |
const std::string & |
text | ) |
|
|
protected |
Sets the given text as the description of the progress bar.
- Parameters
-
◆ SetTitle()
void CProgressJob::SetTitle |
( |
const std::string & |
title | ) |
|
|
protected |
Sets the given title as the title of the progress bar.
- Parameters
-
◆ ShouldCancel()
bool CProgressJob::ShouldCancel |
( |
unsigned int |
progress, |
|
|
unsigned int |
total |
|
) |
| const |
|
overridevirtual |
Function for longer jobs to report progress and check whether they have been cancelled.
Jobs that contain loops that may take time should check this routine each iteration of the loop, both to (optionally) report progress, and to check for cancellation.
- Parameters
-
progress | the amount of the job performed, out of total. |
total | the total amount of processing to be performed |
- Returns
- if true, the job has been asked to cancel.
- See also
- IJobCallback::OnJobProgress()
Reimplemented from CJob.
The documentation for this class was generated from the following files: