summaryrefslogtreecommitdiffstats
path: root/job.h
blob: 53843e5b2d427dc7f199b340a358a4b363472cd2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef JOB_H
#define JOB_H

#include "video.h"
#include <QObject>
#include <QFutureWatcher>
class QWidget;

class Job : public QObject
{
	Q_OBJECT
public:
	void runJob();
	virtual Video::Jobs jobType() const = 0;
	QWidget* widget();
	Video* video() const;
protected:
	Job(Video *parent, bool threaded);
	virtual bool executeJob() = 0;
	virtual QWidget* gui() = 0;
	QFutureWatcher<bool>* watcher() const;
private:
	QFutureWatcher<bool> *m_watcher;
	QWidget *m_gui;
	Video *m_video;
private slots:
	void jobFinished();
public slots:
	virtual void terminate() = 0;
signals:
	void completed(bool result);
};

#endif // JOB_H