00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
#ifndef QWT_PICKER_MACHINE
00011
#define QWT_PICKER_MACHINE 1
00012
00013
#include <qvaluelist.h>
00014
#include "qwt_array.h"
00015
00016
class QEvent;
00017
class QwtEventPattern;
00018
00028 class QWT_EXPORT QwtPickerMachine
00029 {
00030
public:
00031
enum Command
00032 {
00033 Begin,
00034 Append,
00035 Move,
00036 End
00037 };
00038
00039
virtual ~QwtPickerMachine();
00040
00042
virtual QValueList<Command> transition(
00043
const QwtEventPattern &,
const QEvent *) = 0;
00044
void reset();
00045
00046
protected:
00047 QwtPickerMachine();
00048
00049
int state()
const;
00050
void setState(
int);
00051
00052
private:
00053
int d_state;
00054 };
00055
00064 class QWT_EXPORT QwtPickerClickPointMachine:
public QwtPickerMachine
00065 {
00066
public:
00067
virtual QValueList<Command>
transition(
00068
const QwtEventPattern &,
const QEvent *);
00069 };
00070
00078 class QWT_EXPORT QwtPickerDragPointMachine:
public QwtPickerMachine
00079 {
00080
public:
00081
virtual QValueList<Command>
transition(
00082
const QwtEventPattern &,
const QEvent *);
00083 };
00084
00098 class QWT_EXPORT QwtPickerClickRectMachine:
public QwtPickerMachine
00099 {
00100
public:
00101
virtual QValueList<Command>
transition(
00102
const QwtEventPattern &,
const QEvent *);
00103 };
00104
00117 class QWT_EXPORT QwtPickerDragRectMachine:
public QwtPickerMachine
00118 {
00119
public:
00120
virtual QValueList<Command>
transition(
00121
const QwtEventPattern &,
const QEvent *);
00122 };
00123
00135 class QWT_EXPORT QwtPickerPolygonMachine:
public QwtPickerMachine
00136 {
00137
public:
00138
virtual QValueList<Command>
transition(
00139
const QwtEventPattern &,
const QEvent *);
00140 };
00141
00142
#endif