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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
/* -*- C++ -*-
This file declares the classes for the GUI Jobs example.
$ Author: Mirko Boehm $
$ Copyright: (C) 2005, Mirko Boehm $
$ Contact: mirko@kde.org
http://www.kde.org
http://www.hackerbuero.org $
$ License: LGPL with the following explicit clarification:
This code may be linked against any version of the Qt toolkit
from Trolltech, Norway. $
$Id: Jobs.h 30 2005-08-16 16:16:04Z mirko $
*/
#ifndef Jobs_H
#define Jobs_H
#include <QtGui/QWidget>
#include <Job.h>
#include <ThreadWeaver.h>
#include "ui_JobsBase.h"
#include "WeaverObserverTest.h"
namespace ThreadWeaver {
class JobCollection;
class DummyJob : public Job
{
public:
DummyJob (QObject* parent = 0);
protected:
void run ();
};
class Jobs : public QWidget
{
Q_OBJECT
public:
enum State {
Initial = 0,
Stopped = Initial,
Disable,
Stopping = Disable,
ShuttingDown = Disable,
Started
};
Jobs (QWidget *parent = 0);
virtual ~Jobs();
protected Q_SLOTS:
void slotStart();
void slotStop();
void slotQuit();
void slotLogStateChanged (int);
protected:
void setState ( State s );
State state();
JobCollection* m_jobs;
bool m_quit;
State m_state;
Ui::JobsBase ui;
WeaverObserverTest *m_log;
protected Q_SLOTS:
void slotJobDone (ThreadWeaver::Job*);
void slotStopped ();
};
}
#endif // defined Jobs_H
|