Qwt User's Guide: qwt_picker_machine.h Source File

Qwt User's Guide 5.2.3

- Main Page
- Related Pages
- Classes

qwt_picker_machine.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_PICKER_MACHINE
11 #define QWT_PICKER_MACHINE 1
12
13 #include "qwt_global.h"
14 #if QT_VERSION < 0x040000
15 #include <qvaluelist.h>
16 #else
17 #include <qlist.h>
18 #endif
19
20 class QEvent;
21 class QwtEventPattern;
22
32 class QWT_EXPORT QwtPickerMachine
33 {
34 public:
36 enum Command
37 {
38 Begin,
39 Append,
40 Move,
41 End
42 };
43
44 #if QT_VERSION < 0x040000
45 typedef QValueList<Command> CommandList;
46 #else
47 typedef QList<Command> CommandList;
48 #endif
49
50 virtual ~QwtPickerMachine();
51
53 virtual CommandList transition(
54 const QwtEventPattern &, const QEvent *) = 0;
55 void reset();
56
57 int state() const;
58 void setState(int);
59
60 protected:
61 QwtPickerMachine();
62
63 private:
64 int d_state;
65 };
66
75 class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
76 {
77 public:
78 virtual CommandList transition(
79 const QwtEventPattern &, const QEvent *);
80 };
81
89 class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
90 {
91 public:
92 virtual CommandList transition(
93 const QwtEventPattern &, const QEvent *);
94 };
95
109 class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
110 {
111 public:
112 virtual CommandList transition(
113 const QwtEventPattern &, const QEvent *);
114 };
115
128 class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
129 {
130 public:
131 virtual CommandList transition(
132 const QwtEventPattern &, const QEvent *);
133 };
134
146 class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
147 {
148 public:
149 virtual CommandList transition(
150 const QwtEventPattern &, const QEvent *);
151 };
152
153 #endif