QElectroTech  0.8-dev
dveventinterface.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 DVEVENTINTERFACE_H
19 #define DVEVENTINTERFACE_H
20 
21 #include <QObject>
22 
23 class QMouseEvent;
24 class QWheelEvent;
25 class QKeyEvent;
26 class DiagramView;
27 class Diagram;
28 
42 class DVEventInterface : public QObject
43 {
44  Q_OBJECT
45 
46  public:
48  ~DVEventInterface () override = 0;
49  virtual bool mouseDoubleClickEvent (QMouseEvent *event);
50  virtual bool mousePressEvent (QMouseEvent *event);
51  virtual bool mouseMoveEvent (QMouseEvent *event);
52  virtual bool mouseReleaseEvent (QMouseEvent *event);
53  virtual bool wheelEvent (QWheelEvent *event);
54  virtual bool keyPressEvent (QKeyEvent *event);
55  virtual bool KeyReleaseEvent (QKeyEvent *event);
56  virtual bool isRunning () const;
57  virtual bool isFinish () const;
58 
59  signals:
64  void finish();
65 
66  protected:
69  bool m_running;
70  bool m_abort;
71 };
72 
73 #endif // DVEVENTINTERFACE_H
DVEventInterface::KeyReleaseEvent
virtual bool KeyReleaseEvent(QKeyEvent *event)
Definition: dveventinterface.cpp:78
DVEventInterface::mouseMoveEvent
virtual bool mouseMoveEvent(QMouseEvent *event)
Definition: dveventinterface.cpp:44
DVEventInterface::isRunning
virtual bool isRunning() const
Definition: dveventinterface.cpp:83
DVEventInterface::DVEventInterface
DVEventInterface(DiagramView *dv)
Definition: dveventinterface.cpp:22
DVEventInterface::m_diagram
Diagram * m_diagram
Definition: dveventinterface.h:68
DVEventInterface::mouseDoubleClickEvent
virtual bool mouseDoubleClickEvent(QMouseEvent *event)
Definition: dveventinterface.cpp:34
DVEventInterface::mousePressEvent
virtual bool mousePressEvent(QMouseEvent *event)
Definition: dveventinterface.cpp:39
DVEventInterface::mouseReleaseEvent
virtual bool mouseReleaseEvent(QMouseEvent *event)
Definition: dveventinterface.cpp:49
DVEventInterface::~DVEventInterface
~DVEventInterface() override=0
Definition: dveventinterface.cpp:31
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
diagramview.h
DVEventInterface::m_dv
DiagramView * m_dv
Definition: dveventinterface.h:67
dveventinterface.h
DVEventInterface::finish
void finish()
finish emited when the interface finish is work
DVEventInterface::keyPressEvent
virtual bool keyPressEvent(QKeyEvent *event)
DVEventInterface::keyPressEvent By default, press escape key abort the curent action....
Definition: dveventinterface.cpp:66
DVEventInterface::m_abort
bool m_abort
Definition: dveventinterface.h:70
DVEventInterface
The DVEventInterface class This class is the main interface for manage event of a Diagram View....
Definition: dveventinterface.h:43
DiagramView
Definition: diagramview.h:38
DVEventInterface::m_running
bool m_running
Definition: dveventinterface.h:69
DVEventInterface::wheelEvent
virtual bool wheelEvent(QWheelEvent *event)
Definition: dveventinterface.cpp:54
DVEventInterface::isFinish
virtual bool isFinish() const
Definition: dveventinterface.cpp:87