2022-07-15 15:37:19 +00:00
|
|
|
#ifndef IPROGRESSINDICATOR_HPP
|
|
|
|
#define IPROGRESSINDICATOR_HPP
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <functional>
|
2023-12-21 09:10:46 +00:00
|
|
|
#include <wx/string.h>
|
2022-07-15 15:37:19 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Generic progress indication interface.
|
|
|
|
*/
|
|
|
|
class ProgressIndicator {
|
|
|
|
public:
|
|
|
|
|
|
|
|
/// Cancel callback function type
|
|
|
|
using CancelFn = std::function<void()>;
|
|
|
|
|
|
|
|
virtual ~ProgressIndicator() = default;
|
|
|
|
|
2022-12-06 10:08:29 +00:00
|
|
|
virtual void clear_percent() = 0;
|
2023-05-04 09:52:22 +00:00
|
|
|
virtual void show_error_info(wxString msg, int code, wxString description, wxString extra) = 0;
|
2022-07-15 15:37:19 +00:00
|
|
|
virtual void set_range(int range) = 0;
|
|
|
|
virtual void set_cancel_callback(CancelFn = CancelFn()) = 0;
|
|
|
|
virtual void set_progress(int pr) = 0;
|
|
|
|
virtual void set_status_text(const char *) = 0; // utf8 char array
|
|
|
|
virtual int get_range() const = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // IPROGRESSINDICATOR_HPP
|