LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textgraphicsitem.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_TEXTGRAPHICSITEM_H
21 #define LIBREPCB_TEXTGRAPHICSITEM_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../geometry/text.h"
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 class OriginCrossGraphicsItem;
38 class IF_GraphicsLayerProvider;
39 
40 /*******************************************************************************
41  * Class TextGraphicsItem
42  ******************************************************************************/
43 
49 public:
50  // Constructors / Destructor
51  TextGraphicsItem() = delete;
52  TextGraphicsItem(const TextGraphicsItem& other) = delete;
54  QGraphicsItem* parent = nullptr) noexcept;
55  ~TextGraphicsItem() noexcept;
56 
57  // Getters
58  Text& getText() noexcept { return mText; }
59 
60  // Operator Overloadings
61  TextGraphicsItem& operator=(const TextGraphicsItem& rhs) = delete;
62 
63 private: // Methods
64  void textEdited(const Text& text, Text::Event event) noexcept;
65 
66 private: // Data
69  QScopedPointer<OriginCrossGraphicsItem> mOriginCrossGraphicsItem;
70 
71  // Slots
73 };
74 
75 /*******************************************************************************
76  * End of File
77  ******************************************************************************/
78 
79 } // namespace librepcb
80 
81 #endif // LIBREPCB_TEXTGRAPHICSITEM_H
~TextGraphicsItem() noexcept
Definition: textgraphicsitem.cpp:67
const IF_GraphicsLayerProvider & mLayerProvider
Definition: textgraphicsitem.h:68
TextGraphicsItem & operator=(const TextGraphicsItem &rhs)=delete
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers...
Definition: graphicslayer.h:227
Text & getText() noexcept
Definition: textgraphicsitem.h:58
Event
Definition: text.h:53
QScopedPointer< OriginCrossGraphicsItem > mOriginCrossGraphicsItem
Definition: textgraphicsitem.h:69
Text & mText
Definition: textgraphicsitem.h:67
Text::OnEditedSlot mOnEditedSlot
Definition: textgraphicsitem.h:72
The Text class.
Definition: text.h:48
The TextGraphicsItem class is the graphical representation of a librepcb::Text.
Definition: textgraphicsitem.h:48
void textEdited(const Text &text, Text::Event event) noexcept
Definition: textgraphicsitem.cpp:74
The PrimitiveTextGraphicsItem class is the graphical representation of a text.
Definition: primitivetextgraphicsitem.h:46