Developer Documentation

Signals | Public Member Functions | Private Slots | List of all members
ProcessInterface Class Reference

Interface class for Thread handling. More...

`#include <OpenFlipper/BasePlugin/ProcessInterface.hh>`

Inheritance diagram for ProcessInterface:

## 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...

## Detailed Description

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.

## Member Function Documentation

## ◆ canceledJob

virtual void ProcessInterface::canceledJob | ( | QString | _job | ) |
| inline private virtual slot

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

Parameters

  _job | String which is used as the id of the thread

Reimplemented in DecimaterPlugin.

Definition at line 137 of file ProcessInterface.hh.

## ◆ cancelJob()

virtual void ProcessInterface::cancelJob | ( | QString | _jobId | ) |
| inline virtual

Cancel your job.

Parameters

  _jobId | String which is used as the id of the thread

Definition at line 117 of file ProcessInterface.hh.

## ◆ finishJob()

virtual void ProcessInterface::finishJob | ( | QString | _jobId | ) |
| inline virtual

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.

Parameters

  _jobId | String which is used as the id of the thread

Definition at line 126 of file ProcessInterface.hh.

## ◆ setJobDescription()

virtual void ProcessInterface::setJobDescription | ( | QString | _jobId,
|  | QString | _text
| ) |  |
| inline virtual

update job's description text

Emit this signal to tell the core to change a job's widget's description.

Parameters

  _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.

## ◆ setJobName()

virtual void ProcessInterface::setJobName | ( | QString | _jobId,
|  | QString | _name
| ) |  |
| inline virtual

update job's name

Emit this signal to tell the core to change a job's name.

Parameters

  _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.

## ◆ setJobState()

virtual void ProcessInterface::setJobState | ( | QString | _jobId,
|  | int | _value
| ) |  |
| inline virtual

update job state

Emit this signal to tell the core about your job status.

Parameters

  _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.

## ◆ startJob

virtual void ProcessInterface::startJob | ( | QString | _jobId,
|  | QString | _description,
|  | int | _min,
|  | int | _max,
|  | bool | _blocking = `false`
| ) |  |
| inline virtual signal

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.

Parameters

  _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.

The documentation for this class was generated from the following file:

- OpenFlipper/BasePlugin/ProcessInterface.hh