Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

qwt_picker_machine.h

00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_PICKER_MACHINE
00011 #define QWT_PICKER_MACHINE 1
00012 
00013 #include "qwt_global.h"
00014 #if QT_VERSION < 0x040000
00015 #include <qvaluelist.h>
00016 #else
00017 #include <qlist.h>
00018 #endif
00019 
00020 class QEvent;
00021 class QwtEventPattern;
00022 
00032 class QWT_EXPORT QwtPickerMachine
00033 {
00034 public:
00035     enum Command
00036     {
00037         Begin,
00038         Append,
00039         Move,
00040         End
00041     };
00042 
00043 #if QT_VERSION < 0x040000
00044     typedef QValueList<Command> CommandList;
00045 #else
00046     typedef QList<Command> CommandList;
00047 #endif
00048 
00049     virtual ~QwtPickerMachine();
00050 
00052     virtual CommandList transition(
00053         const QwtEventPattern &, const QEvent *) = 0;
00054     void reset(); 
00055 
00056 protected:
00057     QwtPickerMachine();
00058 
00059     int state() const;
00060     void setState(int);
00061 
00062 private:
00063     int d_state;
00064 };
00065 
00074 class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
00075 {
00076 public:
00077     virtual CommandList transition(
00078         const QwtEventPattern &, const QEvent *);
00079 };
00080 
00088 class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
00089 {
00090 public:
00091     virtual CommandList transition(
00092         const QwtEventPattern &, const QEvent *);
00093 };
00094 
00108 class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
00109 {
00110 public:
00111     virtual CommandList transition(
00112         const QwtEventPattern &, const QEvent *);
00113 };
00114 
00127 class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
00128 {
00129 public:
00130     virtual CommandList transition(
00131         const QwtEventPattern &, const QEvent *);
00132 };
00133 
00145 class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
00146 {
00147 public:
00148     virtual CommandList transition(
00149         const QwtEventPattern &, const QEvent *);
00150 };
00151 
00152 #endif

Generated on Mon Jan 30 22:16:25 2006 for Qwt User's Guide by  doxygen 1.4.4