24 #ifndef TBX_TASKWINDOW_H 25 #define TBX_TASKWINDOW_H 30 #include "wimpmessagelistener.h" 35 class TaskWindowStartedListener;
36 class TaskWindowFinishedListener;
37 class TaskWindowOutputListener;
47 unsigned int _options;
48 unsigned int _child_task;
51 static unsigned int _next_txt_id;
60 std::vector<TaskWindowStartedListener *> _started_listeners;
61 std::vector<TaskWindowFinishedListener *> _finished_listeners;
62 std::vector<TaskWindowOutputListener *> _output_listeners;
97 const std::string &
command()
const {
return _command; }
108 const std::string &
name()
const {
return _name; }
130 unsigned int options()
const {
return _options; }
136 void options(
unsigned int new_opts) { _options = new_opts; }
161 void send_input(
const char *text,
int size = -1);
181 virtual void taskwindow_started(
TaskWindow &task_window) = 0;
197 virtual void taskwindow_finished(
TaskWindow &task_window) = 0;
215 virtual void taskwindow_output(
TaskWindow &task_window,
int size,
const char *text) = 0;
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
int wimp_slot() const
Get the wimp slot size in KB for the task window.
Definition: taskwindow.h:118
TaskWindow()
Uninitialised task window.
Definition: taskwindow.cc:50
Listener for output from a task window.
Definition: taskwindow.h:203
void remove_output_listener(TaskWindowOutputListener *listener)
Remove listener to detect output from the child task.
Definition: taskwindow.cc:171
void command(const std::string &command)
Set the command run by this task window.
Definition: taskwindow.h:103
Listener to handle WimpRecordedMessages (event code 18)
Definition: wimpmessagelistener.h:269
const std::string & name() const
Get the task name for the task window.
Definition: taskwindow.h:108
unsigned int child_task() const
task id of the child task.
Definition: taskwindow.h:150
void run()
Run the child task.
Definition: taskwindow.cc:209
const std::string & command() const
Get the command run by this task window.
Definition: taskwindow.h:97
Class to start a child task in a RISC OS task window.
Definition: taskwindow.h:42
void add_finished_listener(TaskWindowFinishedListener *listener)
Add listener to detect when the child task has finished.
Definition: taskwindow.cc:124
Wimp message received event.
Definition: wimpmessagelistener.h:209
void name(const std::string &name)
Set the name of the task window Changing this will have no effect on a currently running task window...
Definition: taskwindow.h:114
void suspend()
Suspend the current child task.
Definition: taskwindow.cc:283
unsigned int options() const
The options applied when the task window is executed.
Definition: taskwindow.h:130
void add_started_listener(TaskWindowStartedListener *listener)
Add listener to detect when the child task is started.
Definition: taskwindow.cc:95
Listener to handle WimpUserMessages (event code 17)
Definition: wimpmessagelistener.h:252
void resume()
Resume the current child task after it has been suspended with a call to suspend. ...
Definition: taskwindow.cc:296
void options(unsigned int new_opts)
Set the options when the task window is executed Changing this will have no effect on a currently run...
Definition: taskwindow.h:136
Listener for when a task window has finished.
Definition: taskwindow.h:187
Options
Task window run options.
Definition: taskwindow.h:72
void send_input(const char *text, int size=-1)
Send input to the task window.
Definition: taskwindow.cc:250
Listener for when a task window has started.
Definition: taskwindow.h:171
~TaskWindow()
Destructor, remove interest in the task window.
Definition: taskwindow.cc:86
bool running() const
Check if task window is running.
Definition: taskwindow.h:144
Base class for all toolbox event listeners.
Definition: listener.h:33
void kill()
Kill the current child task.
Definition: taskwindow.cc:307
void add_output_listener(TaskWindowOutputListener *listener)
Add listener to capture output from the child task.
Definition: taskwindow.cc:156
void remove_started_listener(TaskWindowStartedListener *listener)
Remove listener to detect when the child task is started.
Definition: taskwindow.cc:105
void wimp_slot(int slot)
Set the wimp slot for the task window Changing this will have no effect on a currently running task w...
Definition: taskwindow.h:124
void remove_finished_listener(TaskWindowFinishedListener *listener)
Remove listener to detect when the child task has finished.
Definition: taskwindow.cc:134
Show the taskwindow output window before any output comes from the task.
Definition: taskwindow.h:81
Allow control characters to be sent to the output.
Definition: taskwindow.h:77
Quit the task windo wht the child task finishes.
Definition: taskwindow.h:85