QElectroTech  0.8-dev
diagrameventinterface.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef DIAGRAMEVENTINTERFACE_H
19 #define DIAGRAMEVENTINTERFACE_H
20 
21 #include <QObject>
22 
23 class QGraphicsSceneMouseEvent;
24 class QGraphicsSceneWheelEvent;
25 class QKeyEvent;
26 class Diagram;
27 
45 class DiagramEventInterface : public QObject
46 {
47  Q_OBJECT
48 
49  public:
51  ~DiagramEventInterface() override = 0;
52  virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event);
53  virtual void mousePressEvent (QGraphicsSceneMouseEvent *event);
54  virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event);
55  virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event);
56  virtual void wheelEvent (QGraphicsSceneWheelEvent *event);
57  virtual void keyPressEvent (QKeyEvent *event);
58  virtual void keyReleaseEvent (QKeyEvent *event);
59  virtual bool isRunning () const;
60  virtual void init();
61 
62  signals:
63  void finish(); //Emited when the interface finish is job.
64 
65  protected:
67  bool m_running;
68  bool m_abort;
69 };
70 
71 #endif // DIAGRAMEVENTINTERFACE_H
DiagramEventInterface::m_diagram
Diagram * m_diagram
Definition: diagrameventinterface.h:66
DiagramEventInterface::finish
void finish()
DiagramEventInterface::mouseMoveEvent
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: diagrameventinterface.cpp:42
DiagramEventInterface::DiagramEventInterface
DiagramEventInterface(Diagram *diagram)
Definition: diagrameventinterface.cpp:24
DiagramEventInterface::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *event)
Definition: diagrameventinterface.cpp:70
DiagramEventInterface::mousePressEvent
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: diagrameventinterface.cpp:38
DiagramEventInterface::init
virtual void init()
Definition: diagrameventinterface.cpp:78
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
DiagramEventInterface::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Definition: diagrameventinterface.cpp:34
DiagramEventInterface::isRunning
virtual bool isRunning() const
Definition: diagrameventinterface.cpp:74
DiagramEventInterface::mouseReleaseEvent
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition: diagrameventinterface.cpp:46
DiagramEventInterface::wheelEvent
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
Definition: diagrameventinterface.cpp:50
diagrameventinterface.h
DiagramEventInterface::m_running
bool m_running
Definition: diagrameventinterface.h:67
DiagramEventInterface::m_abort
bool m_abort
Definition: diagrameventinterface.h:68
DiagramEventInterface
The DiagramEventInterface class isRunning() return true if action is running (do something)....
Definition: diagrameventinterface.h:46
DiagramEventInterface::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
DiagramEventInterface::keyPressEvent By default, press escape key abort the curent action.
Definition: diagrameventinterface.cpp:59
diagram.h
DiagramEventInterface::~DiagramEventInterface
~DiagramEventInterface() override=0
Definition: diagrameventinterface.cpp:32