00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PICKER_MACHINE
00011 #define QWT_PICKER_MACHINE 1
00012
00013 #include "qwt_global.h"
00014 #include <qlist.h>
00015
00016 class QEvent;
00017 class QwtEventPattern;
00018
00028 class QWT_EXPORT QwtPickerMachine
00029 {
00030 public:
00045 enum SelectionType
00046 {
00047 NoSelection = -1,
00048
00049 PointSelection,
00050 RectSelection,
00051 PolygonSelection
00052 };
00053
00055 enum Command
00056 {
00057 Begin,
00058 Append,
00059 Move,
00060 Remove,
00061 End
00062 };
00063
00064 QwtPickerMachine( SelectionType );
00065 virtual ~QwtPickerMachine();
00066
00068 virtual QList<Command> transition(
00069 const QwtEventPattern &, const QEvent * ) = 0;
00070 void reset();
00071
00072 int state() const;
00073 void setState( int );
00074
00075 SelectionType selectionType() const;
00076
00077 private:
00078 const SelectionType d_selectionType;
00079 int d_state;
00080 };
00081
00089 class QWT_EXPORT QwtPickerTrackerMachine: public QwtPickerMachine
00090 {
00091 public:
00092 QwtPickerTrackerMachine();
00093
00094 virtual QList<Command> transition(
00095 const QwtEventPattern &, const QEvent * );
00096 };
00097
00106 class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
00107 {
00108 public:
00109 QwtPickerClickPointMachine();
00110
00111 virtual QList<Command> transition(
00112 const QwtEventPattern &, const QEvent * );
00113 };
00114
00122 class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
00123 {
00124 public:
00125 QwtPickerDragPointMachine();
00126
00127 virtual QList<Command> transition(
00128 const QwtEventPattern &, const QEvent * );
00129 };
00130
00144 class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
00145 {
00146 public:
00147 QwtPickerClickRectMachine();
00148
00149 virtual QList<Command> transition(
00150 const QwtEventPattern &, const QEvent * );
00151 };
00152
00165 class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
00166 {
00167 public:
00168 QwtPickerDragRectMachine();
00169
00170 virtual QList<Command> transition(
00171 const QwtEventPattern &, const QEvent * );
00172 };
00173
00185 class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
00186 {
00187 public:
00188 QwtPickerPolygonMachine();
00189
00190 virtual QList<Command> transition(
00191 const QwtEventPattern &, const QEvent * );
00192 };
00193
00194 #endif