LibrePCB Developers Documentation
symboleditorstate.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_LIBRARY_EDITOR_SYMBOLEDITORSTATE_H
21 #define LIBREPCB_LIBRARY_EDITOR_SYMBOLEDITORSTATE_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "symboleditorfsm.h"
27 
30 
31 #include <QtCore>
32 #include <QtWidgets>
33 
34 /*******************************************************************************
35  * Namespace / Forward Declarations
36  ******************************************************************************/
37 namespace librepcb {
38 namespace library {
39 namespace editor {
40 
41 /*******************************************************************************
42  * Class SymbolEditorState
43  ******************************************************************************/
44 
49 class SymbolEditorState : public QObject {
50  Q_OBJECT
51 
52 public:
54 
55  // Constructors / Destructor
56  SymbolEditorState() = delete;
57  SymbolEditorState(const SymbolEditorState& other) = delete;
58  explicit SymbolEditorState(const Context& context) noexcept;
59  virtual ~SymbolEditorState() noexcept;
60 
61  // General Methods
62  virtual bool entry() noexcept { return true; }
63  virtual bool exit() noexcept { return true; }
64 
65  // Event Handlers
67  QGraphicsSceneMouseEvent& e) noexcept {
68  Q_UNUSED(e);
69  return false;
70  }
72  QGraphicsSceneMouseEvent& e) noexcept {
73  Q_UNUSED(e);
74  return false;
75  }
77  QGraphicsSceneMouseEvent& e) noexcept {
78  Q_UNUSED(e);
79  return false;
80  }
82  QGraphicsSceneMouseEvent& e) noexcept {
83  Q_UNUSED(e);
84  return false;
85  }
87  QGraphicsSceneMouseEvent& e) noexcept {
88  Q_UNUSED(e);
89  return false;
90  }
91  virtual bool processSelectAll() noexcept { return false; }
92  virtual bool processCut() noexcept { return false; }
93  virtual bool processCopy() noexcept { return false; }
94  virtual bool processPaste() noexcept { return false; }
95  virtual bool processRotateCw() noexcept { return false; }
96  virtual bool processRotateCcw() noexcept { return false; }
97  virtual bool processMirror() noexcept { return false; }
98  virtual bool processRemove() noexcept { return false; }
99  virtual bool processAbortCommand() noexcept { return false; }
100 
101  // Operator Overloadings
102  SymbolEditorState& operator=(const SymbolEditorState& rhs) = delete;
103 
104 protected: // Methods
105  const PositiveLength& getGridInterval() const noexcept;
106  const LengthUnit& getDefaultLengthUnit() const noexcept;
107 
108 protected: // Data
110 };
111 
112 /*******************************************************************************
113  * End of File
114  ******************************************************************************/
115 
116 } // namespace editor
117 } // namespace library
118 } // namespace librepcb
119 
120 #endif // LIBREPCB_LIBRARY_EDITOR_SYMBOLEDITORSTATE_H
virtual bool processCopy() noexcept
Definition: symboleditorstate.h:93
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept
Definition: symboleditorstate.h:71
virtual ~SymbolEditorState() noexcept
Definition: symboleditorstate.cpp:47
The SymbolEditorState class is the base class of all symbol editor FSM states.
Definition: symboleditorstate.h:49
const LengthUnit & getDefaultLengthUnit() const noexcept
Definition: symboleditorstate.cpp:58
SymbolEditorState & operator=(const SymbolEditorState &rhs)=delete
virtual bool processPaste() noexcept
Definition: symboleditorstate.h:94
Definition: airwiresbuilder.cpp:32
const PositiveLength & getGridInterval() const noexcept
Definition: symboleditorstate.cpp:54
virtual bool processRemove() noexcept
Definition: symboleditorstate.h:98
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept
Definition: symboleditorstate.h:66
virtual bool processSelectAll() noexcept
Definition: symboleditorstate.h:91
virtual bool processGraphicsSceneLeftMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition: symboleditorstate.h:76
virtual bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition: symboleditorstate.h:86
virtual bool processAbortCommand() noexcept
Definition: symboleditorstate.h:99
virtual bool processRotateCw() noexcept
Definition: symboleditorstate.h:95
virtual bool exit() noexcept
Definition: symboleditorstate.h:63
virtual bool processCut() noexcept
Definition: symboleditorstate.h:92
virtual bool processMirror() noexcept
Definition: symboleditorstate.h:97
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept
Definition: symboleditorstate.h:81
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:794
virtual bool processRotateCcw() noexcept
Definition: symboleditorstate.h:96
Context mContext
Definition: symboleditorstate.h:109
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:62
virtual bool entry() noexcept
Definition: symboleditorstate.h:62