1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
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
*****************************************************************************/
10
#ifndef QWT_PICKER_MACHINE
11
#define QWT_PICKER_MACHINE 1
13
#include "qwt_global.h"
14
#if QT_VERSION < 0x040000
15
#include <qvaluelist.h>
21
class QwtEventPattern;
24
\brief A state machine for QwtPicker selections
26
QwtPickerMachine accepts key and mouse events and translates them
27
into selection commands.
29
\sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
32
class QWT_EXPORT QwtPickerMachine
35
//! Commands - the output of the state machine
44
#if QT_VERSION < 0x040000
45
typedef QValueList<Command> CommandList;
47
typedef QList<Command> CommandList;
50
virtual ~QwtPickerMachine();
53
virtual CommandList transition(
54
const QwtEventPattern &, const QEvent *) = 0;
68
\brief A state machine for point selections
70
Pressing QwtEventPattern::MouseSelect1 or
71
QwtEventPattern::KeySelect1 selects a point.
73
\sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
75
class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
78
virtual CommandList transition(
79
const QwtEventPattern &, const QEvent *);
83
\brief A state machine for point selections
85
Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1
86
starts the selection, releasing QwtEventPattern::MouseSelect1 or
87
a second press of QwtEventPattern::KeySelect1 terminates it.
89
class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
92
virtual CommandList transition(
93
const QwtEventPattern &, const QEvent *);
97
\brief A state machine for rectangle selections
99
Pressing QwtEventPattern::MouseSelect1 starts
100
the selection, releasing it selects the first point. Pressing it
101
again selects the second point and terminates the selection.
102
Pressing QwtEventPattern::KeySelect1 also starts the
103
selection, a second press selects the first point. A third one selects
104
the second point and terminates the selection.
106
\sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
109
class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
112
virtual CommandList transition(
113
const QwtEventPattern &, const QEvent *);
117
\brief A state machine for rectangle selections
119
Pressing QwtEventPattern::MouseSelect1 selects
120
the first point, releasing it the second point.
121
Pressing QwtEventPattern::KeySelect1 also selects the
122
first point, a second press selects the second point and terminates
125
\sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
128
class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
131
virtual CommandList transition(
132
const QwtEventPattern &, const QEvent *);
136
\brief A state machine for polygon selections
138
Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1
139
starts the selection and selects the first point, or appends a point.
140
Pressing QwtEventPattern::MouseSelect2 or QwtEventPattern::KeySelect2
141
appends the last point and terminates the selection.
143
\sa QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode
146
class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
149
virtual CommandList transition(
150
const QwtEventPattern &, const QEvent *);