4 enum {progress_min = 0, progress_max = 5000};
7 virtual void set_progress(
t_size p_state) = 0;
9 virtual void set_progress_secondary(
t_size p_state) = 0;
11 virtual void set_item(
const char * p_item,
t_size p_item_len = ~0) = 0;
13 virtual void set_item_path(
const char * p_item,
t_size p_item_len = ~0) = 0;
15 virtual void set_title(
const char * p_title,
t_size p_title_len = ~0) = 0;
17 virtual void force_update() = 0;
19 virtual bool is_paused() = 0;
23 virtual bool process_pause() = 0;
26 void poll_pause() {
if (!process_pause())
throw exception_aborted();}
31 void set_progress_secondary(
t_size p_state,
t_size p_max);
33 void set_progress_float(
double p_state);
35 void set_progress_secondary_float(
double p_state);
50 virtual void on_done(HWND p_wnd,
bool p_was_aborted) {}
64 flag_show_minimize = 1 << 1,
66 flag_show_progress = 1 << 2,
68 flag_show_progress_dual = 1 << 3,
70 flag_show_item = 1 << 4,
72 flag_show_pause = 1 << 5,
74 flag_high_priority = 1 << 6,
76 flag_show_delayed = 1 << 7,
78 flag_no_focus = 1 << 8,
104 static bool g_query_preventStandby();
114 void on_init(HWND p_wnd) {m_target->tpc_on_init(p_wnd);}
116 void on_done(HWND p_wnd,
bool p_was_aborted) {m_target->tpc_on_done(p_wnd, p_was_aborted); }
virtual void on_done(HWND p_wnd, bool p_was_aborted)
Called after the worker thread has finished executing.
void poll_pause()
Automatically sleeps if the process is paused.
Callback class passed to your threaded_process client code; allows you to give various visual feedbac...
Helper - forward threaded_process_callback calls to a service object that for whatever reason cannot ...
virtual void on_init(HWND p_wnd)
Called from the main thread before spawning the worker thread. Note that you should not access the w...
void run(threaded_process_status &p_status, abort_callback &p_abort)
Called from the worker thread. Do all the hard work here.
threaded_process_status()
~threaded_process_status()
Callback class for the threaded_process API. You must implement this to create your own threaded_proc...
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
void on_init(HWND p_wnd)
Called from the main thread before spawning the worker thread. Note that you should not access the w...
void on_done(HWND p_wnd, bool p_was_aborted)
Called after the worker thread has finished executing.
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
threaded_process_callback_redir(TTarget *target)
The threaded_process API allows you to easily put timeconsuming tasks in worker threads, with progress dialog giving nice feedback to the user. Thanks to this API you can perform such tasks with no user interface related programming at all.
const service_ptr_t< TTarget > m_target