LibreOffice Module starmath (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SmStructureNode Class Reference

Abstract baseclass for all composite node. More...

#include <node.hxx>

Inheritance diagram for SmStructureNode:
[legend]
Collaboration diagram for SmStructureNode:
[legend]

Public Member Functions

virtual ~SmStructureNode () override
 
virtual bool IsVisible () const override
 Checks node visibility. More...
 
virtual size_t GetNumSubNodes () const override
 Gets the number of subnodes. More...
 
virtual SmNodeGetSubNode (size_t nIndex) override
 Gets the subnode of index nIndex. More...
 
SmNodeGetSubNodeBinMo (size_t nIndex) const
 Gets the subnode of index nIndex, used for operators. More...
 
void ClearSubNodes ()
 Does the cleaning of the subnodes. More...
 
void SetSubNodes (std::unique_ptr< SmNode > pFirst, std::unique_ptr< SmNode > pSecond, std::unique_ptr< SmNode > pThird=nullptr)
 Sets subnodes, used for operators. More...
 
void SetSubNodes (SmNode *pFirst, SmNode *pSecond, SmNode *pThird)
 Sets subnodes. More...
 
void SetSubNodesBinMo (std::unique_ptr< SmNode > pFirst, std::unique_ptr< SmNode > pSecond, std::unique_ptr< SmNode > pThird=nullptr)
 Sets subnodes, used for operators. More...
 
void SetSubNodes (SmNodeArray &&rNodeArray)
 Sets subnodes. More...
 
virtual void GetAccessibleText (OUStringBuffer &rText) const override
 Appends to rText the node text. More...
 
SmNodeArray::iterator begin ()
 Gets the first subnode. More...
 
SmNodeArray::iterator end ()
 Gets the last subnode. More...
 
SmNodeArray::reverse_iterator rbegin ()
 Gets the last subnode. More...
 
SmNodeArray::reverse_iterator rend ()
 Gets the first subnode. More...
 
int IndexOfSubNode (SmNode const *pSubNode)
 Get the index of the child node pSubNode. More...
 
void SetSubNode (size_t nIndex, SmNode *pNode)
 Sets the subnode pNode at nIndex. More...
 
virtual SmNodeGetSubNode (size_t nIndex)=0
 Gets the subnode of index nIndex. More...
 
const SmNodeGetSubNode (size_t nIndex) const
 Gets the subnode of index nIndex. More...
 
- Public Member Functions inherited from SmNode
 SmNode (const SmNode &)=delete
 
SmNodeoperator= (const SmNode &)=delete
 
virtual ~SmNode ()
 
virtual bool IsVisible () const =0
 Checks node visibility. More...
 
virtual size_t GetNumSubNodes () const =0
 Gets the number of subnodes. More...
 
virtual SmNodeGetSubNode (size_t nIndex)=0
 Gets the subnode of index nIndex. More...
 
const SmNodeGetSubNode (size_t nIndex) const
 
virtual const SmNodeGetLeftMost () const
 (this assumes the one with index 0 is always the leftmost subnode for the current node). More...
 
FontChangeMaskFlags ()
 Gets the FontChangeMask flags. More...
 
FontAttributeAttributes ()
 Gets the font attributes. More...
 
bool IsPhantom () const
 Checks if it is a visible node rendered invisible. More...
 
void SetPhantom (bool bIsPhantom)
 Sets the render visibility of a visible node to bIsPhantom. More...
 
void SetColor (const Color &rColor)
 Sets the font color. More...
 
void SetAttribute (FontAttribute nAttrib)
 Sets the font attribute nAttrib. More...
 
void ClearAttribute (FontAttribute nAttrib)
 Clears the font attribute nAttrib. More...
 
const SmFaceGetFont () const
 Gets the font. More...
 
SmFaceGetFont ()
 
void SetFont (const SmFace &rFace)
 Sets the font to rFace. More...
 
void SetFontSize (const Fraction &rRelSize, FontSizeType nType)
 Sets the font size to rRelSize with type nType. More...
 
void SetSize (const Fraction &rScale)
 Sets the font size to rRelSize with type FontSizeType::ABSOLUT. More...
 
virtual void Prepare (const SmFormat &rFormat, const SmDocShell &rDocShell, int nDepth)
 Prepare preliminary settings about font and text (e.g. More...
 
void PrepareAttributes ()
 Prepare preliminary font attributes Called on Prepare(...). More...
 
void SetRectHorAlign (RectHorAlign eHorAlign, bool bApplyToSubTree=true)
 Sets the alignment of the text. More...
 
RectHorAlign GetRectHorAlign () const
 Gets the alignment of the text. More...
 
const SmRectGetRect () const
 Parses itself to SmRect. More...
 
void Move (const Point &rVector)
 Moves the rectangle by rVector. More...
 
void MoveTo (const Point &rPoint)
 Moves the rectangle to rPoint, being the top left corner the origin. More...
 
virtual void Arrange (OutputDevice &rDev, const SmFormat &rFormat)=0
 Prepares the SmRect to render. More...
 
virtual void GetAccessibleText (OUStringBuffer &rText) const =0
 Appends to rText the node text. More...
 
sal_Int32 GetAccessibleIndex () const
 Gets the node accessible index. More...
 
void SetAccessibleIndex (sal_Int32 nAccIndex)
 Sets the node accessible index to nAccIndex. More...
 
const SmNodeFindNodeWithAccessibleIndex (sal_Int32 nAccIndex) const
 Finds the node with accessible index nAccIndex. More...
 
sal_uInt16 GetRow () const
 Gets the line in the text where the node is located. More...
 
sal_uInt16 GetColumn () const
 Gets the column of the line in the text where the node is located. More...
 
SmScaleMode GetScaleMode () const
 Gets the scale mode. More...
 
void SetScaleMode (SmScaleMode eMode)
 Sets the scale mode to eMode. More...
 
virtual void AdaptToX (OutputDevice &rDev, sal_uLong nWidth)
 
virtual void AdaptToY (OutputDevice &rDev, sal_uLong nHeight)
 
SmNodeType GetType () const
 Gets the node type. More...
 
const SmTokenGetToken () const
 Gets the token. More...
 
SmTokenGetToken ()
 
const ESelectionGetSelection () const
 Gets node position in input text. More...
 
void SetSelection (ESelection aESelection)
 Gets node position in input text. More...
 
const SmNodeFindTokenAt (sal_uInt16 nRow, sal_uInt16 nCol) const
 Finds the node from the position in the text. More...
 
const SmNodeFindRectClosestTo (const Point &rPoint) const
 Finds the closest rectangle in the screen. More...
 
virtual void Accept (SmVisitor *pVisitor)=0
 Accept a visitor. More...
 
bool IsSelected () const
 Checks if the node is selected. More...
 
void SetSelected (bool Selected)
 Sets the node to Selected. More...
 
const SmStructureNodeGetParent () const
 Gets the parent node of this node. More...
 
SmStructureNodeGetParent ()
 
void SetParent (SmStructureNode *parent)
 Sets the parent node. More...
 
void SetToken (SmToken const &token)
 Sets the token for this node. More...
 
- Public Member Functions inherited from SmRect
 SmRect ()
 
 SmRect (const OutputDevice &rDev, const SmFormat *pFormat, const OUString &rText, sal_uInt16 nBorderWidth)
 
 SmRect (tools::Long nWidth, tools::Long nHeight)
 
sal_uInt16 GetBorderWidth () const
 
void SetItalicSpaces (tools::Long nLeftSpace, tools::Long nRightSpace)
 
void SetWidth (sal_uLong nWidth)
 
void SetLeft (tools::Long nLeft)
 
void SetRight (tools::Long nRight)
 
void SetBottom (tools::Long nBottom)
 
void SetTop (tools::Long nTop)
 
const PointGetTopLeft () const
 
tools::Long GetTop () const
 
tools::Long GetLeft () const
 
tools::Long GetBottom () const
 
tools::Long GetRight () const
 
tools::Long GetCenterY () const
 
tools::Long GetWidth () const
 
tools::Long GetHeight () const
 
tools::Long GetItalicLeftSpace () const
 
tools::Long GetItalicRightSpace () const
 
tools::Long GetHiAttrFence () const
 
tools::Long GetLoAttrFence () const
 
tools::Long GetItalicLeft () const
 
tools::Long GetItalicCenterX () const
 
tools::Long GetItalicRight () const
 
tools::Long GetItalicWidth () const
 
bool HasBaseline () const
 
tools::Long GetBaseline () const
 
tools::Long GetBaselineOffset () const
 
tools::Long GetAlignT () const
 
tools::Long GetAlignM () const
 
tools::Long GetAlignB () const
 
const SizeGetSize () const
 
Size GetItalicSize () const
 
void Move (const Point &rPosition)
 
void MoveTo (const Point &rPosition)
 
bool IsEmpty () const
 
bool HasAlignInfo () const
 
Point AlignTo (const SmRect &rRect, RectPos ePos, RectHorAlign eHor, RectVerAlign eVer) const
 
SmRectExtendBy (const SmRect &rRect, RectCopyMBL eCopyMode)
 
void ExtendBy (const SmRect &rRect, RectCopyMBL eCopyMode, tools::Long nNewAlignM)
 
SmRectExtendBy (const SmRect &rRect, RectCopyMBL eCopyMode, bool bKeepVerAlignParams)
 
tools::Long OrientedDist (const Point &rPoint) const
 
bool IsInsideRect (const Point &rPoint) const
 
bool IsInsideItalicRect (const Point &rPoint) const
 
tools::Rectangle AsRectangle () const
 
SmRect AsGlyphRect () const
 

Protected Member Functions

 SmStructureNode (SmNodeType eNodeType, const SmToken &rNodeToken, size_t nSize=0)
 
- Protected Member Functions inherited from SmNode
 SmNode (SmNodeType eNodeType, SmToken aNodeToken)
 

Private Member Functions

void ClaimPaternity ()
 Sets parent on children of this node. More...
 

Private Attributes

SmNodeArray maSubNodes
 

Detailed Description

Abstract baseclass for all composite node.

Subclasses of this class can have subnodes. Nodes that doesn't derivate from this class does not have subnodes.

Definition at line 470 of file node.hxx.

Constructor & Destructor Documentation

◆ SmStructureNode()

SmStructureNode::SmStructureNode ( SmNodeType  eNodeType,
const SmToken rNodeToken,
size_t  nSize = 0 
)
inlineprotected

Definition at line 475 of file node.hxx.

◆ ~SmStructureNode()

SmStructureNode::~SmStructureNode ( )
overridevirtual

Definition at line 353 of file node.cxx.

Member Function Documentation

◆ begin()

SmNodeArray::iterator SmStructureNode::begin ( )
inline

Gets the first subnode.

Returns
first subnode

Definition at line 564 of file node.hxx.

References maSubNodes.

◆ ClaimPaternity()

void SmStructureNode::ClaimPaternity ( )
private

Sets parent on children of this node.

Definition at line 463 of file node.cxx.

References SmNode::SetParent().

Referenced by SetSubNodes(), and SetSubNodesBinMo().

◆ ClearSubNodes()

void SmStructureNode::ClearSubNodes ( )

Does the cleaning of the subnodes.

Returns

Definition at line 359 of file node.cxx.

References maSubNodes.

Referenced by SmCursor::LineToList().

◆ end()

SmNodeArray::iterator SmStructureNode::end ( )
inline

Gets the last subnode.

Returns
last subnode

Definition at line 570 of file node.hxx.

References maSubNodes.

◆ GetAccessibleText()

void SmStructureNode::GetAccessibleText ( OUStringBuffer &  rText) const
overridevirtual

Appends to rText the node text.

Parameters
rText
Returns

Implements SmNode.

Definition at line 452 of file node.cxx.

References SmNode::GetAccessibleText(), SmNode::IsVisible(), and SmNode::SetAccessibleIndex().

◆ GetNumSubNodes()

size_t SmStructureNode::GetNumSubNodes ( ) const
overridevirtual

◆ GetSubNode() [1/3]

const SmNode * SmNode::GetSubNode ( size_t  nIndex) const
inline

Gets the subnode of index nIndex.

Parameters
nIndex
Returns
subnode of index nIndex

Definition at line 170 of file node.hxx.

◆ GetSubNode() [2/3]

SmNode * SmStructureNode::GetSubNode ( size_t  nIndex)
overridevirtual

◆ GetSubNode() [3/3]

virtual SmNode * SmNode::GetSubNode ( size_t  nIndex)
virtual

Gets the subnode of index nIndex.

Parameters
nIndex
Returns
subnode of index nIndex

Implements SmNode.

◆ GetSubNodeBinMo()

SmNode * SmStructureNode::GetSubNodeBinMo ( size_t  nIndex) const

Gets the subnode of index nIndex, used for operators.

Parameters
nIndex
Returns
subnode of index nIndex

Definition at line 440 of file node.cxx.

References BinDiagonal, SmNode::GetType(), maSubNodes, and nIndex.

◆ IndexOfSubNode()

int SmStructureNode::IndexOfSubNode ( SmNode const *  pSubNode)

Get the index of the child node pSubNode.

Returns -1, if pSubNode isn't a subnode of this.

Parameters
pSubNode
Returns
index of the child node

Definition at line 468 of file node.cxx.

References GetNumSubNodes(), GetSubNode(), and i.

Referenced by SmCursor::Delete(), SmCursor::DeletePrev(), SmCursor::InsertBrackets(), SmCursor::InsertFraction(), SmCursor::InsertNodes(), SmCursor::InsertRow(), SmCursor::InsertSubSup(), SmCursor::IsAtTailOfBracket(), and SmCursor::NodeToList().

◆ IsVisible()

bool SmStructureNode::IsVisible ( ) const
overridevirtual

Checks node visibility.

Returns true if this is an instance of SmVisibleNode's subclass, false otherwise.

Returns
node visibility

Implements SmNode.

Definition at line 425 of file node.cxx.

◆ rbegin()

SmNodeArray::reverse_iterator SmStructureNode::rbegin ( )
inline

Gets the last subnode.

Returns
last subnode

Definition at line 576 of file node.hxx.

References maSubNodes.

Referenced by SmNodeToTextVisitor::Visit().

◆ rend()

SmNodeArray::reverse_iterator SmStructureNode::rend ( )
inline

Gets the first subnode.

Returns
first subnode

Definition at line 582 of file node.hxx.

References maSubNodes.

Referenced by SmNodeToTextVisitor::Visit().

◆ SetSubNode()

void SmStructureNode::SetSubNode ( size_t  nIndex,
SmNode pNode 
)

Sets the subnode pNode at nIndex.

If necessary increases the subnodes length.

Parameters
nIndex
pNode
Returns

Definition at line 477 of file node.cxx.

References i, maSubNodes, nIndex, SmNode::SetParent(), and size.

Referenced by SmCursor::DeletePrev(), SmCursor::FinishEdit(), SmCursor::InsertRow(), SmCursor::NodeToList(), SmSubSupNode::SetBody(), and SmSubSupNode::SetSubSup().

◆ SetSubNodes() [1/3]

void SmStructureNode::SetSubNodes ( SmNode pFirst,
SmNode pSecond,
SmNode pThird 
)

Sets subnodes.

Parameters
pFirst
pSecond
pThird
Returns

Definition at line 378 of file node.cxx.

References ClaimPaternity(), and maSubNodes.

◆ SetSubNodes() [2/3]

void SmStructureNode::SetSubNodes ( SmNodeArray &&  rNodeArray)

Sets subnodes.

Parameters
rNodeArray
Returns

Definition at line 419 of file node.cxx.

References ClaimPaternity(), and maSubNodes.

◆ SetSubNodes() [3/3]

void SmStructureNode::SetSubNodes ( std::unique_ptr< SmNode pFirst,
std::unique_ptr< SmNode pSecond,
std::unique_ptr< SmNode pThird = nullptr 
)

Sets subnodes, used for operators.

Parameters
pFirst
pSecond
pThird
Returns

Definition at line 364 of file node.cxx.

References ClaimPaternity(), and maSubNodes.

Referenced by SmCloningVisitor::CloneKids(), SmCursor::DeletePrev(), SmNodeListParser::Expression(), SmNodeListParser::Factor(), SmCursor::InsertBrackets(), and SmCursor::InsertFraction().

◆ SetSubNodesBinMo()

void SmStructureNode::SetSubNodesBinMo ( std::unique_ptr< SmNode pFirst,
std::unique_ptr< SmNode pSecond,
std::unique_ptr< SmNode pThird = nullptr 
)

Sets subnodes, used for operators.

The data is reordered so the items are correctly ordered.

Parameters
pFirst
pSecond
pThird
Returns

Definition at line 392 of file node.cxx.

References BinDiagonal, ClaimPaternity(), SmNode::GetType(), and maSubNodes.

Member Data Documentation

◆ maSubNodes

SmNodeArray SmStructureNode::maSubNodes
private

The documentation for this class was generated from the following files: