All Classes Functions Variables Typedefs Enumerations Enumerator Pages
qwt_picker_machine.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PICKER_MACHINE
#define QWT_PICKER_MACHINE 1
#include "qwt_global.h"
#include <qlist.h>
class QEvent;
class QwtEventPattern;
class QWT_EXPORT QwtPickerMachine
{
public:
enum SelectionType
{
NoSelection = -1,
PointSelection,
RectSelection,
PolygonSelection
};
enum Command
{
Begin,
Append,
Move,
Remove,
End
};
QwtPickerMachine( SelectionType );
virtual ~QwtPickerMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * ) = 0;
void reset();
int state() const;
void setState( int );
SelectionType selectionType() const;
private:
const SelectionType d_selectionType;
int d_state;
};
class QWT_EXPORT QwtPickerTrackerMachine: public QwtPickerMachine
{
public:
QwtPickerTrackerMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerClickPointMachine: public QwtPickerMachine
{
public:
QwtPickerClickPointMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerDragPointMachine: public QwtPickerMachine
{
public:
QwtPickerDragPointMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerClickRectMachine: public QwtPickerMachine
{
public:
QwtPickerClickRectMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerDragRectMachine: public QwtPickerMachine
{
public:
QwtPickerDragRectMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerDragLineMachine: public QwtPickerMachine
{
public:
QwtPickerDragLineMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
class QWT_EXPORT QwtPickerPolygonMachine: public QwtPickerMachine
{
public:
QwtPickerPolygonMachine();
virtual QList<Command> transition(
const QwtEventPattern &, const QEvent * );
};
#endif