1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 /** The SmNode is the basic structure of formula data.
22 * Each token is stored in one node of specific kind.
23 * They can have SmNodeType. It allows to identify node type after abstraction.
24 * Here goes the subclasses tree:
28 * SmStructureNode Head of tree diagram
31 * SmExpressionNode { content }
32 * SmUnHorNode unary operators +-; -+; +x; -x; ...
33 * SmRootNode Root structure
34 * SmBinHorNode binary operators A + B
35 * SmBinVerNode over; frac; ...
36 * SmBinDiagonalNode wideslash
37 * SmSubSupNode csub, csup, lsub, from, to, ...
38 * SmBraceNode (); []; left lbrace right rbrace; ...
39 * SmBracebodyNode ( content ); [ content ]; ...
40 * SmVerticalBraceNode overbrace; underbrace;
41 * SmOperNode sum from to; int from to;
42 * SmAlignNode text alignment
43 * SmAttributeNode font attributes; bold;
44 * SmFontNode font serif; ...
46 * SmVisibleNode drawable node
47 * SmGraphicNode graphics display
49 * SmPolyLineNode overline; underline; widehat; ...
50 * SmBlankNode blank space; ~; ...
51 * SmTextNode "text"; func functname; ...
53 * SmGlyphSpecialNode %symbolname
54 * SmMathSymbolNode math symbols
55 * SmMathIdentifierNode variable
56 * SmRootSymbolNode root symbol
58 * SmErrorNode red ? for errors
68 #include "nodetype.hxx"
70 #include <editeng/editdata.hxx>
71 #include <rtl/ustrbuf.hxx>
73 enum class FontAttribute
{
81 template<> struct typed_flags
<FontAttribute
> : is_typed_flags
<FontAttribute
, 0x0003> {};
85 enum class FontSizeType
{
93 // flags to interdict respective status changes
94 enum class FontChangeMask
{
106 template<> struct typed_flags
<FontChangeMask
> : is_typed_flags
<FontChangeMask
, 0x003f> {};
113 class SmStructureNode
;
115 typedef std::vector
< SmNode
* > SmNodeArray
;
117 enum class SmScaleMode
124 class SmNode
: public SmRect
126 // Rendering info for SmRect
128 // Anclage to the code
130 ESelection m_aESelection
;
133 SmScaleMode meScaleMode
;
134 RectHorAlign meRectHorAlign
;
135 FontChangeMask mnFlags
;
136 FontAttribute mnAttributes
;
139 // index in accessible text; -1 if not (yet) applicable
140 sal_Int32 mnAccIndex
;
143 SmNode(SmNodeType eNodeType
, SmToken aNodeToken
);
146 SmNode(const SmNode
&) = delete;
147 SmNode
& operator=(const SmNode
&) = delete;
152 * Checks node visibility.
153 * Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.
154 * @return node visibility
156 virtual bool IsVisible() const = 0;
159 * Gets the number of subnodes.
160 * @return number of subnodes
162 virtual size_t GetNumSubNodes() const = 0;
165 * Gets the subnode of index nIndex.
167 * @return subnode of index nIndex
169 virtual SmNode
* GetSubNode(size_t nIndex
) = 0;
170 const SmNode
* GetSubNode(size_t nIndex
) const
171 { return const_cast<SmNode
*>(this)->GetSubNode(nIndex
); }
173 virtual const SmNode
* GetLeftMost() const;
176 * Gets the FontChangeMask flags.
177 * @return FontChangeMask flags
179 FontChangeMask
&Flags() { return mnFlags
; }
182 * Gets the font attributes.
183 * @return font attributes
185 FontAttribute
&Attributes() { return mnAttributes
; }
188 * Checks if it is a visible node rendered invisible.
189 * @return rendered visibility
191 bool IsPhantom() const { return mbIsPhantom
; }
194 * Sets the render visibility of a visible node to bIsPhantom.
198 void SetPhantom(bool bIsPhantom
);
201 * Sets the font color.
205 void SetColor(const Color
&rColor
);
208 * Sets the font attribute nAttrib.
209 * Check FontAttribute class.
213 void SetAttribute(FontAttribute nAttrib
);
216 * Clears the font attribute nAttrib.
217 * Check FontAttribute class.
221 void ClearAttribute(FontAttribute nAttrib
);
227 const SmFace
& GetFont() const { return maFace
; };
228 SmFace
& GetFont() { return maFace
; };
231 * Sets the font to rFace.
235 void SetFont(const SmFace
&rFace
);
238 * Sets the font size to rRelSize with type nType.
239 * Check FontSizeType for details.
244 void SetFontSize(const Fraction
&rRelSize
, FontSizeType nType
);
247 * Sets the font size to rRelSize with type FontSizeType::ABSOLUT.
251 void SetSize(const Fraction
&rScale
);
254 * Prepare preliminary settings about font and text
255 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
261 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
, int nDepth
);
264 * Prepare preliminary font attributes
265 * Called on Prepare(...).
268 void PrepareAttributes();
271 * Sets the alignment of the text.
272 * Check RectHorAlign class for details.
273 * The subtrees will be affected if bApplyToSubTree.
275 * @param bApplyToSubTree
278 void SetRectHorAlign(RectHorAlign eHorAlign
, bool bApplyToSubTree
= true );
281 * Gets the alignment of the text.
282 * @return alignment of the text
284 RectHorAlign
GetRectHorAlign() const { return meRectHorAlign
; }
287 * Parses itself to SmRect.
290 const SmRect
& GetRect() const { return *this; }
293 * Moves the rectangle by rVector.
297 void Move(const Point
&rVector
);
300 * Moves the rectangle to rPoint, being the top left corner the origin.
304 void MoveTo(const Point
&rPoint
) { Move(rPoint
- GetTopLeft()); }
307 * Prepares the SmRect to render.
312 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) = 0;
315 * Appends to rText the node text.
319 virtual void GetAccessibleText( OUStringBuffer
&rText
) const = 0;
322 * Gets the node accessible index.
323 * Used for visual editing.
324 * @return node accessible index
326 sal_Int32
GetAccessibleIndex() const { return mnAccIndex
; }
329 * Sets the node accessible index to nAccIndex.
330 * Used for visual editing.
334 void SetAccessibleIndex(sal_Int32 nAccIndex
) { mnAccIndex
= nAccIndex
; }
337 * Finds the node with accessible index nAccIndex.
338 * Used for visual editing.
340 * @return node with accessible index nAccIndex
342 const SmNode
* FindNodeWithAccessibleIndex(sal_Int32 nAccIndex
) const;
345 * Gets the line in the text where the node is located.
346 * It is used to do the visual <-> text correspondence.
349 sal_uInt16
GetRow() const { return sal::static_int_cast
<sal_uInt16
>(m_aESelection
.nStartPara
); }
352 * Gets the column of the line in the text where the node is located.
353 * It is used to do the visual <-> text correspondence.
356 sal_uInt16
GetColumn() const { return sal::static_int_cast
<sal_uInt16
>(m_aESelection
.nStartPos
); }
359 * Gets the scale mode.
362 SmScaleMode
GetScaleMode() const { return meScaleMode
; }
365 * Sets the scale mode to eMode.
369 void SetScaleMode(SmScaleMode eMode
) { meScaleMode
= eMode
; }
371 //visual stuff TODO comment
372 virtual void AdaptToX(OutputDevice
&rDev
, sal_uLong nWidth
);
373 virtual void AdaptToY(OutputDevice
&rDev
, sal_uLong nHeight
);
376 * Gets the node type.
379 SmNodeType
GetType() const { return meType
; }
383 * The token contains the data extracted from the text mode.
384 * Ej: text, type (sub, sup, int,...), row and column,...
387 const SmToken
& GetToken() const { return maNodeToken
; }
388 SmToken
& GetToken() { return maNodeToken
; }
391 * Gets node position in input text.
392 * @return node position in input text
394 const ESelection
& GetSelection() const { return m_aESelection
; }
397 * Gets node position in input text.
400 void SetSelection(ESelection aESelection
) { m_aESelection
= aESelection
; }
403 * Finds the node from the position in the text.
404 * It is used to do the visual <-> text correspondence.
407 * @return the given node
409 const SmNode
* FindTokenAt(sal_uInt16 nRow
, sal_uInt16 nCol
) const;
412 * Finds the closest rectangle in the screen.
414 * @return the given node
416 const SmNode
* FindRectClosestTo(const Point
&rPoint
) const;
420 * Calls the method for this class on the visitor.
424 virtual void Accept(SmVisitor
* pVisitor
) = 0;
427 * Checks if the node is selected.
428 * @return the node is selected
430 bool IsSelected() const {return mbIsSelected
;}
433 * Sets the node to Selected.
437 void SetSelected(bool Selected
) {mbIsSelected
= Selected
;}
440 * Gets the parent node of this node.
441 * @return parent node
443 const SmStructureNode
* GetParent() const { return mpParentNode
; }
444 SmStructureNode
* GetParent() { return mpParentNode
; }
447 * Sets the parent node.
451 void SetParent(SmStructureNode
* parent
){ mpParentNode
= parent
; }
454 * Sets the token for this node.
458 void SetToken(SmToken
const & token
){ maNodeToken
= token
; }
461 SmStructureNode
* mpParentNode
;
465 /** Abstract baseclass for all composite node
467 * Subclasses of this class can have subnodes. Nodes that doesn't derivate from
468 * this class does not have subnodes.
470 class SmStructureNode
: public SmNode
472 SmNodeArray maSubNodes
;
475 SmStructureNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
, size_t nSize
= 0)
476 : SmNode(eNodeType
, rNodeToken
)
477 , maSubNodes(nSize
) {}
480 virtual ~SmStructureNode() override
;
483 * Checks node visibility.
484 * Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.
485 * @return node visibility
487 virtual bool IsVisible() const override
;
490 * Gets the number of subnodes.
491 * @return number of subnodes
493 virtual size_t GetNumSubNodes() const override
;
496 * Gets the subnode of index nIndex.
498 * @return subnode of index nIndex
500 using SmNode::GetSubNode
;
501 virtual SmNode
* GetSubNode(size_t nIndex
) override
;
504 * Gets the subnode of index nIndex, used for operators.
506 * @return subnode of index nIndex
508 SmNode
* GetSubNodeBinMo(size_t nIndex
) const;
511 * Does the cleaning of the subnodes.
514 void ClearSubNodes();
517 * Sets subnodes, used for operators.
523 void SetSubNodes(std::unique_ptr
<SmNode
> pFirst
, std::unique_ptr
<SmNode
> pSecond
,
524 std::unique_ptr
<SmNode
> pThird
= nullptr);
533 void SetSubNodes(SmNode
* pFirst
, SmNode
* pSecond
, SmNode
* pThird
);
536 * Sets subnodes, used for operators.
537 * The data is reordered so the items are correctly ordered.
543 void SetSubNodesBinMo(std::unique_ptr
<SmNode
> pFirst
, std::unique_ptr
<SmNode
> pSecond
,
544 std::unique_ptr
<SmNode
> pThird
= nullptr);
551 void SetSubNodes(SmNodeArray
&& rNodeArray
);
554 * Appends to rText the node text.
558 virtual void GetAccessibleText( OUStringBuffer
&rText
) const override
;
561 * Gets the first subnode.
562 * @return first subnode
564 SmNodeArray::iterator
begin() {return maSubNodes
.begin();}
567 * Gets the last subnode.
568 * @return last subnode
570 SmNodeArray::iterator
end() {return maSubNodes
.end();}
573 * Gets the last subnode.
574 * @return last subnode
576 SmNodeArray::reverse_iterator
rbegin() {return maSubNodes
.rbegin();}
579 * Gets the first subnode.
580 * @return first subnode
582 SmNodeArray::reverse_iterator
rend() {return maSubNodes
.rend();}
585 * Get the index of the child node pSubNode.
586 * Returns -1, if pSubNode isn't a subnode of this.
588 * @return index of the child node
590 int IndexOfSubNode(SmNode
const * pSubNode
);
593 * Sets the subnode pNode at nIndex.
594 * If necessary increases the subnodes length.
599 void SetSubNode(size_t nIndex
, SmNode
* pNode
);
602 /** Sets parent on children of this node */
603 void ClaimPaternity();
607 /** Abstract base class for all visible node
609 * Nodes that doesn't derivate from this class doesn't draw anything, but their
612 class SmVisibleNode
: public SmNode
615 SmVisibleNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
616 : SmNode(eNodeType
, rNodeToken
) {}
621 * Checks node visibility.
622 * Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.
623 * @return node visibility
625 virtual bool IsVisible() const override
;
628 * Gets the number of subnodes.
629 * @return number of subnodes
631 virtual size_t GetNumSubNodes() const override
;
634 * Gets the subnode of index nIndex.
636 * @return subnode of index nIndex
638 using SmNode::GetSubNode
;
639 virtual SmNode
* GetSubNode(size_t nIndex
) override
;
643 class SmGraphicNode
: public SmVisibleNode
646 SmGraphicNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
647 : SmVisibleNode(eNodeType
, rNodeToken
) {}
652 * Appends to rText the node text.
656 virtual void GetAccessibleText( OUStringBuffer
&rText
) const override
;
660 /** Draws a rectangle
662 * Used for drawing the line in the OVER and OVERSTRIKE commands.
664 class SmRectangleNode final
: public SmGraphicNode
669 explicit SmRectangleNode(const SmToken
&rNodeToken
)
670 : SmGraphicNode(SmNodeType::Rectangle
, rNodeToken
)
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
;
678 * Prepares the SmRect to render.
683 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
687 * Calls the method for this class on the visitor.
691 void Accept(SmVisitor
* pVisitor
) override
;
695 /** Polygon line node
697 * Used to draw the slash of the WIDESLASH command by SmBinDiagonalNode.
699 class SmPolyLineNode final
: public SmGraphicNode
701 tools::Polygon maPoly
;
706 explicit SmPolyLineNode(const SmToken
&rNodeToken
);
709 * Gets the width of the rect.
712 tools::Long
GetWidth() const { return mnWidth
; }
715 * Gets the polygon to draw the node.
718 tools::Polygon
&GetPolygon() { return maPoly
; }
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
;
725 * Prepares the SmRect to render.
730 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
734 * Calls the method for this class on the visitor.
738 void Accept(SmVisitor
* pVisitor
) override
;
744 * @remarks This class also serves as baseclass for all nodes that contains text.
746 class SmTextNode
: public SmVisibleNode
749 sal_uInt16 mnFontDesc
;
750 /** Index within text where the selection starts
751 * @remarks Only valid if SmNode::IsSelected() is true
753 sal_Int32 mnSelectionStart
;
754 /** Index within text where the selection ends
755 * @remarks Only valid if SmNode::IsSelected() is true
757 sal_Int32 mnSelectionEnd
;
760 SmTextNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
, sal_uInt16 nFontDescP
);
763 SmTextNode(const SmToken
&rNodeToken
, sal_uInt16 nFontDescP
);
766 * Returns the font type being used (text, variable, symbol, ...).
769 sal_uInt16
GetFontDesc() const { return mnFontDesc
; }
772 * Sets the node text to rText.
776 void SetText(const OUString
&rText
) { maText
= rText
; }
779 * Gets the node text.
782 const OUString
& GetText() const { return maText
; }
783 OUString
& GetText() { return maText
; }
786 * Change the text of this node, including the underlying token to rText.
790 void ChangeText(const OUString
&rText
);
793 * Try to guess the correct FontDesc, used during visual editing
796 void AdjustFontDesc();
799 * Index within GetText() where the selection starts.
800 * @remarks Only valid of SmNode::IsSelected() is true.
803 sal_Int32
GetSelectionStart() const { return mnSelectionStart
; }
806 * Index within GetText() where the selection ends.
807 * @remarks Only valid of SmNode::IsSelected() is true.
810 sal_Int32
GetSelectionEnd() const {return mnSelectionEnd
; }
813 * Sets the index within GetText() where the selection starts to index.
817 void SetSelectionStart(sal_Int32 index
) {mnSelectionStart
= index
;}
820 * Sets the index within GetText() where the selection ends to index.
824 void SetSelectionEnd(sal_Int32 index
) {mnSelectionEnd
= index
;}
827 * Prepare preliminary settings about font and text
828 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
834 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
835 int nDepth
) override
;
838 * Prepares the SmRect to render.
843 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
846 * Appends to rText the node text.
850 virtual void GetAccessibleText( OUStringBuffer
&rText
) const override
;
854 * Calls the method for this class on the visitor.
858 void Accept(SmVisitor
* pVisitor
) override
;
861 * Converts the character from StarMath's private area symbols to a matching Unicode
862 * character, if necessary. To be used when converting GetText() to a normal text.
864 * @return unicode char
866 static sal_Unicode
ConvertSymbolToUnicode(sal_Unicode nIn
);
870 /** Special node for user defined characters
872 * Node used for pre- and user-defined characters from:
873 * officecfg/registry/data/org/openoffice/Office/Math.xcu
875 * This is just single characters, I think.
877 class SmSpecialNode
: public SmTextNode
879 bool mbIsFromGreekSymbolSet
;
882 SmSpecialNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
, sal_uInt16 _nFontDesc
);
885 explicit SmSpecialNode(const SmToken
&rNodeToken
);
888 * Prepare preliminary settings about font and text
889 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
895 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
896 int nDepth
) override
;
899 * Prepares the SmRect to render.
904 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
908 * Calls the method for this class on the visitor.
912 void Accept(SmVisitor
* pVisitor
) override
;
916 /** Glyph node for custom operators
918 * This node is used with commands: oper, uoper and boper.
919 * E.g. in "A boper op B", "op" will be an instance of SmGlyphSpecialNode.
920 * "boper" simply interprets "op", the following token, as a binary operator.
921 * The command "uoper" interprets the following token as unary operator.
922 * For these commands an instance of SmGlyphSpecialNode is used for the
923 * operator token, following the command.
925 class SmGlyphSpecialNode final
: public SmSpecialNode
928 explicit SmGlyphSpecialNode(const SmToken
&rNodeToken
)
929 : SmSpecialNode(SmNodeType::GlyphSpecial
, rNodeToken
, FNT_MATH
)
933 * Prepares the SmRect to render.
938 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
942 * Calls the method for this class on the visitor.
946 void Accept(SmVisitor
* pVisitor
) override
;
952 * Use for math symbols such as plus, minus and integral in the INT command.
954 class SmMathSymbolNode
: public SmSpecialNode
957 SmMathSymbolNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
958 : SmSpecialNode(eNodeType
, rNodeToken
, FNT_MATH
)
960 SetText(GetToken().cMathChar
);
964 explicit SmMathSymbolNode(const SmToken
&rNodeToken
);
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
;
971 * Prepare preliminary settings about font and text
972 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
978 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
979 int nDepth
) override
;
982 * Prepares the SmRect to render.
987 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
991 * Calls the method for this class on the visitor.
995 void Accept(SmVisitor
* pVisitor
) override
;
1001 * This behaves essentially the same as SmMathSymbolNode and is only used to
1002 * represent math symbols that should be exported as <mi> elements rather than
1005 class SmMathIdentifierNode final
: public SmMathSymbolNode
1008 explicit SmMathIdentifierNode(const SmToken
&rNodeToken
)
1009 : SmMathSymbolNode(SmNodeType::MathIdent
, rNodeToken
) {}
1013 /** Root symbol node
1015 * Root symbol node used by SmRootNode to create the root symbol, in front of
1016 * the line with the line above. I don't think this node should be used for
1019 class SmRootSymbolNode final
: public SmMathSymbolNode
1021 sal_uLong mnBodyWidth
; // width of body (argument) of root sign
1024 explicit SmRootSymbolNode(const SmToken
&rNodeToken
)
1025 : SmMathSymbolNode(SmNodeType::RootSymbol
, rNodeToken
)
1026 , mnBodyWidth(0) { }
1029 * Gets the body width.
1030 * Allows to know how long is the root and paint it.
1031 * @return body width
1033 sal_uLong
GetBodyWidth() const {return mnBodyWidth
;};
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
;
1041 * Calls the method for this class on the visitor.
1045 void Accept(SmVisitor
* pVisitor
) override
;
1051 * Used to create the <?> command, that denotes place where something can be
1053 * It is drawn as a square with a shadow.
1055 class SmPlaceNode final
: public SmMathSymbolNode
1058 explicit SmPlaceNode(const SmToken
&rNodeToken
)
1059 : SmMathSymbolNode(SmNodeType::Place
, rNodeToken
) { }
1060 SmPlaceNode() : SmMathSymbolNode(SmNodeType::Place
, SmToken(TPLACE
, MS_PLACE
, "<?>")) { };
1063 * Prepare preliminary settings about font and text
1064 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1070 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1071 int nDepth
) override
;
1074 * Prepares the SmRect to render.
1079 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1083 * Calls the method for this class on the visitor.
1087 void Accept(SmVisitor
* pVisitor
) override
;
1091 /** Error node, for parsing errors
1093 * This node is used for parsing errors and draws a questionmark turned upside
1094 * down (inverted question mark).
1096 class SmErrorNode final
: public SmMathSymbolNode
1099 explicit SmErrorNode(const SmToken
&rNodeToken
)
1100 : SmMathSymbolNode(SmNodeType::Error
, rNodeToken
) { SetText(OUString(MS_ERROR
)); }
1103 * Prepare preliminary settings about font and text
1104 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1110 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1111 int nDepth
) override
;
1114 * Prepares the SmRect to render.
1119 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1123 * Calls the method for this class on the visitor.
1127 void Accept(SmVisitor
* pVisitor
) override
;
1133 * This is the root node for the formula tree. This node is also used for the
1134 * STACK and BINOM commands. When used for root node, its
1135 * children are instances of SmLineNode, and in some obscure cases the child
1136 * can be an instance of SmExpressionNode, mainly when errors occur.
1138 class SmTableNode final
: public SmStructureNode
1140 tools::Long mnFormulaBaseline
;
1142 explicit SmTableNode(const SmToken
&rNodeToken
)
1143 : SmStructureNode(SmNodeType::Table
, rNodeToken
)
1144 , mnFormulaBaseline(0) { }
1146 virtual const SmNode
* GetLeftMost() const override
;
1149 * Prepares the SmRect to render.
1154 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1157 * Gets the formula baseline.
1158 * @return formula baseline
1160 tools::Long
GetFormulaBaseline() const;
1164 * Calls the method for this class on the visitor.
1168 void Accept(SmVisitor
* pVisitor
) override
;
1174 * Used as child of SmTableNode when the SmTableNode is the root node of the
1177 class SmLineNode
: public SmStructureNode
1179 bool mbUseExtraSpaces
;
1182 SmLineNode(SmNodeType eNodeType
, const SmToken
&rNodeToken
)
1183 : SmStructureNode(eNodeType
, rNodeToken
)
1184 , mbUseExtraSpaces(true) { }
1187 explicit SmLineNode(const SmToken
&rNodeToken
)
1188 : SmStructureNode(SmNodeType::Line
, rNodeToken
)
1189 , mbUseExtraSpaces(true) { }
1192 * Sets if it going to use extra spaces.
1193 * It is used to set if there has to be space between node while rendering.
1194 * By default it is true.
1198 void SetUseExtraSpaces(bool bVal
) { mbUseExtraSpaces
= bVal
; }
1201 * Checks if it is using extra spaces.
1202 * It is used for calculating space between nodes when rendering.
1203 * By default it is true.
1204 * @return is using extra spaces
1206 bool IsUseExtraSpaces() const { return mbUseExtraSpaces
; };
1209 * Prepare preliminary settings about font and text
1210 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1216 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1217 int nDepth
) override
;
1220 * Prepares the SmRect to render.
1225 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1229 * Calls the method for this class on the visitor.
1233 void Accept(SmVisitor
* pVisitor
) override
;
1239 * Used whenever you have an expression such as "A OVER {B + C}", here there is
1240 * an expression node that allows "B + C" to be the denominator of the
1241 * SmBinVerNode, that the OVER command creates.
1243 class SmExpressionNode final
: public SmLineNode
1246 explicit SmExpressionNode(const SmToken
&rNodeToken
)
1247 : SmLineNode(SmNodeType::Expression
, rNodeToken
) { }
1250 * Prepares the SmRect to render.
1255 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1259 * Calls the method for this class on the visitor.
1263 void Accept(SmVisitor
* pVisitor
) override
;
1267 /** Unary horizontal node
1269 * The same as SmBinHorNode except this is for unary operators.
1271 class SmUnHorNode final
: public SmStructureNode
1274 explicit SmUnHorNode(const SmToken
&rNodeToken
)
1275 : SmStructureNode(SmNodeType::UnHor
, rNodeToken
, 2) { }
1278 * Prepares the SmRect to render.
1283 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1287 * Calls the method for this class on the visitor.
1291 void Accept(SmVisitor
* pVisitor
) override
;
1297 * Used for create square roots and other roots, example:
1298 * \f$ \sqrt[\mbox{[Argument]}]{\mbox{[Body]}} \f$.
1301 * 0: Argument (optional)<BR>
1302 * 1: Symbol (instance of SmRootSymbolNode)<BR>
1304 * Where argument is optional and may be NULL.
1306 class SmRootNode final
: public SmStructureNode
1309 explicit SmRootNode(const SmToken
&rNodeToken
)
1310 : SmStructureNode(SmNodeType::Root
, rNodeToken
, 3) { }
1313 * Prepares the SmRect to render.
1318 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1322 * Calls the method for this class on the visitor.
1326 void Accept(SmVisitor
* pVisitor
) override
;
1329 * Returns the node containing the data of the order of the root.
1330 * @return order data
1332 const SmNode
* Argument() const { return const_cast<SmRootNode
*>(this)->Argument(); }
1333 SmNode
* Argument() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1336 * Returns the node containing the data of the character used for the root.
1337 * @return symbol data
1339 const SmRootSymbolNode
* Symbol() const { return const_cast<SmRootNode
*>(this)->Symbol(); }
1340 SmRootSymbolNode
* Symbol() { assert( GetNumSubNodes() == 3 );
1341 assert( GetSubNode( 1 )->GetType()
1342 == SmNodeType::RootSymbol
);
1343 return static_cast< SmRootSymbolNode
* >
1344 ( GetSubNode( 1 )); }
1347 * Returns the node containing the data inside the root.
1350 const SmNode
* Body() const { return const_cast<SmRootNode
*>(this)->Body(); }
1351 SmNode
* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1356 /** Binary horizontal node
1358 * This node is used for binary operators. In a formula such as "A + B".
1361 * 0: Left operand<BR>
1362 * 1: Binary operator<BR>
1363 * 2: Right operand<BR>
1365 * None of the children may be NULL.
1367 class SmBinHorNode final
: public SmStructureNode
1370 explicit SmBinHorNode(const SmToken
&rNodeToken
)
1371 : SmStructureNode(SmNodeType::BinHor
, rNodeToken
, 3) { }
1374 * Prepares the SmRect to render.
1379 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1383 * Calls the method for this class on the visitor.
1387 void Accept(SmVisitor
* pVisitor
) override
;
1390 * Returns the node containing the data of the binary operator.
1391 * @return symbol data
1393 const SmNode
* Symbol() const { return const_cast<SmBinHorNode
*>(this)->Symbol(); }
1394 SmNode
* Symbol() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 1 ); }
1397 * Returns the node containing the data of the left operand.
1398 * @return left operand data
1400 const SmNode
* LeftOperand() const { return const_cast<SmBinHorNode
*>(this)->LeftOperand(); }
1401 SmNode
* LeftOperand() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1404 * Returns the node containing the data of the right operand.
1405 * @return right operand data
1407 const SmNode
* RightOperand() const { return const_cast<SmBinHorNode
*>(this)->RightOperand(); }
1408 SmNode
* RightOperand() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1412 /** Binary horizontal node
1414 * This node is used for creating the OVER command, consider the formula:
1415 * "numerator OVER denominator", which looks like
1416 * \f$ \frac{\mbox{numerator}}{\mbox{denominator}} \f$
1420 * 1: Line (instance of SmRectangleNode)<BR>
1421 * 2: Denominator<BR>
1422 * None of the children may be NULL.
1424 class SmBinVerNode final
: public SmStructureNode
1427 explicit SmBinVerNode(const SmToken
&rNodeToken
)
1428 : SmStructureNode(SmNodeType::BinVer
, rNodeToken
, 3) { }
1430 virtual const SmNode
* GetLeftMost() const override
;
1433 * Prepares the SmRect to render.
1438 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1442 * Calls the method for this class on the visitor.
1446 void Accept(SmVisitor
* pVisitor
) override
;
1450 /** Binary diagonal node
1452 * Used for implementing the WIDESLASH command, example: "A WIDESLASH B".
1455 * 0: Left operand<BR>
1456 * 1: right operand<BR>
1457 * 2: Line (instance of SmPolyLineNode).<BR>
1458 * None of the children may be NULL.
1460 class SmBinDiagonalNode final
: public SmStructureNode
1465 * Returns the position and size of the diagonal line by reference.
1470 * @return position and size of the diagonal line
1472 void GetOperPosSize(Point
&rPos
, Size
&rSize
, const Point
&rDiagPoint
, double fAngleDeg
) const;
1475 explicit SmBinDiagonalNode(const SmToken
&rNodeToken
)
1476 : SmStructureNode(SmNodeType::BinDiagonal
, rNodeToken
, 3)
1477 , mbAscending(false) { }
1480 * Checks if it is of ascending type.
1489 * @return ascending.
1491 bool IsAscending() const { return mbAscending
; }
1494 * Sets if the wideslash is ascending to bVal.
1498 void SetAscending(bool bVal
) { mbAscending
= bVal
; }
1501 * Prepares the SmRect to render.
1506 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1510 * Calls the method for this class on the visitor.
1514 void Accept(SmVisitor
* pVisitor
) override
;
1518 /** Enum used to index sub-/supscripts in the 'maSubNodes' array
1521 * See graphic for positions at char:
1536 { CSUB
, CSUP
, RSUB
, RSUP
, LSUB
, LSUP
1539 /** numbers of entries in the above enum (that is: the number of possible
1542 #define SUBSUP_NUM_ENTRIES 6
1544 /** Super- and subscript node
1546 * Used for creating super- and subscripts for commands such as:
1547 * "^", "_", "lsup", "lsub", "csup" and "csub".
1548 * Example: "A^2" which looks like: \f$ A^2 \f$
1550 * This node is also used for creating limits on SmOperNode, when
1551 * "FROM" and "TO" commands are used with "INT", "SUM" or similar.
1553 * Children of this node can be enumerated using the SmSubSup enum.
1554 * Please note that children may be NULL, except for the body.
1555 * It is recommended that you access children using GetBody() and
1558 class SmSubSupNode final
: public SmStructureNode
1563 explicit SmSubSupNode(const SmToken
&rNodeToken
)
1564 : SmStructureNode(SmNodeType::SubSup
, rNodeToken
, 1 + SUBSUP_NUM_ENTRIES
)
1565 , mbUseLimits(false) { }
1568 * Returns the node with the data of what has to be superindex or subindex.
1571 const SmNode
* GetBody() const { return const_cast<SmSubSupNode
*>(this)->GetBody(); }
1572 SmNode
* GetBody() { return GetSubNode(0); }
1575 * Checks if it is going to be used for a limit.
1576 * Example lim from { x toward 0 } { {sin x}over x } = 1
1577 * @return is a limit
1579 bool IsUseLimits() const { return mbUseLimits
; };
1582 * Sets if it is going to be used for a limit to bVal.
1586 void SetUseLimits(bool bVal
) { mbUseLimits
= bVal
; }
1589 * Gets the node with the data of what has to be superindex or subindex.
1590 * The position to check is given by eSubSup.
1591 * @remarks this method may return NULL.
1595 const SmNode
* GetSubSup(SmSubSup eSubSup
) const { return const_cast< SmSubSupNode
* >
1596 ( this )->GetSubSup( eSubSup
); }
1597 SmNode
* GetSubSup(SmSubSup eSubSup
) { return GetSubNode(1 + eSubSup
); };
1600 * Sets the node with the data of what has to be superindex or subindex.
1603 void SetBody(SmNode
* pBody
) { SetSubNode(0, pBody
); }
1606 * Sets the node with the data of what has to be superindex or subindex.
1607 * The position to check is given by eSubSup.
1611 void SetSubSup(SmSubSup eSubSup
, SmNode
* pScript
) { SetSubNode( 1 + eSubSup
, pScript
); }
1614 * Prepares the SmRect to render.
1619 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1623 * Calls the method for this class on the visitor.
1627 void Accept(SmVisitor
* pVisitor
) override
;
1632 /** Node for brace construction
1634 * Used for "lbrace [body] rbrace" and similar constructions.
1635 * Should look like \f$ \{\mbox{[body]}\} \f$
1638 * 0: Opening brace<BR>
1639 * 1: Body (usually SmBracebodyNode)<BR>
1640 * 2: Closing brace<BR>
1641 * None of the children can be NULL.
1643 * Note that child 1 (Body) is usually SmBracebodyNode, but it can also be e.g. SmExpressionNode.
1645 class SmBraceNode final
: public SmStructureNode
1648 explicit SmBraceNode(const SmToken
&rNodeToken
)
1649 : SmStructureNode(SmNodeType::Brace
, rNodeToken
, 3) { }
1652 * Returns the node containing the data of the opening brace.
1653 * @return opening brace data
1655 const SmMathSymbolNode
* OpeningBrace() const { return const_cast<SmBraceNode
*>
1656 (this)->OpeningBrace(); }
1657 SmMathSymbolNode
* OpeningBrace() { assert( GetNumSubNodes() == 3 );
1658 assert( GetSubNode( 0 )->GetType()
1659 == SmNodeType::Math
);
1660 return static_cast< SmMathSymbolNode
* >
1661 ( GetSubNode( 0 )); }
1664 * Returns the node containing the data of what is between braces.
1667 const SmNode
* Body() const { return const_cast<SmBraceNode
*>(this)->Body(); }
1668 SmNode
* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 1 ); }
1671 * Returns the node containing the data of the closing brace.
1672 * @return closing brace data
1674 const SmMathSymbolNode
* ClosingBrace() const { return const_cast<SmBraceNode
*>
1675 (this)->ClosingBrace(); }
1676 SmMathSymbolNode
* ClosingBrace() { assert( GetNumSubNodes() == 3 );
1677 assert( GetSubNode( 2 )->GetType()
1678 == SmNodeType::Math
);
1679 return static_cast< SmMathSymbolNode
* >
1680 ( GetSubNode( 2 )); }
1683 * Prepares the SmRect to render.
1688 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1692 * Calls the method for this class on the visitor.
1696 void Accept(SmVisitor
* pVisitor
) override
;
1700 /** Body of an SmBraceNode
1702 * This usually only has one child an SmExpressionNode, however, it can also
1703 * have other children.
1704 * Consider the formula "lbrace [body1] mline [body2] rbrace", looks like:
1705 * \f$ \{\mbox{[body1] | [body2]}\} \f$.
1706 * In this case SmBracebodyNode will have three children, "[body1]", "|" and
1709 class SmBracebodyNode final
: public SmStructureNode
1711 tools::Long mnBodyHeight
;
1714 explicit SmBracebodyNode(const SmToken
&rNodeToken
)
1715 : SmStructureNode(SmNodeType::Bracebody
, rNodeToken
)
1716 , mnBodyHeight(0) { }
1719 * Prepares the SmRect to render.
1724 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1725 tools::Long
GetBodyHeight() const { return mnBodyHeight
; }
1729 * Calls the method for this class on the visitor.
1733 void Accept(SmVisitor
* pVisitor
) override
;
1737 /** Node for vertical brace construction
1739 * Used to implement commands "[body] underbrace [script]" and
1740 * "[body] overbrace [script]".
1741 * Underbrace should look like this \f$ \underbrace{\mbox{body}}_{\mbox{script}}\f$.
1747 * (None of these children are optional, e.g. they must all be not NULL).
1749 class SmVerticalBraceNode final
: public SmStructureNode
1752 explicit SmVerticalBraceNode(const SmToken
&rNodeToken
)
1753 : SmStructureNode(SmNodeType::VerticalBrace
, rNodeToken
, 3) { }
1756 * Returns the node containing the data of what the brace is pointing for.
1760 const SmNode
* Body() const { return const_cast<SmVerticalBraceNode
*>(this)->Body(); }
1761 SmNode
* Body() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); }
1764 * Returns the node containing the data of the brace.
1765 * @return brace data
1767 const SmMathSymbolNode
* Brace() const { return const_cast<SmVerticalBraceNode
*>
1769 SmMathSymbolNode
* Brace() { assert( GetNumSubNodes() == 3 );
1770 assert( GetSubNode( 1 )->GetType()
1771 == SmNodeType::Math
);
1772 return static_cast< SmMathSymbolNode
* >
1773 ( GetSubNode( 1 )); }
1776 * Returns the node containing the data of what is in the brace.
1778 * @return opening brace data
1780 const SmNode
* Script() const { return const_cast<SmVerticalBraceNode
*>(this)->Script(); }
1781 SmNode
* Script() { assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); }
1784 * Prepares the SmRect to render.
1789 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1793 * Calls the method for this class on the visitor.
1797 void Accept(SmVisitor
* pVisitor
) override
;
1802 * Used for commands like SUM, INT and similar.
1805 * 0: Operation (instance of SmMathSymbolNode or SmSubSupNode)<BR>
1807 * None of the children may be NULL.
1810 class SmOperNode final
: public SmStructureNode
1813 explicit SmOperNode(const SmToken
&rNodeToken
)
1814 : SmStructureNode(SmNodeType::Oper
, rNodeToken
, 2) { }
1817 * Returns the node with the operator data
1818 * @return operator data
1820 const SmNode
* GetSymbol() const { return const_cast<SmOperNode
*>(this)->GetSymbol(); }
1821 SmNode
* GetSymbol();
1824 * Returns the height of the node in base to the symbol
1825 * ( rSymbol contains the operator data )
1826 * and the font format ( rFormat ).
1829 * @return node's height
1831 tools::Long
CalcSymbolHeight(const SmNode
&rSymbol
, const SmFormat
&rFormat
) const;
1834 * Prepares the SmRect to render.
1839 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1843 * Calls the method for this class on the visitor.
1847 void Accept(SmVisitor
* pVisitor
) override
;
1851 /** Node used for alignment
1853 * This node has exactly one child at index 0.
1855 class SmAlignNode final
: public SmStructureNode
1858 explicit SmAlignNode(const SmToken
&rNodeToken
)
1859 : SmStructureNode(SmNodeType::Align
, rNodeToken
) { }
1862 * Prepares the SmRect to render.
1867 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1871 * Calls the method for this class on the visitor.
1875 void Accept(SmVisitor
* pVisitor
) override
;
1881 * Used to give an attribute to another node. Used for commands such as:
1882 * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHARPOON, WIDEHAT and WIDETILDE.
1887 * None of these may be NULL.
1889 class SmAttributeNode final
: public SmStructureNode
1892 explicit SmAttributeNode(const SmToken
&rNodeToken
)
1893 : SmStructureNode(SmNodeType::Attribute
, rNodeToken
, 2) {}
1896 * Prepares the SmRect to render.
1901 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1905 * Calls the method for this class on the visitor.
1909 void Accept(SmVisitor
* pVisitor
) override
;
1912 * Gets the attribute data.
1913 * @return attribute data
1915 const SmNode
* Attribute() const { return const_cast<SmAttributeNode
*>(this)->Attribute(); }
1916 SmNode
* Attribute() { assert( GetNumSubNodes() == 2 ); return GetSubNode( 0 ); }
1919 * Gets the body data ( the nodes affected by the attribute ).
1922 const SmNode
* Body() const { return const_cast<SmAttributeNode
*>(this)->Body(); }
1923 SmNode
* Body() { assert( GetNumSubNodes() == 2 ); return GetSubNode( 1 ); }
1929 * Used to change the font of its children.
1931 class SmFontNode final
: public SmStructureNode
1933 FontSizeType meSizeType
;
1934 Fraction maFontSize
;
1937 explicit SmFontNode(const SmToken
&rNodeToken
)
1938 : SmStructureNode(SmNodeType::Font
, rNodeToken
)
1939 , meSizeType(FontSizeType::MULTIPLY
)
1943 * Sets font size to rValue in nType mode.
1944 * Check FontSizeType for details.
1949 void SetSizeParameter(const Fraction
&rValue
, FontSizeType nType
)
1950 { meSizeType
= nType
; maFontSize
= rValue
; }
1953 * Returns the font size.
1954 * @return font size.
1956 const Fraction
& GetSizeParameter() const {return maFontSize
;}
1959 * Returns the font size type.
1960 * Check FontSizeType for details.
1961 * @return font size type.
1963 FontSizeType
GetSizeType() const {return meSizeType
;}
1966 * Prepare preliminary settings about font and text
1967 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
1973 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
1974 int nDepth
) override
;
1977 * Prepares the SmRect to render.
1982 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
1986 * Calls the method for this class on the visitor.
1990 void Accept(SmVisitor
* pVisitor
) override
;
1996 * Used to implement the MATRIX command, example:
1997 * "matrix{ 1 # 2 ## 3 # 4}".
1999 class SmMatrixNode final
: public SmStructureNode
2001 sal_uInt16 mnNumRows
,
2005 explicit SmMatrixNode(const SmToken
&rNodeToken
)
2006 : SmStructureNode(SmNodeType::Matrix
, rNodeToken
)
2011 * Gets the number of rows of the matrix.
2012 * @return rows number
2014 sal_uInt16
GetNumRows() const {return mnNumRows
;}
2017 * Gets the number of columns of the matrix.
2018 * @return columns number
2020 sal_uInt16
GetNumCols() const {return mnNumCols
;}
2023 * Sets the dimensions of the matrix.
2024 * @param nMatrixRows
2025 * @param nMatrixCols
2028 void SetRowCol(sal_uInt16 nMatrixRows
, sal_uInt16 nMatrixCols
)
2029 { mnNumRows
= nMatrixRows
; mnNumCols
= nMatrixCols
; }
2031 virtual const SmNode
* GetLeftMost() const override
;
2034 * Prepares the SmRect to render.
2039 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
2043 * Calls the method for this class on the visitor.
2047 void Accept(SmVisitor
* pVisitor
) override
;
2051 /** Node for whitespace
2053 * Used to implement the commands "~" and "`". This node is just a blank space.
2055 class SmBlankNode final
: public SmGraphicNode
2060 explicit SmBlankNode(const SmToken
&rNodeToken
)
2061 : SmGraphicNode(SmNodeType::Blank
, rNodeToken
)
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
; }
2070 * Prepare preliminary settings about font and text
2071 * (e.g. maFace, meRectHorAlign, mnFlags, mnAttributes, etc.)
2077 virtual void Prepare(const SmFormat
&rFormat
, const SmDocShell
&rDocShell
,
2078 int nDepth
) override
;
2081 * Prepares the SmRect to render.
2086 virtual void Arrange(OutputDevice
&rDev
, const SmFormat
&rFormat
) override
;
2090 * Calls the method for this class on the visitor.
2094 void Accept(SmVisitor
* pVisitor
) override
;
2098 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */