| 1 | /* |
| 2 | Copyright 2006-2023 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 DIAGRAM_TEXT_ITEM_H |
| 19 | #define DIAGRAM_TEXT_ITEM_Hcxx . . $ `sources/qetgraphicsitem/diagramtextitem.h:19:9`! |
| 20 | |
| 21 | #include <QGraphicsTextItem> |
| 22 | #include <QFont> |
| 23 | |
| 24 | class Diagramcxx . . $ Diagram#; |
| 25 | class QDomElementcxx . . $ QDomElement#; |
| 26 | class QDomDocumentcxx . . $ QDomDocument#; |
| 27 | |
| 28 | /** |
| 29 | This class represents a selectable, movable and editable text field on a |
| 30 | diagram. |
| 31 | @see QGraphicsItem::GraphicsItemFlags |
| 32 | */ |
| 33 | class DiagramTextItemcxx . . $ DiagramTextItem# : public QGraphicsTextItemcxx . . $ QGraphicsTextItem# |
| 34 | { |
| 35 | Q_OBJECTcxx . . $ DiagramTextItem#tr(75d9f1c324b4579d). |
| 36 | |
| 37 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QColor color READ color WRITE setColor NOTIFY colorChanged) |
| 38 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) |
| 39 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QString plainText READ toPlainText WRITE setPlainText) |
| 40 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(QFont font READ font WRITE setFont NOTIFY fontChanged) |
| 41 | |
| 42 | |
| 43 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 44 | void colorChangedcxx . . $ DiagramTextItem#colorChanged(406700690822ecf).(QColorcxx . . $ QColor# color); |
| 45 | void alignmentChangedcxx . . $ DiagramTextItem#alignmentChanged(9d0000d583057bbf).(Qtcxx . . $ Qt/::Alignmentcxx . . $ Qt/Alignment# alignment); |
| 46 | void textEditedcxx . . $ DiagramTextItem#textEdited(c1427772cd1877b0).(const QStringcxx . . $ QString# &old_str, const QStringcxx . . $ QString# &new_str); |
| 47 | void fontChangedcxx . . $ DiagramTextItem#fontChanged(19c44da831d1de49).(QFontcxx . . $ QFont# font); |
| 48 | |
| 49 | public: |
| 50 | DiagramTextItemcxx . . $ DiagramTextItem#DiagramTextItem(af50d9c5bfd58279).(QGraphicsItemcxx . . $ QGraphicsItem# * = nullptr); |
| 51 | DiagramTextItemcxx . . $ DiagramTextItem#DiagramTextItem(916db686a46811b8).(const QStringcxx . . $ QString# &, QGraphicsItemcxx . . $ QGraphicsItem# * = nullptr); |
| 52 | |
| 53 | private: |
| 54 | void buildcxx . . $ DiagramTextItem#build(49f6e7a06ebc5aa8).(); |
| 55 | |
| 56 | public: |
| 57 | enumcxx . . $ DiagramTextItem#$anonymous_type_0# { Typecxx . . $ DiagramTextItem#Type. = UserTypecxx . . $ QGraphicsItem#UserType. + 1004 }; |
| 58 | int typecxx . . $ DiagramTextItem#type(455f465bc33b4cdf).() const override { return Typecxx . . $ DiagramTextItem#Type.; } |
| 59 | |
| 60 | Diagramcxx . . $ Diagram# *diagramcxx . . $ DiagramTextItem#diagram(c55c1c4c49f0450c).() const; |
| 61 | virtual void fromXmlcxx . . $ DiagramTextItem#fromXml(d2dcf726a9946ae8).(const QDomElementcxx . . $ QDomElement# &) = 0; |
| 62 | virtual QDomElementcxx . . $ QDomElement# toXmlcxx . . $ DiagramTextItem#toXml(f12f6d4cd5f05c29).(QDomDocumentcxx . . $ QDomDocument# &) const; |
| 63 | void editcxx . . $ DiagramTextItem#edit(49f6e7a06ebc5aa8).(); |
| 64 | |
| 65 | QPointFcxx . . $ QPointF# mapMovementToScenecxx . . $ DiagramTextItem#mapMovementToScene(d99487573c8c6d6c). (const QPointFcxx . . $ QPointF# &) const; |
| 66 | QPointFcxx . . $ QPointF# mapMovementFromScenecxx . . $ DiagramTextItem#mapMovementFromScene(d99487573c8c6d6c). (const QPointFcxx . . $ QPointF# &) const; |
| 67 | QPointFcxx . . $ QPointF# mapMovementToParentcxx . . $ DiagramTextItem#mapMovementToParent(d99487573c8c6d6c). (const QPointFcxx . . $ QPointF# &) const; |
| 68 | QPointFcxx . . $ QPointF# mapMovementFromParentcxx . . $ DiagramTextItem#mapMovementFromParent(d99487573c8c6d6c). (const QPointFcxx . . $ QPointF# &) const; |
| 69 | |
| 70 | void setFontcxx . . $ DiagramTextItem#setFont(d0a4bd0c8524b912).(const QFontcxx . . $ QFont# &font); |
| 71 | |
| 72 | void setColorcxx . . $ DiagramTextItem#setColor(129a55e114526ad3).(const QColorcxx . . $ QColor#& color); |
| 73 | QColorcxx . . $ QColor# colorcxx . . $ DiagramTextItem#color(6d62b116d5d1b12f).() const; |
| 74 | |
| 75 | void setNoEditablecxx . . $ DiagramTextItem#setNoEditable(b45ddcbc8423892c).(bool e = true) {m_no_editablecxx . . $ DiagramTextItem#m_no_editable. = e;} |
| 76 | |
| 77 | void setAlignmentcxx . . $ DiagramTextItem#setAlignment(e897c2bbae899c0c).(const Qtcxx . . $ Qt/::Alignmentcxx . . $ Qt/Alignment# &alignment); |
| 78 | Qtcxx . . $ Qt/::Alignmentcxx . . $ Qt/Alignment# alignmentcxx . . $ DiagramTextItem#alignment(4848e63ca2e325df).() const; |
| 79 | bool m_block_alignmentcxx . . $ DiagramTextItem#m_block_alignment. = false; |
| 80 | |
| 81 | QRectFcxx . . $ QRectF# frameRectcxx . . $ DiagramTextItem#frameRect(19f9350443f914b1).() const; |
| 82 | |
| 83 | void setHtmlcxx . . $ DiagramTextItem#setHtml(3520e46b33348bf6).(const QStringcxx . . $ QString# &text); |
| 84 | void setPlainTextcxx . . $ DiagramTextItem#setPlainText(3520e46b33348bf6).(const QStringcxx . . $ QString# &text); |
| 85 | bool isHtmlcxx . . $ DiagramTextItem#isHtml(50ce9a9e25b4a850).() const; |
| 86 | |
| 87 | protected: |
| 88 | void paintcxx . . $ DiagramTextItem#paint(75fb761ce905ae5).(QPaintercxx . . $ QPainter# *, |
| 89 | const QStyleOptionGraphicsItemcxx . . $ QStyleOptionGraphicsItem# *, |
| 90 | QWidgetcxx . . $ QWidget# *) override; |
| 91 | void focusInEventcxx . . $ DiagramTextItem#focusInEvent(897a5ce4b6676619).(QFocusEventcxx . . $ QFocusEvent# *) override; |
| 92 | void focusOutEventcxx . . $ DiagramTextItem#focusOutEvent(897a5ce4b6676619).(QFocusEventcxx . . $ QFocusEvent# *) override; |
| 93 | |
| 94 | void mouseDoubleClickEventcxx . . $ DiagramTextItem#mouseDoubleClickEvent(11b24ffc11328e2d). (QGraphicsSceneMouseEventcxx . . $ QGraphicsSceneMouseEvent# *event) override; |
| 95 | void mousePressEventcxx . . $ DiagramTextItem#mousePressEvent(11b24ffc11328e2d). (QGraphicsSceneMouseEventcxx . . $ QGraphicsSceneMouseEvent# *event) override; |
| 96 | void mouseMoveEventcxx . . $ DiagramTextItem#mouseMoveEvent(11b24ffc11328e2d). (QGraphicsSceneMouseEventcxx . . $ QGraphicsSceneMouseEvent# *event) override; |
| 97 | void mouseReleaseEventcxx . . $ DiagramTextItem#mouseReleaseEvent(11b24ffc11328e2d). (QGraphicsSceneMouseEventcxx . . $ QGraphicsSceneMouseEvent# *event) override; |
| 98 | |
| 99 | void hoverEnterEventcxx . . $ DiagramTextItem#hoverEnterEvent(763e94a485b44b92).(QGraphicsSceneHoverEventcxx . . $ QGraphicsSceneHoverEvent# *) override; |
| 100 | void hoverLeaveEventcxx . . $ DiagramTextItem#hoverLeaveEvent(763e94a485b44b92).(QGraphicsSceneHoverEventcxx . . $ QGraphicsSceneHoverEvent# *) override; |
| 101 | void hoverMoveEventcxx . . $ DiagramTextItem#hoverMoveEvent(763e94a485b44b92).(QGraphicsSceneHoverEventcxx . . $ QGraphicsSceneHoverEvent# *) override; |
| 102 | |
| 103 | virtual void applyRotationcxx . . $ DiagramTextItem#applyRotation(f371dfa6ad81844c).(const qrealcxx . . $ qreal# &); |
| 104 | void prepareAlignmentcxx . . $ DiagramTextItem#prepareAlignment(49f6e7a06ebc5aa8).(); |
| 105 | void finishAlignmentcxx . . $ DiagramTextItem#finishAlignment(49f6e7a06ebc5aa8).(); |
| 106 | |
| 107 | |
| 108 | protected: |
| 109 | bool |
| 110 | m_mouse_hovercxx . . $ DiagramTextItem#m_mouse_hover. = false, |
| 111 | m_first_movecxx . . $ DiagramTextItem#m_first_move. = true, |
| 112 | m_no_editablecxx . . $ DiagramTextItem#m_no_editable., |
| 113 | m_is_htmlcxx . . $ DiagramTextItem#m_is_html. = false; |
| 114 | |
| 115 | QStringcxx . . $ QString# |
| 116 | m_previous_html_textcxx . . $ DiagramTextItem#m_previous_html_text., |
| 117 | m_previous_textcxx . . $ DiagramTextItem#m_previous_text.; |
| 118 | |
| 119 | QPointFcxx . . $ QPointF# m_mouse_to_origin_movementcxx . . $ DiagramTextItem#m_mouse_to_origin_movement.; |
| 120 | |
| 121 | private: |
| 122 | QRectFcxx . . $ QRectF# m_alignment_rectcxx . . $ DiagramTextItem#m_alignment_rect.; |
| 123 | Qtcxx . . $ Qt/::Alignmentcxx . . $ Qt/Alignment# m_alignmentcxx . . $ DiagramTextItem#m_alignment. = (Qtcxx . . $ Qt/::AlignTopcxx . . $ Qt/AlignTop. |cxx . . $ Qt/`operator|`(6ff00bf3a2570bcb). Qtcxx . . $ Qt/::AlignLeftcxx . . $ Qt/AlignLeft.); |
| 124 | }; |
| 125 | #endif |