Engauge Digitizer 2
Loading...
Searching...
No Matches
CentipedeStateAbstractBase.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2020 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef CENTIPEDE_STATE_ABSTRACT_BASE_H
8#define CENTIPEDE_STATE_ABSTRACT_BASE_H
9
10#include "CentipedeState.h"
11#include <QPointF>
12
14
17{
18public:
22
24 virtual void begin() = 0;
25
28
30 virtual void end() = 0;
31
33 virtual void handleKeyPress (Qt::Key key,
34 bool atLeastOneSelectedItem) = 0;
35
37 virtual void handleMouseMove (QPointF posScreen) = 0;
38
40 virtual void handleMousePress (QPointF posScreen) = 0;
41
43 virtual void handleMouseRelease (QPointF posScreen) = 0;
44
45protected:
46
48 void enableUndoStack (bool enable);
49
50private:
52
53 CentipedeStateContext &m_context;
54};
55
56#endif // CENTIPEDE_STATE_ABSTRACT_BASE_H
virtual void handleMousePress(QPointF posScreen)=0
Handle mouse press event.
virtual void handleKeyPress(Qt::Key key, bool atLeastOneSelectedItem)=0
Handle key press event.
virtual void end()=0
Method that is called at the exact moment a state is exited. Typically called just before start of th...
virtual void handleMouseRelease(QPointF posScreen)=0
Handle mouse release event.
CentipedeStateAbstractBase(CentipedeStateContext &context)
Single constructor.
virtual void begin()=0
Method that is called at the exact moment a state is entered. Typically called just after end for the...
virtual void handleMouseMove(QPointF posScreen)=0
Handle mouse move event.
void enableUndoStack(bool enable)
Method called by subclasses to send signalUndoActve.
CentipedeStateContext & context()
Reference to the CentipedeStateContext that contains all the CentipedeStateAbstractBase subclasses.
State context class for tracking the steps involved in creating centipedes in preparation for creatin...