71#include <rtl/ustrbuf.hxx>
476 :
SmNode(eNodeType, rNodeToken)
523 void SetSubNodes(std::unique_ptr<SmNode> pFirst, std::unique_ptr<SmNode> pSecond,
524 std::unique_ptr<SmNode> pThird =
nullptr);
543 void SetSubNodesBinMo(std::unique_ptr<SmNode> pFirst, std::unique_ptr<SmNode> pSecond,
544 std::unique_ptr<SmNode> pThird =
nullptr);
616 :
SmNode(eNodeType, rNodeToken) {}
835 int nDepth)
override;
896 int nDepth)
override;
979 int nDepth)
override;
1071 int nDepth)
override;
1111 int nDepth)
override;
1217 int nDepth)
override;
1542#define SUBSUP_NUM_ENTRIES 6
1974 int nDepth)
override;
2028 void SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols)
2078 int nDepth)
override;
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmAlignNode(const SmToken &rNodeToken)
SmAttributeNode(const SmToken &rNodeToken)
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
const SmNode * Body() const
Gets the body data ( the nodes affected by the attribute ).
const SmNode * Attribute() const
Gets the attribute data.
void GetOperPosSize(Point &rPos, Size &rSize, const Point &rDiagPoint, double fAngleDeg) const
Returns the position and size of the diagonal line by reference.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
bool IsAscending() const
Checks if it is of ascending type.
void SetAscending(bool bVal)
Sets if the wideslash is ascending to bVal.
SmBinDiagonalNode(const SmToken &rNodeToken)
const SmNode * Symbol() const
Returns the node containing the data of the binary operator.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
SmBinHorNode(const SmToken &rNodeToken)
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
const SmNode * LeftOperand() const
Returns the node containing the data of the left operand.
const SmNode * RightOperand() const
Returns the node containing the data of the right operand.
SmBinVerNode(const SmToken &rNodeToken)
virtual const SmNode * GetLeftMost() const override
(this assumes the one with index 0 is always the leftmost subnode for the current node).
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
sal_uInt16 GetBlankNum() const
void IncreaseBy(const SmToken &rToken, sal_uInt32 nMultiplyBy=1)
SmBlankNode(const SmToken &rNodeToken)
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
void SetBlankNum(sal_uInt16 nNumber)
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
Node for brace construction.
SmMathSymbolNode * ClosingBrace()
const SmMathSymbolNode * OpeningBrace() const
Returns the node containing the data of the opening brace.
SmBraceNode(const SmToken &rNodeToken)
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmMathSymbolNode * OpeningBrace()
const SmNode * Body() const
Returns the node containing the data of what is between braces.
const SmMathSymbolNode * ClosingBrace() const
Returns the node containing the data of the closing brace.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
SmBracebodyNode(const SmToken &rNodeToken)
tools::Long GetBodyHeight() const
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
Error node, for parsing errors.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmErrorNode(const SmToken &rNodeToken)
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmExpressionNode(const SmToken &rNodeToken)
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void SetSizeParameter(const Fraction &rValue, FontSizeType nType)
Sets font size to rValue in nType mode.
SmFontNode(const SmToken &rNodeToken)
const Fraction & GetSizeParameter() const
Returns the font size.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
FontSizeType GetSizeType() const
Returns the font size type.
Glyph node for custom operators.
SmGlyphSpecialNode(const SmToken &rNodeToken)
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken)
virtual void GetAccessibleText(OUStringBuffer &rText) const override
Appends to rText the node text.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void SetUseExtraSpaces(bool bVal)
Sets if it going to use extra spaces.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmLineNode(const SmToken &rNodeToken)
SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken)
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
bool IsUseExtraSpaces() const
Checks if it is using extra spaces.
SmMathIdentifierNode(const SmToken &rNodeToken)
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken)
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmMatrixNode(const SmToken &rNodeToken)
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols)
Sets the dimensions of the matrix.
sal_uInt16 GetNumRows() const
Gets the number of rows of the matrix.
virtual const SmNode * GetLeftMost() const override
(this assumes the one with index 0 is always the leftmost subnode for the current node).
sal_uInt16 GetNumCols() const
Gets the number of columns of the matrix.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight)
FontAttribute mnAttributes
FontAttribute & Attributes()
Gets the font attributes.
sal_Int32 GetAccessibleIndex() const
Gets the node accessible index.
SmStructureNode * mpParentNode
void SetAttribute(FontAttribute nAttrib)
Sets the font attribute nAttrib.
void SetSize(const Fraction &rScale)
Sets the font size to rRelSize with type FontSizeType::ABSOLUT.
void Move(const Point &rVector)
Moves the rectangle by rVector.
SmNode(SmNodeType eNodeType, SmToken aNodeToken)
void SetSelection(ESelection aESelection)
Gets node position in input text.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat)=0
Prepares the SmRect to render.
SmScaleMode GetScaleMode() const
Gets the scale mode.
virtual bool IsVisible() const =0
Checks node visibility.
void SetFont(const SmFace &rFace)
Sets the font to rFace.
SmStructureNode * GetParent()
RectHorAlign GetRectHorAlign() const
Gets the alignment of the text.
void SetFontSize(const Fraction &rRelSize, FontSizeType nType)
Sets the font size to rRelSize with type nType.
const SmNode * GetSubNode(size_t nIndex) const
const SmNode * FindRectClosestTo(const Point &rPoint) const
Finds the closest rectangle in the screen.
const SmRect & GetRect() const
Parses itself to SmRect.
virtual void Accept(SmVisitor *pVisitor)=0
Accept a visitor.
void SetAccessibleIndex(sal_Int32 nAccIndex)
Sets the node accessible index to nAccIndex.
SmNode(const SmNode &)=delete
void PrepareAttributes()
Prepare preliminary font attributes Called on Prepare(...).
virtual size_t GetNumSubNodes() const =0
Gets the number of subnodes.
RectHorAlign meRectHorAlign
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth)
Prepare preliminary settings about font and text (e.g.
void SetPhantom(bool bIsPhantom)
Sets the render visibility of a visible node to bIsPhantom.
const SmToken & GetToken() const
Gets the token.
sal_uInt16 GetRow() const
Gets the line in the text where the node is located.
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).
void ClearAttribute(FontAttribute nAttrib)
Clears the font attribute nAttrib.
void SetParent(SmStructureNode *parent)
Sets the parent node.
void MoveTo(const Point &rPoint)
Moves the rectangle to rPoint, being the top left corner the origin.
const SmNode * FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const
Finds the node from the position in the text.
virtual void GetAccessibleText(OUStringBuffer &rText) const =0
Appends to rText the node text.
virtual SmNode * GetSubNode(size_t nIndex)=0
Gets the subnode of index nIndex.
bool IsSelected() const
Checks if the node is selected.
void SetScaleMode(SmScaleMode eMode)
Sets the scale mode to eMode.
const SmNode * FindNodeWithAccessibleIndex(sal_Int32 nAccIndex) const
Finds the node with accessible index nAccIndex.
const SmStructureNode * GetParent() const
Gets the parent node of this node.
void SetRectHorAlign(RectHorAlign eHorAlign, bool bApplyToSubTree=true)
Sets the alignment of the text.
const ESelection & GetSelection() const
Gets node position in input text.
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth)
sal_uInt16 GetColumn() const
Gets the column of the line in the text where the node is located.
void SetColor(const Color &rColor)
Sets the font color.
SmNodeType GetType() const
Gets the node type.
FontChangeMask & Flags()
Gets the FontChangeMask flags.
const SmFace & GetFont() const
Gets the font.
bool IsPhantom() const
Checks if it is a visible node rendered invisible.
void SetSelected(bool Selected)
Sets the node to Selected.
void SetToken(SmToken const &token)
Sets the token for this node.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmOperNode(const SmToken &rNodeToken)
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...
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
const SmNode * GetSymbol() const
Returns the node with the operator data.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmPlaceNode(const SmToken &rNodeToken)
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
tools::Long GetWidth() const
Gets the width of the rect.
tools::Polygon & GetPolygon()
Gets the polygon to draw the node.
SmPolyLineNode(const SmToken &rNodeToken)
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
const Point & GetTopLeft() const
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmRectangleNode(const SmToken &rNodeToken)
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
const SmNode * Body() const
Returns the node containing the data inside the root.
SmRootSymbolNode * Symbol()
const SmRootSymbolNode * Symbol() const
Returns the node containing the data of the character used for the root.
const SmNode * Argument() const
Returns the node containing the data of the order of the root.
SmRootNode(const SmToken &rNodeToken)
SmRootSymbolNode(const SmToken &rNodeToken)
sal_uLong GetBodyWidth() const
Gets the body width.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nHeight) override
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override
Special node for user defined characters.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 _nFontDesc)
bool mbIsFromGreekSymbolSet
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
Abstract baseclass for all composite node.
virtual ~SmStructureNode() override
SmNodeArray::reverse_iterator rend()
Gets the first subnode.
void SetSubNodesBinMo(std::unique_ptr< SmNode > pFirst, std::unique_ptr< SmNode > pSecond, std::unique_ptr< SmNode > pThird=nullptr)
Sets subnodes, used for operators.
int IndexOfSubNode(SmNode const *pSubNode)
Get the index of the child node pSubNode.
void ClaimPaternity()
Sets parent on children of this node.
SmNode * GetSubNodeBinMo(size_t nIndex) const
Gets the subnode of index nIndex, used for operators.
virtual size_t GetNumSubNodes() const override
Gets the number of subnodes.
SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken, size_t nSize=0)
virtual void GetAccessibleText(OUStringBuffer &rText) const override
Appends to rText the node text.
void SetSubNodes(std::unique_ptr< SmNode > pFirst, std::unique_ptr< SmNode > pSecond, std::unique_ptr< SmNode > pThird=nullptr)
Sets subnodes, used for operators.
virtual SmNode * GetSubNode(size_t nIndex) override
Gets the subnode of index nIndex.
SmNodeArray::reverse_iterator rbegin()
Gets the last subnode.
SmNodeArray::iterator begin()
Gets the first subnode.
SmNodeArray::iterator end()
Gets the last subnode.
void SetSubNode(size_t nIndex, SmNode *pNode)
Sets the subnode pNode at nIndex.
void ClearSubNodes()
Does the cleaning of the subnodes.
virtual bool IsVisible() const override
Checks node visibility.
Super- and subscript node.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
void SetUseLimits(bool bVal)
Sets if it is going to be used for a limit to bVal.
const SmNode * GetBody() const
Returns the node with the data of what has to be superindex or subindex.
SmSubSupNode(const SmToken &rNodeToken)
void SetSubSup(SmSubSup eSubSup, SmNode *pScript)
Sets the node with the data of what has to be superindex or subindex.
SmNode * GetSubSup(SmSubSup eSubSup)
const SmNode * GetSubSup(SmSubSup eSubSup) const
Gets the node with the data of what has to be superindex or subindex.
void SetBody(SmNode *pBody)
Sets the node with the data of what has to be superindex or subindex.
bool IsUseLimits() const
Checks if it is going to be used for a limit.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
virtual const SmNode * GetLeftMost() const override
(this assumes the one with index 0 is always the leftmost subnode for the current node).
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
tools::Long mnFormulaBaseline
tools::Long GetFormulaBaseline() const
Gets the formula baseline.
SmTableNode(const SmToken &rNodeToken)
void ChangeText(const OUString &rText)
Change the text of this node, including the underlying token to rText.
void AdjustFontDesc()
Try to guess the correct FontDesc, used during visual editing.
void SetText(const OUString &rText)
Sets the node text to rText.
static sal_Unicode ConvertSymbolToUnicode(sal_Unicode nIn)
Converts the character from StarMath's private area symbols to a matching Unicode character,...
const OUString & GetText() const
Gets the node text.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
virtual void GetAccessibleText(OUStringBuffer &rText) const override
Appends to rText the node text.
sal_Int32 GetSelectionStart() const
Index within GetText() where the selection starts.
void SetSelectionEnd(sal_Int32 index)
Sets the index within GetText() where the selection ends to index.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
void SetSelectionStart(sal_Int32 index)
Sets the index within GetText() where the selection starts to index.
sal_Int32 mnSelectionStart
Index within text where the selection starts.
SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP)
sal_Int32 mnSelectionEnd
Index within text where the selection ends.
sal_uInt16 GetFontDesc() const
Returns the font type being used (text, variable, symbol, ...).
sal_Int32 GetSelectionEnd() const
Index within GetText() where the selection ends.
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth) override
Prepare preliminary settings about font and text (e.g.
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
SmUnHorNode(const SmToken &rNodeToken)
Node for vertical brace construction.
virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override
Prepares the SmRect to render.
SmMathSymbolNode * Brace()
void Accept(SmVisitor *pVisitor) override
Accept a visitor.
const SmMathSymbolNode * Brace() const
Returns the node containing the data of the brace.
SmVerticalBraceNode(const SmToken &rNodeToken)
const SmNode * Script() const
Returns the node containing the data of what is in the brace.
const SmNode * Body() const
Returns the node containing the data of what the brace is pointing for.
Abstract base class for all visible node.
virtual SmNode * GetSubNode(size_t nIndex) override
Gets the subnode of index nIndex.
SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken)
virtual size_t GetNumSubNodes() const override
Gets the number of subnodes.
virtual bool IsVisible() const override
Checks node visibility.
Visitors are an easy way to automating operations with nodes.
std::vector< SmNode * > SmNodeArray
SmSubSup
Enum used to index sub-/supscripts in the 'maSubNodes' array in 'SmSubSupNode'.
#define SUBSUP_NUM_ENTRIES
numbers of entries in the above enum (that is: the number of possible sub-/supscripts)
FontAttribute
The SmNode is the basic structure of formula data.
SmNodeType
This file provides definition for the nodetypes.
sal_Unicode const MS_ERROR
sal_Unicode const MS_PLACE