10 #ifndef GUARD_PROGRESS_H_INCLUDE
11 #define GUARD_PROGRESS_H_INCLUDE
13 #include <progress/progress-config.h>
28 int64_t offset_in_parent_;
29 int64_t size_in_parent_;
36 QString current_status_;
40 typedef bool (*KbSignal) (
43 const QString & status,
48 typedef bool (*KbSignalSimple) (
63 QList<Portion> stack_;
72 QString current_status_;
75 KbSignalSimple kb_simple_signal_;
76 KbSignal kb_full_signal_;
99 const QString & title = QString (),
100 int64_t total_size = 100);
109 return !stack_.isEmpty ();
117 const QString &label = QString (),
118 int64_t total_size = 100,
119 int64_t parent_offset = -1,
120 void * portion_data = NULL);
126 bool update_parent =
true);
130 inline const QString &
132 return current_status_;
139 return cutoff_level_;
146 cutoff_level_ = value;
159 granularity_ = value;
177 inline KbSignalSimple
179 return kb_simple_signal_;
185 kb_simple_signal_ = value;
192 return kb_full_signal_;
198 kb_full_signal_ = value;
205 int64_t chunk_size = 1,
206 int64_t offset = -1);
211 b_should_stop_ =
true;
217 b_should_stop_ =
false;
223 return b_should_stop_;
234 int64_t progress = 0);
241 searchCurrentLabel ();
246 bool b_bypass_checks =
false);
252 #endif // GUARD_PROGRESS_H_INCLUDE
int cutoffLevel() const
Size of the active portion of the stack.
Definition: progress.h:138
Report progress.
Definition: progress.h:19
const QString & currentStatus() const
Tell the label for current operation.
Definition: progress.h:131
void * userData() const
User data associated with the instance.
Definition: progress.h:165
void setCutoffLevel(int value)
Size of the active portion of the stack.
Definition: progress.h:144
void setStop()
Sets the internal state to signal the process should terminate.
Definition: progress.h:210
bool isInitialized() const
Teell if the instance was initialized (init() was called).
Definition: progress.h:108
void setSimpleCallback(KbSignalSimple value)
Simple callback to be used when progress changes.
Definition: progress.h:184
void setGranularity(int64_t value)
Emit signals when progress advances by at least this much.
Definition: progress.h:158
void setUserData(void *value)
User data associated with the instance.
Definition: progress.h:171
void setCallback(KbSignal value)
Callback to be used when progress changes.
Definition: progress.h:197
void resetStop()
Resets the internal state to signal the process should terminate.
Definition: progress.h:216
KbSignal callback() const
Callback to be used when progress changes.
Definition: progress.h:191
KbSignalSimple simpleCallback() const
Simple callback to be used when progress changes.
Definition: progress.h:178
int64_t granularity() const
Emit signals when progress advances by at least this much.
Definition: progress.h:152
bool shouldStop() const
Tell if the process / operation should stop.
Definition: progress.h:222