LibreOffice Module starmath (master) 1
node.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
62#pragma once
63
64#include "types.hxx"
65#include "token.hxx"
66#include "rect.hxx"
67#include "format.hxx"
68#include "nodetype.hxx"
69
70#include <editeng/editdata.hxx>
71#include <rtl/ustrbuf.hxx>
72
73enum class FontAttribute {
74 None = 0x0000,
75 Bold = 0x0001,
76 Italic = 0x0002
77};
78
79namespace o3tl
80{
81 template<> struct typed_flags<FontAttribute> : is_typed_flags<FontAttribute, 0x0003> {};
82}
83
84
85enum class FontSizeType {
86 ABSOLUT = 1,
87 PLUS = 2,
88 MINUS = 3,
89 MULTIPLY = 4,
90 DIVIDE = 5
91};
92
93// flags to interdict respective status changes
94enum class FontChangeMask {
95 None = 0x0000,
96 Face = 0x0001,
97 Size = 0x0002,
98 Bold = 0x0004,
99 Italic = 0x0008,
100 Color = 0x0010,
101 Phantom = 0x0020
102};
103
104namespace o3tl
105{
106 template<> struct typed_flags<FontChangeMask> : is_typed_flags<FontChangeMask, 0x003f> {};
107}
108
109
110class SmVisitor;
111class SmDocShell;
112class SmNode;
113class SmStructureNode;
114
115typedef std::vector< SmNode * > SmNodeArray;
116
117enum class SmScaleMode
118{
119 None,
120 Width,
121 Height
122};
123
124class SmNode : public SmRect
125{
126 // Rendering info for SmRect
128 // Anclage to the code
131 // Node information
139 // index in accessible text; -1 if not (yet) applicable
140 sal_Int32 mnAccIndex;
141
142protected:
143 SmNode(SmNodeType eNodeType, SmToken aNodeToken);
144
145public:
146 SmNode(const SmNode&) = delete;
147 SmNode& operator=(const SmNode&) = delete;
148
149 virtual ~SmNode();
150
156 virtual bool IsVisible() const = 0;
157
162 virtual size_t GetNumSubNodes() const = 0;
163
169 virtual SmNode * GetSubNode(size_t nIndex) = 0;
170 const SmNode * GetSubNode(size_t nIndex) const
171 { return const_cast<SmNode *>(this)->GetSubNode(nIndex); }
172
173 virtual const SmNode * GetLeftMost() const;
174
180
186
191 bool IsPhantom() const { return mbIsPhantom; }
192
198 void SetPhantom(bool bIsPhantom);
199
205 void SetColor(const Color &rColor);
206
213 void SetAttribute(FontAttribute nAttrib);
214
221 void ClearAttribute(FontAttribute nAttrib);
222
227 const SmFace & GetFont() const { return maFace; };
228 SmFace & GetFont() { return maFace; };
229
235 void SetFont(const SmFace &rFace);
236
244 void SetFontSize(const Fraction &rRelSize, FontSizeType nType);
245
251 void SetSize(const Fraction &rScale);
252
261 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth);
262
268 void PrepareAttributes();
269
278 void SetRectHorAlign(RectHorAlign eHorAlign, bool bApplyToSubTree = true );
279
285
290 const SmRect & GetRect() const { return *this; }
291
297 void Move(const Point &rVector);
298
304 void MoveTo(const Point &rPoint) { Move(rPoint - GetTopLeft()); }
305
312 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) = 0;
313
319 virtual void GetAccessibleText( OUStringBuffer &rText ) const = 0;
320
326 sal_Int32 GetAccessibleIndex() const { return mnAccIndex; }
327
334 void SetAccessibleIndex(sal_Int32 nAccIndex) { mnAccIndex = nAccIndex; }
335
342 const SmNode * FindNodeWithAccessibleIndex(sal_Int32 nAccIndex) const;
343
349 sal_uInt16 GetRow() const { return sal::static_int_cast<sal_uInt16>(m_aESelection.nStartPara); }
350
356 sal_uInt16 GetColumn() const { return sal::static_int_cast<sal_uInt16>(m_aESelection.nStartPos); }
357
363
370
371 //visual stuff TODO comment
372 virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth);
373 virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight);
374
379 SmNodeType GetType() const { return meType; }
380
387 const SmToken & GetToken() const { return maNodeToken; }
389
394 const ESelection& GetSelection() const { return m_aESelection; }
395
400 void SetSelection(ESelection aESelection) { m_aESelection = aESelection; }
401
409 const SmNode * FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const;
410
416 const SmNode * FindRectClosestTo(const Point &rPoint) const;
417
424 virtual void Accept(SmVisitor* pVisitor) = 0;
425
430 bool IsSelected() const {return mbIsSelected;}
431
437 void SetSelected(bool Selected) {mbIsSelected = Selected;}
438
443 const SmStructureNode* GetParent() const { return mpParentNode; }
445
451 void SetParent(SmStructureNode* parent){ mpParentNode = parent; }
452
458 void SetToken(SmToken const & token){ maNodeToken = token; }
459
460private:
462};
463
464
471{
473
474protected:
475 SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken, size_t nSize = 0)
476 : SmNode(eNodeType, rNodeToken)
477 , maSubNodes(nSize) {}
478
479public:
480 virtual ~SmStructureNode() override;
481
487 virtual bool IsVisible() const override;
488
493 virtual size_t GetNumSubNodes() const override;
494
500 using SmNode::GetSubNode;
501 virtual SmNode * GetSubNode(size_t nIndex) override;
502
508 SmNode * GetSubNodeBinMo(size_t nIndex) const;
509
514 void ClearSubNodes();
515
523 void SetSubNodes(std::unique_ptr<SmNode> pFirst, std::unique_ptr<SmNode> pSecond,
524 std::unique_ptr<SmNode> pThird = nullptr);
525
533 void SetSubNodes(SmNode* pFirst, SmNode* pSecond, SmNode* pThird);
534
543 void SetSubNodesBinMo(std::unique_ptr<SmNode> pFirst, std::unique_ptr<SmNode> pSecond,
544 std::unique_ptr<SmNode> pThird = nullptr);
545
551 void SetSubNodes(SmNodeArray&& rNodeArray);
552
558 virtual void GetAccessibleText( OUStringBuffer &rText ) const override;
559
564 SmNodeArray::iterator begin() {return maSubNodes.begin();}
565
570 SmNodeArray::iterator end() {return maSubNodes.end();}
571
576 SmNodeArray::reverse_iterator rbegin() {return maSubNodes.rbegin();}
577
582 SmNodeArray::reverse_iterator rend() {return maSubNodes.rend();}
583
590 int IndexOfSubNode(SmNode const * pSubNode);
591
599 void SetSubNode(size_t nIndex, SmNode* pNode);
600
601private:
603 void ClaimPaternity();
604};
605
606
612class SmVisibleNode : public SmNode
613{
614protected:
615 SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken)
616 : SmNode(eNodeType, rNodeToken) {}
617
618public:
619
625 virtual bool IsVisible() const override;
626
631 virtual size_t GetNumSubNodes() const override;
632
638 using SmNode::GetSubNode;
639 virtual SmNode * GetSubNode(size_t nIndex) override;
640};
641
642
644{
645protected:
646 SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken)
647 : SmVisibleNode(eNodeType, rNodeToken) {}
648
649public:
650
656 virtual void GetAccessibleText( OUStringBuffer &rText ) const override;
657};
658
659
664class SmRectangleNode final : public SmGraphicNode
665{
667
668public:
669 explicit SmRectangleNode(const SmToken &rNodeToken)
670 : SmGraphicNode(SmNodeType::Rectangle, rNodeToken)
671 {}
672
673 //visual stuff TODO comment
674 virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override;
675 virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override;
676
683 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
684
691 void Accept(SmVisitor* pVisitor) override;
692};
693
694
699class SmPolyLineNode final : public SmGraphicNode
700{
704
705public:
706 explicit SmPolyLineNode(const SmToken &rNodeToken);
707
712 tools::Long GetWidth() const { return mnWidth; }
713
719
720 //visual stuff TODO comment
721 virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override;
722 virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override;
723
730 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
731
738 void Accept(SmVisitor* pVisitor) override;
739};
740
741
747{
748 OUString maText;
749 sal_uInt16 mnFontDesc;
757 sal_Int32 mnSelectionEnd;
758
759protected:
760 SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP );
761
762public:
763 SmTextNode(const SmToken &rNodeToken, sal_uInt16 nFontDescP );
764
769 sal_uInt16 GetFontDesc() const { return mnFontDesc; }
770
776 void SetText(const OUString &rText) { maText = rText; }
777
782 const OUString & GetText() const { return maText; }
783 OUString & GetText() { return maText; }
784
790 void ChangeText(const OUString &rText);
791
796 void AdjustFontDesc();
797
803 sal_Int32 GetSelectionStart() const { return mnSelectionStart; }
804
810 sal_Int32 GetSelectionEnd() const {return mnSelectionEnd; }
811
817 void SetSelectionStart(sal_Int32 index) {mnSelectionStart = index;}
818
824 void SetSelectionEnd(sal_Int32 index) {mnSelectionEnd = index;}
825
834 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
835 int nDepth) override;
836
843 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
844
850 virtual void GetAccessibleText( OUStringBuffer &rText ) const override;
851
858 void Accept(SmVisitor* pVisitor) override;
859
867};
868
869
878{
880
881protected:
882 SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 _nFontDesc);
883
884public:
885 explicit SmSpecialNode(const SmToken &rNodeToken);
886
895 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
896 int nDepth) override;
897
904 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
905
912 void Accept(SmVisitor* pVisitor) override;
913};
914
915
926{
927public:
928 explicit SmGlyphSpecialNode(const SmToken &rNodeToken)
930 {}
931
938 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
939
946 void Accept(SmVisitor* pVisitor) override;
947};
948
949
955{
956protected:
957 SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken)
958 : SmSpecialNode(eNodeType, rNodeToken, FNT_MATH)
959 {
960 SetText(GetToken().cMathChar);
961 }
962
963public:
964 explicit SmMathSymbolNode(const SmToken &rNodeToken);
965
966 //visual stuff TODO comment
967 virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override;
968 virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override;
969
978 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
979 int nDepth) override;
980
987 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
988
995 void Accept(SmVisitor* pVisitor) override;
996};
997
998
1006{
1007public:
1008 explicit SmMathIdentifierNode(const SmToken &rNodeToken)
1009 : SmMathSymbolNode(SmNodeType::MathIdent, rNodeToken) {}
1010};
1011
1012
1020{
1021 sal_uLong mnBodyWidth; // width of body (argument) of root sign
1022
1023public:
1024 explicit SmRootSymbolNode(const SmToken &rNodeToken)
1025 : SmMathSymbolNode(SmNodeType::RootSymbol, rNodeToken)
1026 , mnBodyWidth(0) { }
1027
1034
1035 //visual stuff TODO comment
1036 virtual void AdaptToX(OutputDevice &rDev, sal_uLong nHeight) override;
1037 virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override;
1038
1045 void Accept(SmVisitor* pVisitor) override;
1046};
1047
1048
1055class SmPlaceNode final : public SmMathSymbolNode
1056{
1057public:
1058 explicit SmPlaceNode(const SmToken &rNodeToken)
1059 : SmMathSymbolNode(SmNodeType::Place, rNodeToken) { }
1061
1070 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
1071 int nDepth) override;
1072
1079 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1080
1087 void Accept(SmVisitor* pVisitor) override;
1088};
1089
1090
1096class SmErrorNode final : public SmMathSymbolNode
1097{
1098public:
1099 explicit SmErrorNode(const SmToken &rNodeToken)
1100 : SmMathSymbolNode(SmNodeType::Error, rNodeToken) { SetText(OUString(MS_ERROR)); }
1101
1110 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
1111 int nDepth) override;
1112
1119 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1120
1127 void Accept(SmVisitor* pVisitor) override;
1128};
1129
1130
1138class SmTableNode final : public SmStructureNode
1139{
1141public:
1142 explicit SmTableNode(const SmToken &rNodeToken)
1143 : SmStructureNode(SmNodeType::Table, rNodeToken)
1144 , mnFormulaBaseline(0) { }
1145
1146 virtual const SmNode * GetLeftMost() const override;
1147
1154 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1155
1161
1168 void Accept(SmVisitor* pVisitor) override;
1169};
1170
1171
1178{
1180
1181protected:
1182 SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken)
1183 : SmStructureNode(eNodeType, rNodeToken)
1184 , mbUseExtraSpaces(true) { }
1185
1186public:
1187 explicit SmLineNode(const SmToken &rNodeToken)
1188 : SmStructureNode(SmNodeType::Line, rNodeToken)
1189 , mbUseExtraSpaces(true) { }
1190
1198 void SetUseExtraSpaces(bool bVal) { mbUseExtraSpaces = bVal; }
1199
1206 bool IsUseExtraSpaces() const { return mbUseExtraSpaces; };
1207
1216 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
1217 int nDepth) override;
1218
1225 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1226
1233 void Accept(SmVisitor* pVisitor) override;
1234};
1235
1236
1243class SmExpressionNode final : public SmLineNode
1244{
1245public:
1246 explicit SmExpressionNode(const SmToken &rNodeToken)
1247 : SmLineNode(SmNodeType::Expression, rNodeToken) { }
1248
1255 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1256
1263 void Accept(SmVisitor* pVisitor) override;
1264};
1265
1266
1271class SmUnHorNode final : public SmStructureNode
1272{
1273public:
1274 explicit SmUnHorNode(const SmToken &rNodeToken)
1275 : SmStructureNode(SmNodeType::UnHor, rNodeToken, 2) { }
1276
1283 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1284
1291 void Accept(SmVisitor* pVisitor) override;
1292};
1293
1294
1306class SmRootNode final : public SmStructureNode
1307{
1308public:
1309 explicit SmRootNode(const SmToken &rNodeToken)
1310 : SmStructureNode(SmNodeType::Root, rNodeToken, 3) { }
1311
1318 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1319
1326 void Accept(SmVisitor* pVisitor) override;
1327
1332 const SmNode* Argument() const { return const_cast<SmRootNode *>(this)->Argument(); }
1333 SmNode* Argument() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1334
1339 const SmRootSymbolNode* Symbol() const { return const_cast<SmRootNode *>(this)->Symbol(); }
1341 assert( GetSubNode( 1 )->GetType()
1343 return static_cast< SmRootSymbolNode* >
1344 ( GetSubNode( 1 )); }
1345
1350 const SmNode* Body() const { return const_cast<SmRootNode *>(this)->Body(); }
1351 SmNode* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1352
1353};
1354
1355
1367class SmBinHorNode final : public SmStructureNode
1368{
1369public:
1370 explicit SmBinHorNode(const SmToken &rNodeToken)
1371 : SmStructureNode(SmNodeType::BinHor, rNodeToken, 3) { }
1372
1379 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1380
1387 void Accept(SmVisitor* pVisitor) override;
1388
1393 const SmNode* Symbol() const { return const_cast<SmBinHorNode *>(this)->Symbol(); }
1394 SmNode* Symbol() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 1 ); }
1395
1400 const SmNode* LeftOperand() const { return const_cast<SmBinHorNode *>(this)->LeftOperand(); }
1401 SmNode* LeftOperand() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1402
1407 const SmNode* RightOperand() const { return const_cast<SmBinHorNode *>(this)->RightOperand(); }
1408 SmNode* RightOperand() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1409};
1410
1411
1424class SmBinVerNode final : public SmStructureNode
1425{
1426public:
1427 explicit SmBinVerNode(const SmToken &rNodeToken)
1428 : SmStructureNode(SmNodeType::BinVer, rNodeToken, 3) { }
1429
1430 virtual const SmNode * GetLeftMost() const override;
1431
1438 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1439
1446 void Accept(SmVisitor* pVisitor) override;
1447};
1448
1449
1461{
1463
1472 void GetOperPosSize(Point &rPos, Size &rSize, const Point &rDiagPoint, double fAngleDeg) const;
1473
1474public:
1475 explicit SmBinDiagonalNode(const SmToken &rNodeToken)
1476 : SmStructureNode(SmNodeType::BinDiagonal, rNodeToken, 3)
1477 , mbAscending(false) { }
1478
1491 bool IsAscending() const { return mbAscending; }
1492
1498 void SetAscending(bool bVal) { mbAscending = bVal; }
1499
1506 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1507
1514 void Accept(SmVisitor* pVisitor) override;
1515};
1516
1517
1538
1542#define SUBSUP_NUM_ENTRIES 6
1543
1558class SmSubSupNode final : public SmStructureNode
1559{
1561
1562public:
1563 explicit SmSubSupNode(const SmToken &rNodeToken)
1565 , mbUseLimits(false) { }
1566
1571 const SmNode * GetBody() const { return const_cast<SmSubSupNode *>(this)->GetBody(); }
1572 SmNode * GetBody() { return GetSubNode(0); }
1573
1579 bool IsUseLimits() const { return mbUseLimits; };
1580
1586 void SetUseLimits(bool bVal) { mbUseLimits = bVal; }
1587
1595 const SmNode * GetSubSup(SmSubSup eSubSup) const { return const_cast< SmSubSupNode* >
1596 ( this )->GetSubSup( eSubSup ); }
1597 SmNode * GetSubSup(SmSubSup eSubSup) { return GetSubNode(1 + eSubSup); };
1598
1603 void SetBody(SmNode* pBody) { SetSubNode(0, pBody); }
1604
1611 void SetSubSup(SmSubSup eSubSup, SmNode* pScript) { SetSubNode( 1 + eSubSup, pScript); }
1612
1619 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1620
1627 void Accept(SmVisitor* pVisitor) override;
1628
1629};
1630
1631
1645class SmBraceNode final : public SmStructureNode
1646{
1647public:
1648 explicit SmBraceNode(const SmToken &rNodeToken)
1649 : SmStructureNode(SmNodeType::Brace, rNodeToken, 3) { }
1650
1655 const SmMathSymbolNode* OpeningBrace() const { return const_cast<SmBraceNode *>
1656 (this)->OpeningBrace(); }
1658 assert( GetSubNode( 0 )->GetType()
1659 == SmNodeType::Math );
1660 return static_cast< SmMathSymbolNode* >
1661 ( GetSubNode( 0 )); }
1662
1667 const SmNode* Body() const { return const_cast<SmBraceNode *>(this)->Body(); }
1668 SmNode* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 1 ); }
1669
1674 const SmMathSymbolNode* ClosingBrace() const { return const_cast<SmBraceNode *>
1675 (this)->ClosingBrace(); }
1677 assert( GetSubNode( 2 )->GetType()
1678 == SmNodeType::Math );
1679 return static_cast< SmMathSymbolNode* >
1680 ( GetSubNode( 2 )); }
1681
1688 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1689
1696 void Accept(SmVisitor* pVisitor) override;
1697};
1698
1699
1710{
1712
1713public:
1714 explicit SmBracebodyNode(const SmToken &rNodeToken)
1715 : SmStructureNode(SmNodeType::Bracebody, rNodeToken)
1716 , mnBodyHeight(0) { }
1717
1724 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1726
1733 void Accept(SmVisitor* pVisitor) override;
1734};
1735
1736
1750{
1751public:
1752 explicit SmVerticalBraceNode(const SmToken &rNodeToken)
1753 : SmStructureNode(SmNodeType::VerticalBrace, rNodeToken, 3) { }
1754
1760 const SmNode* Body() const { return const_cast<SmVerticalBraceNode *>(this)->Body(); }
1761 SmNode* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1762
1767 const SmMathSymbolNode* Brace() const { return const_cast<SmVerticalBraceNode *>
1768 (this)->Brace(); }
1770 assert( GetSubNode( 1 )->GetType()
1771 == SmNodeType::Math );
1772 return static_cast< SmMathSymbolNode* >
1773 ( GetSubNode( 1 )); }
1774
1780 const SmNode* Script() const { return const_cast<SmVerticalBraceNode *>(this)->Script(); }
1781 SmNode* Script() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1782
1789 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1790
1797 void Accept(SmVisitor* pVisitor) override;
1798};
1799
1810class SmOperNode final : public SmStructureNode
1811{
1812public:
1813 explicit SmOperNode(const SmToken &rNodeToken)
1814 : SmStructureNode(SmNodeType::Oper, rNodeToken, 2) { }
1815
1820 const SmNode * GetSymbol() const { return const_cast<SmOperNode *>(this)->GetSymbol(); }
1821 SmNode * GetSymbol();
1822
1831 tools::Long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const;
1832
1839 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1840
1847 void Accept(SmVisitor* pVisitor) override;
1848};
1849
1850
1855class SmAlignNode final : public SmStructureNode
1856{
1857public:
1858 explicit SmAlignNode(const SmToken &rNodeToken)
1859 : SmStructureNode(SmNodeType::Align, rNodeToken) { }
1860
1867 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1868
1875 void Accept(SmVisitor* pVisitor) override;
1876};
1877
1878
1890{
1891public:
1892 explicit SmAttributeNode(const SmToken &rNodeToken)
1893 : SmStructureNode(SmNodeType::Attribute, rNodeToken, 2) {}
1894
1901 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1902
1909 void Accept(SmVisitor* pVisitor) override;
1910
1915 const SmNode* Attribute() const { return const_cast<SmAttributeNode *>(this)->Attribute(); }
1916 SmNode* Attribute() { assert( GetNumSubNodes() == 2 ); return GetSubNode( 0 ); }
1917
1922 const SmNode* Body() const { return const_cast<SmAttributeNode *>(this)->Body(); }
1923 SmNode* Body() { assert( GetNumSubNodes() == 2 ); return GetSubNode( 1 ); }
1924};
1925
1926
1931class SmFontNode final : public SmStructureNode
1932{
1935
1936public:
1937 explicit SmFontNode(const SmToken &rNodeToken)
1938 : SmStructureNode(SmNodeType::Font, rNodeToken)
1940 , maFontSize(1) { }
1941
1949 void SetSizeParameter(const Fraction &rValue, FontSizeType nType)
1950 { meSizeType = nType; maFontSize = rValue; }
1951
1956 const Fraction & GetSizeParameter() const {return maFontSize;}
1957
1964
1973 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
1974 int nDepth) override;
1975
1982 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
1983
1990 void Accept(SmVisitor* pVisitor) override;
1991};
1992
1993
1999class SmMatrixNode final : public SmStructureNode
2000{
2001 sal_uInt16 mnNumRows,
2003
2004public:
2005 explicit SmMatrixNode(const SmToken &rNodeToken)
2006 : SmStructureNode(SmNodeType::Matrix, rNodeToken)
2007 , mnNumRows(0)
2008 , mnNumCols(0) { }
2009
2014 sal_uInt16 GetNumRows() const {return mnNumRows;}
2015
2020 sal_uInt16 GetNumCols() const {return mnNumCols;}
2021
2028 void SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols)
2029 { mnNumRows = nMatrixRows; mnNumCols = nMatrixCols; }
2030
2031 virtual const SmNode * GetLeftMost() const override;
2032
2039 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
2040
2047 void Accept(SmVisitor* pVisitor) override;
2048};
2049
2050
2055class SmBlankNode final : public SmGraphicNode
2056{
2057 sal_uInt16 mnNum;
2058
2059public:
2060 explicit SmBlankNode(const SmToken &rNodeToken)
2061 : SmGraphicNode(SmNodeType::Blank, rNodeToken)
2062 , mnNum(0) { }
2063
2064 void IncreaseBy(const SmToken &rToken, sal_uInt32 nMultiplyBy = 1);
2065 void Clear() { mnNum = 0; }
2066 sal_uInt16 GetBlankNum() const { return mnNum; }
2067 void SetBlankNum(sal_uInt16 nNumber) { mnNum = nNumber; }
2068
2077 virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell,
2078 int nDepth) override;
2079
2086 virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
2087
2094 void Accept(SmVisitor* pVisitor) override;
2095
2096};
2097
2098/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Node used for alignment.
Definition: node.hxx:1856
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1566
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2375
SmAlignNode(const SmToken &rNodeToken)
Definition: node.hxx:1858
Attribute node.
Definition: node.hxx:1890
SmAttributeNode(const SmToken &rNodeToken)
Definition: node.hxx:1892
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1594
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2379
SmNode * Body()
Definition: node.hxx:1923
const SmNode * Body() const
Gets the body data ( the nodes affected by the attribute ).
Definition: node.hxx:1922
const SmNode * Attribute() const
Gets the attribute data.
Definition: node.hxx:1915
SmNode * Attribute()
Definition: node.hxx:1916
Binary diagonal node.
Definition: node.hxx:1461
void GetOperPosSize(Point &rPos, Size &rSize, const Point &rDiagPoint, double fAngleDeg) const
Returns the position and size of the diagonal line by reference.
Definition: node.cxx:974
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2399
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1085
bool IsAscending() const
Checks if it is of ascending type.
Definition: node.hxx:1491
void SetAscending(bool bVal)
Sets if the wideslash is ascending to bVal.
Definition: node.hxx:1498
SmBinDiagonalNode(const SmToken &rNodeToken)
Definition: node.hxx:1475
Binary horizontal node.
Definition: node.hxx:1368
const SmNode * Symbol() const
Returns the node containing the data of the binary operator.
Definition: node.hxx:1393
SmNode * RightOperand()
Definition: node.hxx:1408
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:795
SmBinHorNode(const SmToken &rNodeToken)
Definition: node.hxx:1370
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2391
const SmNode * LeftOperand() const
Returns the node containing the data of the left operand.
Definition: node.hxx:1400
const SmNode * RightOperand() const
Returns the node containing the data of the right operand.
Definition: node.hxx:1407
SmNode * Symbol()
Definition: node.hxx:1394
SmNode * LeftOperand()
Definition: node.hxx:1401
Binary horizontal node.
Definition: node.hxx:1425
SmBinVerNode(const SmToken &rNodeToken)
Definition: node.hxx:1427
virtual const SmNode * GetLeftMost() const override
(this assumes the one with index 0 is always the leftmost subnode for the current node).
Definition: node.cxx:897
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2395
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:840
Node for whitespace.
Definition: node.hxx:2056
sal_uInt16 GetBlankNum() const
Definition: node.hxx:2066
void Clear()
Definition: node.hxx:2065
sal_uInt16 mnNum
Definition: node.hxx:2057
void IncreaseBy(const SmToken &rToken, sal_uInt32 nMultiplyBy=1)
Definition: node.cxx:2314
SmBlankNode(const SmToken &rNodeToken)
Definition: node.hxx:2060
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2431
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:2325
void SetBlankNum(sal_uInt16 nNumber)
Definition: node.hxx:2067
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:2337
Node for brace construction.
Definition: node.hxx:1646
SmMathSymbolNode * ClosingBrace()
Definition: node.hxx:1676
const SmMathSymbolNode * OpeningBrace() const
Returns the node containing the data of the opening brace.
Definition: node.hxx:1655
SmBraceNode(const SmToken &rNodeToken)
Definition: node.hxx:1648
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1265
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2363
SmMathSymbolNode * OpeningBrace()
Definition: node.hxx:1657
const SmNode * Body() const
Returns the node containing the data of what is between braces.
Definition: node.hxx:1667
const SmMathSymbolNode * ClosingBrace() const
Returns the node containing the data of the closing brace.
Definition: node.hxx:1674
SmNode * Body()
Definition: node.hxx:1668
Body of an SmBraceNode.
Definition: node.hxx:1710
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1358
tools::Long mnBodyHeight
Definition: node.hxx:1711
SmBracebodyNode(const SmToken &rNodeToken)
Definition: node.hxx:1714
tools::Long GetBodyHeight() const
Definition: node.hxx:1725
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2367
Error node, for parsing errors.
Definition: node.hxx:1097
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2435
SmErrorNode(const SmToken &rNodeToken)
Definition: node.hxx:1099
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:2291
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:2301
Expression node.
Definition: node.hxx:1244
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2443
SmExpressionNode(const SmToken &rNodeToken)
Definition: node.hxx:1246
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:659
Font node.
Definition: node.hxx:1932
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1655
void SetSizeParameter(const Fraction &rValue, FontSizeType nType)
Sets font size to rValue in nType mode.
Definition: node.hxx:1949
FontSizeType meSizeType
Definition: node.hxx:1933
SmFontNode(const SmToken &rNodeToken)
Definition: node.hxx:1937
Fraction maFontSize
Definition: node.hxx:1934
const Fraction & GetSizeParameter() const
Returns the font size.
Definition: node.hxx:1956
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2383
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:1631
FontSizeType GetSizeType() const
Returns the font size type.
Definition: node.hxx:1963
Glyph node for custom operators.
Definition: node.hxx:926
SmGlyphSpecialNode(const SmToken &rNodeToken)
Definition: node.hxx:928
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2423
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:2253
SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken)
Definition: node.hxx:646
virtual void GetAccessibleText(OUStringBuffer &rText) const override
Appends to rText the node text.
Definition: node.cxx:508
A line.
Definition: node.hxx:1178
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:600
bool mbUseExtraSpaces
Definition: node.hxx:1179
void SetUseExtraSpaces(bool bVal)
Sets if it going to use extra spaces.
Definition: node.hxx:1198
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2439
SmLineNode(const SmToken &rNodeToken)
Definition: node.hxx:1187
SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken)
Definition: node.hxx:1182
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:586
bool IsUseExtraSpaces() const
Checks if it is using extra spaces.
Definition: node.hxx:1206
Math Identifier.
Definition: node.hxx:1006
SmMathIdentifierNode(const SmToken &rNodeToken)
Definition: node.hxx:1008
Math symbol node.
Definition: node.hxx:955
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
Definition: node.cxx:2070
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:2108
SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken)
Definition: node.hxx:957
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override
Definition: node.cxx:2047
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:2124
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2427
Matrix node.
Definition: node.hxx:2000
SmMatrixNode(const SmToken &rNodeToken)
Definition: node.hxx:2005
sal_uInt16 mnNumRows
Definition: node.hxx:2001
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1934
void SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols)
Sets the dimensions of the matrix.
Definition: node.hxx:2028
sal_uInt16 GetNumRows() const
Gets the number of rows of the matrix.
Definition: node.hxx:2014
virtual const SmNode * GetLeftMost() const override
(this assumes the one with index 0 is always the leftmost subnode for the current node).
Definition: node.cxx:2032
sal_uInt16 GetNumCols() const
Gets the number of columns of the matrix.
Definition: node.hxx:2020
sal_uInt16 mnNumCols
Definition: node.hxx:2002
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2407
Definition: node.hxx:125
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight)
Definition: node.cxx:246
FontAttribute mnAttributes
Definition: node.hxx:136
FontAttribute & Attributes()
Gets the font attributes.
Definition: node.hxx:185
sal_Int32 GetAccessibleIndex() const
Gets the node accessible index.
Definition: node.hxx:326
SmNodeType meType
Definition: node.hxx:132
SmStructureNode * mpParentNode
Definition: node.hxx:461
void SetAttribute(FontAttribute nAttrib)
Sets the font attribute nAttrib.
Definition: node.cxx:97
SmFace maFace
Definition: node.hxx:127
bool mbIsPhantom
Definition: node.hxx:137
void SetSize(const Fraction &rScale)
Sets the font size to rRelSize with type FontSizeType::ABSOLUT.
Definition: node.cxx:183
void Move(const Point &rVector)
Moves the rectangle by rVector.
Definition: node.cxx:231
SmNode(SmNodeType eNodeType, SmToken aNodeToken)
Definition: node.cxx:48
void SetSelection(ESelection aESelection)
Gets node position in input text.
Definition: node.hxx:400
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat)=0
Prepares the SmRect to render.
virtual ~SmNode()
Definition: node.cxx:62
SmScaleMode GetScaleMode() const
Gets the scale mode.
Definition: node.hxx:362
virtual bool IsVisible() const =0
Checks node visibility.
void SetFont(const SmFace &rFace)
Sets the font to rFace.
Definition: node.cxx:125
SmStructureNode * GetParent()
Definition: node.hxx:444
RectHorAlign GetRectHorAlign() const
Gets the alignment of the text.
Definition: node.hxx:284
void SetFontSize(const Fraction &rRelSize, FontSizeType nType)
Sets the font size to rRelSize with type nType.
Definition: node.cxx:133
FontChangeMask mnFlags
Definition: node.hxx:135
const SmNode * GetSubNode(size_t nIndex) const
Definition: node.hxx:170
const SmNode * FindRectClosestTo(const Point &rPoint) const
Finds the closest rectangle in the screen.
Definition: node.cxx:280
const SmRect & GetRect() const
Parses itself to SmRect.
Definition: node.hxx:290
virtual void Accept(SmVisitor *pVisitor)=0
Accept a visitor.
void SetAccessibleIndex(sal_Int32 nAccIndex)
Sets the node accessible index to nAccIndex.
Definition: node.hxx:334
SmNode(const SmNode &)=delete
void PrepareAttributes()
Prepare preliminary font attributes Called on Prepare(...).
Definition: node.cxx:200
virtual size_t GetNumSubNodes() const =0
Gets the number of subnodes.
ESelection m_aESelection
Definition: node.hxx:130
RectHorAlign meRectHorAlign
Definition: node.hxx:134
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth)
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:207
void SetPhantom(bool bIsPhantom)
Sets the render visibility of a visible node to bIsPhantom.
Definition: node.cxx:78
const SmToken & GetToken() const
Gets the token.
Definition: node.hxx:387
sal_uInt16 GetRow() const
Gets the line in the text where the node is located.
Definition: node.hxx:349
SmToken & GetToken()
Definition: node.hxx:388
SmNode & operator=(const SmNode &)=delete
virtual const SmNode * GetLeftMost() const
(this assumes the one with index 0 is always the leftmost subnode for the current node).
Definition: node.cxx:66
void ClearAttribute(FontAttribute nAttrib)
Clears the font attribute nAttrib.
Definition: node.cxx:111
void SetParent(SmStructureNode *parent)
Sets the parent node.
Definition: node.hxx:451
sal_Int32 mnAccIndex
Definition: node.hxx:140
void MoveTo(const Point &rPoint)
Moves the rectangle to rPoint, being the top left corner the origin.
Definition: node.hxx:304
const SmNode * FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const
Finds the node from the position in the text.
Definition: node.cxx:251
bool mbIsSelected
Definition: node.hxx:138
virtual void GetAccessibleText(OUStringBuffer &rText) const =0
Appends to rText the node text.
SmScaleMode meScaleMode
Definition: node.hxx:133
virtual SmNode * GetSubNode(size_t nIndex)=0
Gets the subnode of index nIndex.
bool IsSelected() const
Checks if the node is selected.
Definition: node.hxx:430
SmFace & GetFont()
Definition: node.hxx:228
void SetScaleMode(SmScaleMode eMode)
Sets the scale mode to eMode.
Definition: node.hxx:369
const SmNode * FindNodeWithAccessibleIndex(sal_Int32 nAccIndex) const
Finds the node with accessible index nAccIndex.
Definition: node.cxx:322
const SmStructureNode * GetParent() const
Gets the parent node of this node.
Definition: node.hxx:443
void SetRectHorAlign(RectHorAlign eHorAlign, bool bApplyToSubTree=true)
Sets the alignment of the text.
Definition: node.cxx:191
const ESelection & GetSelection() const
Gets node position in input text.
Definition: node.hxx:394
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth)
Definition: node.cxx:241
sal_uInt16 GetColumn() const
Gets the column of the line in the text where the node is located.
Definition: node.hxx:356
void SetColor(const Color &rColor)
Sets the font color.
Definition: node.cxx:88
SmNodeType GetType() const
Gets the node type.
Definition: node.hxx:379
FontChangeMask & Flags()
Gets the FontChangeMask flags.
Definition: node.hxx:179
const SmFace & GetFont() const
Gets the font.
Definition: node.hxx:227
bool IsPhantom() const
Checks if it is a visible node rendered invisible.
Definition: node.hxx:191
void SetSelected(bool Selected)
Sets the node to Selected.
Definition: node.hxx:437
SmToken maNodeToken
Definition: node.hxx:129
void SetToken(SmToken const &token)
Sets the token for this node.
Definition: node.hxx:458
Operation Node.
Definition: node.hxx:1811
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2371
SmOperNode(const SmToken &rNodeToken)
Definition: node.hxx:1813
tools::Long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const
Returns the height of the node in base to the symbol ( rSymbol contains the operator data ) and the f...
Definition: node.cxx:1496
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1524
const SmNode * GetSymbol() const
Returns the node with the operator data.
Definition: node.hxx:1820
Place node.
Definition: node.hxx:1056
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2411
SmPlaceNode(const SmToken &rNodeToken)
Definition: node.hxx:1058
SmPlaceNode()
Definition: node.hxx:1060
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:2277
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:2268
Polygon line node.
Definition: node.hxx:700
tools::Long mnWidth
Definition: node.hxx:703
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1723
tools::Polygon maPoly
Definition: node.hxx:701
Size maToSize
Definition: node.hxx:702
tools::Long GetWidth() const
Gets the width of the rect.
Definition: node.hxx:712
tools::Polygon & GetPolygon()
Gets the polygon to draw the node.
Definition: node.hxx:718
SmPolyLineNode(const SmToken &rNodeToken)
Definition: node.cxx:1702
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
Definition: node.cxx:1716
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override
Definition: node.cxx:1710
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2447
Definition: rect.hxx:84
const Point & GetTopLeft() const
Definition: rect.hxx:124
Draws a rectangle.
Definition: node.hxx:665
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2459
SmRectangleNode(const SmToken &rNodeToken)
Definition: node.hxx:669
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override
Definition: node.cxx:1781
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1794
Size maToSize
Definition: node.hxx:666
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
Definition: node.cxx:1787
Root node.
Definition: node.hxx:1307
SmNode * Argument()
Definition: node.hxx:1333
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:740
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2451
const SmNode * Body() const
Returns the node containing the data inside the root.
Definition: node.hxx:1350
SmRootSymbolNode * Symbol()
Definition: node.hxx:1340
const SmRootSymbolNode * Symbol() const
Returns the node containing the data of the character used for the root.
Definition: node.hxx:1339
const SmNode * Argument() const
Returns the node containing the data of the order of the root.
Definition: node.hxx:1332
SmNode * Body()
Definition: node.hxx:1351
SmRootNode(const SmToken &rNodeToken)
Definition: node.hxx:1309
Root symbol node.
Definition: node.hxx:1020
SmRootSymbolNode(const SmToken &rNodeToken)
Definition: node.hxx:1024
sal_uLong mnBodyWidth
Definition: node.hxx:1021
sal_uLong GetBodyWidth() const
Gets the body width.
Definition: node.hxx:1033
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2455
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nHeight) override
Definition: node.cxx:1764
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
Definition: node.cxx:1770
Special node for user defined characters.
Definition: node.hxx:878
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2419
SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 _nFontDesc)
Definition: node.cxx:2162
bool mbIsFromGreekSymbolSet
Definition: node.hxx:879
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:2240
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:2176
Abstract baseclass for all composite node.
Definition: node.hxx:471
virtual ~SmStructureNode() override
Definition: node.cxx:353
SmNodeArray::reverse_iterator rend()
Gets the first subnode.
Definition: node.hxx:582
void SetSubNodesBinMo(std::unique_ptr< SmNode > pFirst, std::unique_ptr< SmNode > pSecond, std::unique_ptr< SmNode > pThird=nullptr)
Sets subnodes, used for operators.
Definition: node.cxx:392
int IndexOfSubNode(SmNode const *pSubNode)
Get the index of the child node pSubNode.
Definition: node.cxx:468
void ClaimPaternity()
Sets parent on children of this node.
Definition: node.cxx:463
SmNode * GetSubNodeBinMo(size_t nIndex) const
Gets the subnode of index nIndex, used for operators.
Definition: node.cxx:440
virtual size_t GetNumSubNodes() const override
Gets the number of subnodes.
Definition: node.cxx:430
SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken, size_t nSize=0)
Definition: node.hxx:475
SmNodeArray maSubNodes
Definition: node.hxx:472
virtual void GetAccessibleText(OUStringBuffer &rText) const override
Appends to rText the node text.
Definition: node.cxx:452
void SetSubNodes(std::unique_ptr< SmNode > pFirst, std::unique_ptr< SmNode > pSecond, std::unique_ptr< SmNode > pThird=nullptr)
Sets subnodes, used for operators.
Definition: node.cxx:364
virtual SmNode * GetSubNode(size_t nIndex) override
Gets the subnode of index nIndex.
Definition: node.cxx:435
SmNodeArray::reverse_iterator rbegin()
Gets the last subnode.
Definition: node.hxx:576
SmNodeArray::iterator begin()
Gets the first subnode.
Definition: node.hxx:564
SmNodeArray::iterator end()
Gets the last subnode.
Definition: node.hxx:570
void SetSubNode(size_t nIndex, SmNode *pNode)
Sets the subnode pNode at nIndex.
Definition: node.cxx:477
void ClearSubNodes()
Does the cleaning of the subnodes.
Definition: node.cxx:359
virtual bool IsVisible() const override
Checks node visibility.
Definition: node.cxx:425
Super- and subscript node.
Definition: node.hxx:1559
SmNode * GetBody()
Definition: node.hxx:1572
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2403
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1152
void SetUseLimits(bool bVal)
Sets if it is going to be used for a limit to bVal.
Definition: node.hxx:1586
const SmNode * GetBody() const
Returns the node with the data of what has to be superindex or subindex.
Definition: node.hxx:1571
SmSubSupNode(const SmToken &rNodeToken)
Definition: node.hxx:1563
void SetSubSup(SmSubSup eSubSup, SmNode *pScript)
Sets the node with the data of what has to be superindex or subindex.
Definition: node.hxx:1611
SmNode * GetSubSup(SmSubSup eSubSup)
Definition: node.hxx:1597
const SmNode * GetSubSup(SmSubSup eSubSup) const
Gets the node with the data of what has to be superindex or subindex.
Definition: node.hxx:1595
bool mbUseLimits
Definition: node.hxx:1560
void SetBody(SmNode *pBody)
Sets the node with the data of what has to be superindex or subindex.
Definition: node.hxx:1603
bool IsUseLimits() const
Checks if it is going to be used for a limit.
Definition: node.hxx:1579
Table node.
Definition: node.hxx:1139
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:513
virtual const SmNode * GetLeftMost() const override
(this assumes the one with index 0 is always the leftmost subnode for the current node).
Definition: node.cxx:571
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2359
tools::Long mnFormulaBaseline
Definition: node.hxx:1140
tools::Long GetFormulaBaseline() const
Gets the formula baseline.
Definition: node.cxx:577
SmTableNode(const SmToken &rNodeToken)
Definition: node.hxx:1142
Text node.
Definition: node.hxx:747
OUString & GetText()
Definition: node.hxx:783
void ChangeText(const OUString &rText)
Change the text of this node, including the underlying token to rText.
Definition: node.cxx:1836
OUString maText
Definition: node.hxx:748
void AdjustFontDesc()
Try to guess the correct FontDesc, used during visual editing.
Definition: node.cxx:1887
void SetText(const OUString &rText)
Sets the node text to rText.
Definition: node.hxx:776
static sal_Unicode ConvertSymbolToUnicode(sal_Unicode nIn)
Converts the character from StarMath's private area symbols to a matching Unicode character,...
Definition: node.cxx:1899
const OUString & GetText() const
Gets the node text.
Definition: node.hxx:782
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1868
virtual void GetAccessibleText(OUStringBuffer &rText) const override
Appends to rText the node text.
Definition: node.cxx:1882
sal_Int32 GetSelectionStart() const
Index within GetText() where the selection starts.
Definition: node.hxx:803
void SetSelectionEnd(sal_Int32 index)
Sets the index within GetText() where the selection ends to index.
Definition: node.hxx:824
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2415
void SetSelectionStart(sal_Int32 index)
Sets the index within GetText() where the selection starts to index.
Definition: node.hxx:817
sal_Int32 mnSelectionStart
Index within text where the selection starts.
Definition: node.hxx:753
SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP)
Definition: node.cxx:1820
sal_Int32 mnSelectionEnd
Index within text where the selection ends.
Definition: node.hxx:757
sal_uInt16 GetFontDesc() const
Returns the font type being used (text, variable, symbol, ...).
Definition: node.hxx:769
sal_uInt16 mnFontDesc
Definition: node.hxx:749
sal_Int32 GetSelectionEnd() const
Index within GetText() where the selection ends.
Definition: node.hxx:810
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Definition: node.cxx:1842
Unary horizontal node.
Definition: node.hxx:1272
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2387
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:674
SmUnHorNode(const SmToken &rNodeToken)
Definition: node.hxx:1274
Node for vertical brace construction.
Definition: node.hxx:1750
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Definition: node.cxx:1422
SmMathSymbolNode * Brace()
Definition: node.hxx:1769
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Definition: node.cxx:2463
SmNode * Script()
Definition: node.hxx:1781
const SmMathSymbolNode * Brace() const
Returns the node containing the data of the brace.
Definition: node.hxx:1767
SmNode * Body()
Definition: node.hxx:1761
SmVerticalBraceNode(const SmToken &rNodeToken)
Definition: node.hxx:1752
const SmNode * Script() const
Returns the node containing the data of what is in the brace.
Definition: node.hxx:1780
const SmNode * Body() const
Returns the node containing the data of what the brace is pointing for.
Definition: node.hxx:1760
Abstract base class for all visible node.
Definition: node.hxx:613
virtual SmNode * GetSubNode(size_t nIndex) override
Gets the subnode of index nIndex.
Definition: node.cxx:503
SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken)
Definition: node.hxx:615
virtual size_t GetNumSubNodes() const override
Gets the number of subnodes.
Definition: node.cxx:498
virtual bool IsVisible() const override
Checks node visibility.
Definition: node.cxx:493
Visitors are an easy way to automating operations with nodes.
Definition: visitors.hxx:35
#define FNT_MATH
Definition: format.hxx:53
sal_Int32 nIndex
Mode eMode
Error
index
None
long Long
FontChangeMask
Definition: node.hxx:94
FontSizeType
Definition: node.hxx:85
std::vector< SmNode * > SmNodeArray
Definition: node.hxx:113
SmSubSup
Enum used to index sub-/supscripts in the 'maSubNodes' array in 'SmSubSupNode'.
Definition: node.hxx:1536
@ LSUB
Definition: node.hxx:1536
@ CSUB
Definition: node.hxx:1536
@ RSUP
Definition: node.hxx:1536
@ RSUB
Definition: node.hxx:1536
@ LSUP
Definition: node.hxx:1536
@ CSUP
Definition: node.hxx:1536
#define SUBSUP_NUM_ENTRIES
numbers of entries in the above enum (that is: the number of possible sub-/supscripts)
Definition: node.hxx:1542
FontAttribute
The SmNode is the basic structure of formula data.
Definition: node.hxx:73
SmScaleMode
Definition: node.hxx:118
SmNodeType
This file provides definition for the nodetypes.
Definition: nodetype.hxx:26
QPRO_FUNC_TYPE nType
RectHorAlign
Definition: rect.hxx:54
sal_uIntPtr sal_uLong
sal_Int32 nStartPara
sal_Int32 nStartPos
PLUS
MINUS
@ TPLACE
Definition: token.hxx:75
sal_uInt16 sal_Unicode
sal_Unicode const MS_ERROR
Definition: types.hxx:53
sal_Unicode const MS_PLACE
Definition: types.hxx:182