libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | List of all members
GtkCRN::Progress Class Reference

Progress object associated with a widget. More...

#include <GtkCRNProgress.h>

+ Inheritance diagram for GtkCRN::Progress:
+ Collaboration diagram for GtkCRN::Progress:

Public Member Functions

 Progress (const crn::String &name, size_t maxcount=100)
 Constructor. More...
 
 Progress (const crn::String &name, sigc::slot< void > execute_at_end, size_t maxcount=100)
 Constructor. More...
 
virtual ~Progress () override=default
 Destructor. More...
 
Gtk::ProgressBar & GetProgressBar ()
 Gets the Gtk progress bar. More...
 
const Gtk::ProgressBar & GetProgressBar () const
 Gets the Gtk progress bar. More...
 
sigc::signal< void > signal_end ()
 Signal thrown when the progress reached 100%. More...
 
- Public Member Functions inherited from crn::Progress
 Progress (const String &nam, size_t maxcount=100)
 Constructor. More...
 
 Progress (const Progress &)=delete
 
 Progress (Progress &&)=default
 
Progressoperator= (const Progress &)=delete
 
Progressoperator= (Progress &&)=default
 
void Advance ()
 Progresses of one step. More...
 
void SetMaxCount (size_t maxcount, bool reset=true)
 Sets the total number of steps. More...
 
void Reset ()
 Resets the progress to 0. More...
 
void SetType (Type typ) noexcept
 Sets the type of progress bar. More...
 
void SetName (const crn::String &nam)
 

Protected Member Functions

virtual void display (const crn::String &msg) override
 Displays current progress on Gtk progress bar (thread safe) More...
 

Additional Inherited Members

- Public Types inherited from crn::Progress
enum  Type { Type::PERCENT = 0, Type::ABSOLUTE = 1 }
 
- Protected Attributes inherited from crn::Progress
String name
 
size_t current
 
size_t end
 
String disp
 
Type type
 

Detailed Description

Progress object associated with a widget.

Definition at line 34 of file GtkCRNProgress.h.

Constructor & Destructor Documentation

GtkCRN::Progress::Progress ( const crn::String name,
size_t  maxcount = 100 
)

Constructor.

Constructor

Parameters
[in]namethe label displayed on the progress bar
[in]maxcountthe number of calls to Advance() to reach 100%

Definition at line 30 of file GtkCRNProgress.cpp.

GtkCRN::Progress::Progress ( const crn::String name,
sigc::slot< void >  execute_at_end,
size_t  maxcount = 100 
)

Constructor.

Constructor

Parameters
[in]namethe label displayed on the progress bar
[in]execute_at_endthe callback to call when the progress reaches 100%
[in]maxcountthe number of calls to Advance() to reach 100%

Definition at line 43 of file GtkCRNProgress.cpp.

virtual GtkCRN::Progress::~Progress ( )
overridevirtualdefault

Destructor.

Reimplemented from crn::Progress.

Member Function Documentation

void GtkCRN::Progress::display ( const crn::String msg)
overrideprotectedvirtual

Displays current progress on Gtk progress bar (thread safe)

Displays current progress on Gtk progress bar (thread safe)

Parameters
[in]msgthe text to display

Implements crn::Progress.

Definition at line 55 of file GtkCRNProgress.cpp.

Gtk::ProgressBar& GtkCRN::Progress::GetProgressBar ( )
inline

Gets the Gtk progress bar.

Definition at line 45 of file GtkCRNProgress.h.

const Gtk::ProgressBar& GtkCRN::Progress::GetProgressBar ( ) const
inline

Gets the Gtk progress bar.

Definition at line 47 of file GtkCRNProgress.h.

sigc::signal<void> GtkCRN::Progress::signal_end ( )
inline

Signal thrown when the progress reached 100%.

Definition at line 50 of file GtkCRNProgress.h.


The documentation for this class was generated from the following files: