Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Friends | List of all members
AppProgressBar Class Reference

Defines progress bar behavior, allowing to monitor the progress of a process. More...

Inheritance diagram for AppProgressBar:
CoreBaseType

Public Member Functions

 ~AppProgressBar ()
 Destructor.
 
AppBaseget_application () const
 
bool is_valid_context () const
 
const CoreStringget_text () const
 Get the text associated to the progress bar.
 
const CoreStringget_task_name () const
 Get the text associated to the current task.
 
float get_global_value () const
 Get the global progress value.
 
float get_value () const
 Get the progress value for the current task.
 
void set_value (const float &value)
 Set the progress value for the current task.
 
void set_increment (const float &increment)
 Define an progress increment for the current task.
 
void increment ()
 Increment the progress value with the recorded increment.
 
void increment (const float &value)
 Increment the progress of the current task with the specified value.
 
void set_step_count (const unsigned int &step_count)
 Set a number of step that will be processed for the current task.
 
void step (const unsigned int &i)
 Specify the step that has been processed.
 
void begin_task (const bool &compute_duration=false)
 Start a new task that will cover from the current progress to 100% of the parent task.
 
void begin_task (const CoreString &name, const bool &compute_duration=false)
 Start a new task that will cover from the current progress to 100% of the parent task.
 
void begin_task (const float &scale, const bool &compute_duration=false)
 Start a new task.
 
void begin_task (const CoreString &name, const float &scale, const bool &compute_duration=false)
 Start a new task.
 
unsigned long end_task ()
 End the current task.
 
void start ()
 Reset the progress to 0%.
 
void finish ()
 Set the progress to 100% and comute the total duration.
 
bool abort ()
 Inform the process that is monitored by the current progress bar to abort.
 
void destroy ()
 Tells the progress bar to destroy itself once it is not useful anymore.
 
bool is_abortable () const
 Tells wether the process monitored by the current progress bar can be aborted.
 
bool must_abort () const
 Tells wether the process monitored by the current progress bar must be aborted.
 
const bool & is_destroyed () const
 Tells wether the progress bar has been destroyed.
 
const bool & keep_in_history () const
 Tells wether the progress remains visible in the history.
 
void detach_from_main_thread ()
 This function must be called when the progress bar is updated from a thread.
 
const unsigned long & get_duration () const
 Get the duration of the process that has been monitored by the progress bar.
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Friends

class AppBase
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreBaseType
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
static const CoreClassInfoclass_info ()
 

Detailed Description

Defines progress bar behavior, allowing to monitor the progress of a process.

The progress bar allows to monitor a process that can be split into several tasks. Each task can then be split into steps. Each time the value of the progress is updated the UI is informed in order to be refreshed.

A progress bar must be created through the application by calling AppBase::create_progress_bar(). Once it is not useful anymore, it must be released by using the destroy() method.

Examples:
app_progress_bar_example.cc.

Member Function Documentation

bool AppProgressBar::abort ( )

Inform the process that is monitored by the current progress bar to abort.

tells the process that uses the progress bar to abort

void AppProgressBar::begin_task ( const bool &  compute_duration = false)
inline

Start a new task that will cover from the current progress to 100% of the parent task.

Parameters
compute_durationwhen true, the duration of the task will be computed
Examples:
app_progress_bar_example.cc.
void AppProgressBar::begin_task ( const CoreString name,
const bool &  compute_duration = false 
)
inline

Start a new task that will cover from the current progress to 100% of the parent task.

Parameters
namethe name of the task
compute_durationwhen true, the duration of the task will be computed
void AppProgressBar::begin_task ( const float &  scale,
const bool &  compute_duration = false 
)
inline

Start a new task.

Parameters
scalethe percentage of the parent task that the current task will cover
compute_durationwhen true, the duration of the task will be computed
void AppProgressBar::begin_task ( const CoreString name,
const float &  scale,
const bool &  compute_duration = false 
)

Start a new task.

Parameters
namethe name of the task
scalethe percentage of the parent task that the current task will cover
compute_durationwhen true, the duration of the task will be computed
void AppProgressBar::destroy ( )
inline

Tells the progress bar to destroy itself once it is not useful anymore.

Note
A progress bar remains visible in UI until it is destroyed.
Examples:
app_progress_bar_example.cc.
unsigned long AppProgressBar::end_task ( )

End the current task.

Note
The progress of the parent task is automatically updated according to the coverage of the current task.
Returns
the duration in milliseconds of the task (0 when disabled)
Examples:
app_progress_bar_example.cc.
void AppProgressBar::finish ( )

Set the progress to 100% and comute the total duration.

stops progress bar

const unsigned long& AppProgressBar::get_duration ( ) const
inline

Get the duration of the process that has been monitored by the progress bar.

Note
This must be called after finish().
void AppProgressBar::increment ( )
inline

Increment the progress value with the recorded increment.

Note
This method should be used only with big increment values because it refreshes the UI each time it is called.
void AppProgressBar::increment ( const float &  value)
inline

Increment the progress of the current task with the specified value.

Note
This method should not be called too often because it informs the UI to refresh.
void AppProgressBar::set_step_count ( const unsigned int &  step_count)
inline

Set a number of step that will be processed for the current task.

Note
This method is recommended over increment() method because it will refresh the UI only if needed (switching from a percent to anothed one).
See Also
step for more details
Examples:
app_progress_bar_example.cc.
void AppProgressBar::set_value ( const float &  value)
inline

Set the progress value for the current task.

Note
This method should not be called too often because it informs the UI to refresh.
void AppProgressBar::start ( )

Reset the progress to 0%.

starts progress bar runtime

void AppProgressBar::step ( const unsigned int &  i)
inline

Specify the step that has been processed.

Note
The UI will be refreshed only when needed.
See Also
set_step_count
Examples:
app_progress_bar_example.cc.