Developer Documentation
|
Interface class for Thread handling. More...
#include <OpenFlipper/BasePlugin/ProcessInterface.hh>
Signals | |
virtual void | startJob (QString _jobId, QString _description, int _min, int _max, bool _blocking=false) |
announce a new job More... | |
Public Member Functions | |
virtual | ~ProcessInterface () |
Destructor. | |
virtual void | setJobState (QString _jobId, int _value) |
update job state More... | |
virtual void | setJobName (QString _jobId, QString _name) |
update job's name More... | |
virtual void | setJobDescription (QString _jobId, QString _text) |
update job's description text More... | |
virtual void | cancelJob (QString _jobId) |
Cancel your job. More... | |
virtual void | finishJob (QString _jobId) |
Finish your job. More... | |
Private Slots | |
virtual void | canceledJob (QString _job) |
A job has been canceled. More... | |
Interface class for Thread handling.
Detailed description
This Interface is used to handle threads in OpenFlipper. You can run arbitrary slots within separate threads.
Definition at line 60 of file ProcessInterface.hh.
|
inlineprivatevirtualslot |
A job has been canceled.
This function is called when the user cancels a job. The returned name is the name of the job which has been canceled
_job | String which is used as the id of the thread |
Reimplemented in DecimaterPlugin.
Definition at line 137 of file ProcessInterface.hh.
|
inlinevirtual |
Cancel your job.
_jobId | String which is used as the id of the thread |
Definition at line 117 of file ProcessInterface.hh.
|
inlinevirtual |
Finish your job.
This signal has to be emitted when your job has finished. You can directly connect the threads finished signal to this signal.
_jobId | String which is used as the id of the thread |
Definition at line 126 of file ProcessInterface.hh.
|
inlinevirtual |
update job's description text
Emit this signal to tell the core to change a job's widget's description.
_jobId | String which is used as the id of the thread |
_text | The text of the job's description |
Definition at line 111 of file ProcessInterface.hh.
|
inlinevirtual |
update job's name
Emit this signal to tell the core to change a job's name.
_jobId | String which is used as the id of the thread |
_name | The new name of the job |
Definition at line 102 of file ProcessInterface.hh.
|
inlinevirtual |
update job state
Emit this signal to tell the core about your job status.
_jobId | String which is used as the id of the thread |
_value | The status value has to be in the range you defined in ProcessInterface::startJob() |
Definition at line 93 of file ProcessInterface.hh.
|
inlinevirtualsignal |
announce a new job
Use this function to announce a new job. The Job Id should be a unique id for your job. Prepend your PluginName to your id to make it unique across plugins.
The range between _min and _max will be used to compute the progress percentage based on the ProcessInterface::setJobState() values provided by the thread. You could for example set it to the number of steps performed in your algorithm.
_jobId | String which is used as the id of the thread |
_description | The description will be the string visible to the user. |
_min | minimum of the status value range |
_max | maximum of the status range |
_blocking | If the thread is blocking, no other interaction will be allowed |
Definition at line 84 of file ProcessInterface.hh.