LibreOffice Module starmath (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SmMlElement Class Referencefinal

#include <element.hxx>

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

Public Member Functions

 SmMlElement ()
 
 SmMlElement (SmMlElementType aElementType)
 
 SmMlElement (const SmMlElement &aElement)
 
SmMlElementType getMlElementType () const
 Returns the mathml element type. More...
 
bool isMlElementType (SmMlElementType aElementType) const
 Check if the mathml element is of a given type. More...
 
const ESelectiongetESelection () const
 Returns the location in the source code of the node type. More...
 
const ESelectiongetESelectionReference () const
 Returns the location in the source code of the node type. More...
 
void setESelection (ESelection aESelection)
 Sets the location in the source code of the node type. More...
 
sal_Int32 GetSourceCodeRow () const
 Gets the line in the text where the node is located. More...
 
sal_Int32 GetSourceCodeColumn () const
 Gets the column of the line in the text where the node is located. More...
 
size_t getAttributeCount () const
 Returns the amount of available attributes. More...
 
SmMlAttribute getAttribute (size_t nAttributePos) const
 Gets a given attribute. More...
 
SmMlAttribute getAttribute (SmMlAttributeValueType aAttributeType) const
 Gets a given attribute. More...
 
void setAttribute (const SmMlAttribute *aAttribute)
 Sets a given attribute. More...
 
void setAttribute (const SmMlAttribute &aAttribute)
 Set's a given attribute. More...
 
bool isAttributeSet (SmMlAttributeValueType aAttributeType) const
 Checks if an attribute has been manually set. More...
 
size_t getSubElementsCount () const
 Returns the sub elements count. More...
 
SmMlElementgetSubElement (size_t nPos)
 Returns a given sub element. More...
 
const SmMlElementgetSubElement (size_t nPos) const
 Returns a given sub element. More...
 
void setSubElement (size_t nPos, SmMlElement *aElement)
 Sets a given sub element. More...
 
size_t getSubElementId () const
 Gets subelement id. More...
 
void setSubElementId (size_t nSubElementId)
 Sets subelement id. More...
 
SmMlElementgetParentElement ()
 Returns the parent element. More...
 
const SmMlElementgetParentElement () const
 Returns the parent element. More...
 
void setParentElement (SmMlElement *aParentElement)
 Sets the parent element No allocation / free is done. More...
 
const OUString & getText () const
 Returns the element text. More...
 
void setText (OUString aText)
 Returns the element text. 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
 

Private Member Functions

void SmImplAttributeType ()
 
const SmMlAttributegetAttributePointer (size_t nAttributePos) const
 Gets a given attribute. More...
 
void setAttributeForce (size_t nAttributePos, const SmMlAttribute *aAttribute)
 Sets a given attribute. More...
 

Private Attributes

SmMlElementType m_aElementType
 
OUString m_aText
 
ESelection m_aESelection
 
std::vector< SmMlAttributem_aAttributeList
 
std::vector< SmMlAttributePosm_aAttributePosList
 
std::vector< SmMlElement * > m_aSubElements
 
SmMlElementm_aParentElement
 
size_t m_nSubElementId
 

Detailed Description

Definition at line 17 of file element.hxx.

Constructor & Destructor Documentation

◆ SmMlElement() [1/3]

SmMlElement::SmMlElement ( )
inline

Definition at line 22 of file element.hxx.

References SmImplAttributeType(), and u.

◆ SmMlElement() [2/3]

SmMlElement::SmMlElement ( SmMlElementType  aElementType)
inline

Definition at line 37 of file element.hxx.

References SmImplAttributeType(), and u.

◆ SmMlElement() [3/3]

SmMlElement::SmMlElement ( const SmMlElement aElement)
inline

Member Function Documentation

◆ getAttribute() [1/2]

SmMlAttribute SmMlElement::getAttribute ( size_t  nAttributePos) const
inline

Gets a given attribute.

If no available returns empty attribute.

Parameters
nAttributePos
Returns
given attribute.

Definition at line 154 of file element.hxx.

References m_aAttributeList.

Referenced by SmMLExport::exportMlAttributes().

◆ getAttribute() [2/2]

SmMlAttribute SmMlElement::getAttribute ( SmMlAttributeValueType  aAttributeType) const

Gets a given attribute.

If no available returns empty attribute.

Parameters
nAttributePos
Returns
given attribute.

Definition at line 71 of file element.cxx.

References i, m_aAttributeList, and m_aAttributePosList.

◆ getAttributeCount()

size_t SmMlElement::getAttributeCount ( ) const
inline

Returns the amount of available attributes.

Returns
attribute count

Definition at line 146 of file element.hxx.

References m_aAttributeList.

Referenced by SmMLExport::exportMlAttributes(), and SmMlElement().

◆ getAttributePointer()

const SmMlAttribute * SmMlElement::getAttributePointer ( size_t  nAttributePos) const
inlineprivate

Gets a given attribute.

If no available returns empty attribute.

Parameters
nAttributePos
Returns
given attribute.

Definition at line 196 of file element.hxx.

References m_aAttributeList.

Referenced by SmMlElement().

◆ getESelection()

const ESelection & SmMlElement::getESelection ( ) const
inline

Returns the location in the source code of the node type.

Returns
selection

Definition at line 113 of file element.hxx.

References m_aESelection.

◆ getESelectionReference()

const ESelection & SmMlElement::getESelectionReference ( ) const
inline

Returns the location in the source code of the node type.

Returns
selection

Definition at line 119 of file element.hxx.

References m_aESelection.

◆ getMlElementType()

SmMlElementType SmMlElement::getMlElementType ( ) const
inline

Returns the mathml element type.

Returns
mathml element type

Definition at line 96 of file element.hxx.

References m_aElementType.

Referenced by SmMLExport::exportMlElement().

◆ getParentElement() [1/2]

SmMlElement * SmMlElement::getParentElement ( )
inline

Returns the parent element.

Returns
parent element

Definition at line 263 of file element.hxx.

References m_aParentElement.

Referenced by mathml::cloneElement(), exportMlElementTreeExec(), mathml::SmMlIteratorBottomToTop(), and mathml::SmMlIteratorTopToBottom().

◆ getParentElement() [2/2]

const SmMlElement * SmMlElement::getParentElement ( ) const
inline

Returns the parent element.

Returns
parent element

Definition at line 269 of file element.hxx.

References m_aParentElement.

◆ GetSourceCodeColumn()

sal_Int32 SmMlElement::GetSourceCodeColumn ( ) const
inline

Gets the column of the line in the text where the node is located.

It is used to do the visual <-> text correspondence.

Returns
column

Definition at line 139 of file element.hxx.

References m_aESelection, and ESelection::nStartPos.

◆ GetSourceCodeRow()

sal_Int32 SmMlElement::GetSourceCodeRow ( ) const
inline

Gets the line in the text where the node is located.

It is used to do the visual <-> text correspondence.

Returns
line

Definition at line 132 of file element.hxx.

References m_aESelection, and ESelection::nStartPara.

◆ getSubElement() [1/2]

SmMlElement * SmMlElement::getSubElement ( size_t  nPos)
inline

Returns a given sub element.

Parameters
nPos
Returns
sub elements

Definition at line 225 of file element.hxx.

References m_aSubElements, and nPos.

Referenced by SmMLImport::endDocument(), mathml::SmMlIteratorBottomToTop(), mathml::SmMlIteratorCopy(), mathml::SmMlIteratorFree(), and mathml::SmMlIteratorTopToBottom().

◆ getSubElement() [2/2]

const SmMlElement * SmMlElement::getSubElement ( size_t  nPos) const
inline

Returns a given sub element.

Parameters
nPos
Returns
sub elements

Definition at line 235 of file element.hxx.

References m_aSubElements, and nPos.

◆ getSubElementId()

size_t SmMlElement::getSubElementId ( ) const
inline

◆ getSubElementsCount()

size_t SmMlElement::getSubElementsCount ( ) const
inline

Returns the sub elements count.

Returns
sub elements count

Definition at line 218 of file element.hxx.

References m_aSubElements.

Referenced by mathml::cloneElement(), SmMLImport::endDocument(), exportMlElementTreeExec(), mathml::SmMlIteratorBottomToTop(), mathml::SmMlIteratorFree(), and mathml::SmMlIteratorTopToBottom().

◆ getText()

const OUString & SmMlElement::getText ( ) const
inline

Returns the element text.

Definition at line 282 of file element.hxx.

References m_aText.

Referenced by SmMLExport::exportMlElement().

◆ isAttributeSet()

bool SmMlElement::isAttributeSet ( SmMlAttributeValueType  aAttributeType) const

Checks if an attribute has been manually set.

Parameters
aElementType

Definition at line 82 of file element.cxx.

References i, m_aAttributeList, and m_aAttributePosList.

◆ isMlElementType()

bool SmMlElement::isMlElementType ( SmMlElementType  aElementType) const
inline

Check if the mathml element is of a given type.

Parameters
aElementType
Returns
is mathml element type

Definition at line 103 of file element.hxx.

References m_aElementType.

◆ setAttribute() [1/2]

void SmMlElement::setAttribute ( const SmMlAttribute aAttribute)
inline

Set's a given attribute.

If no available does nothing.

Parameters
nAttributePos
Returns
given attribute.

Definition at line 182 of file element.hxx.

References setAttribute().

Referenced by setAttribute().

◆ setAttribute() [2/2]

void SmMlElement::setAttribute ( const SmMlAttribute aAttribute)

Sets a given attribute.

If no available does nothing.

Parameters
nAttributePos
Returns
given attribute.

Definition at line 93 of file element.cxx.

References SmMlAttribute::getMlAttributeValueType(), i, m_aAttributeList, and m_aAttributePosList.

◆ setAttributeForce()

void SmMlElement::setAttributeForce ( size_t  nAttributePos,
const SmMlAttribute aAttribute 
)
inlineprivate

Sets a given attribute.

If no available undefined behaviour.

Parameters
nAttributePos
aAttribute
Returns
given attribute.

Definition at line 208 of file element.hxx.

References m_aAttributeList.

Referenced by SmMlElement().

◆ setESelection()

void SmMlElement::setESelection ( ESelection  aESelection)
inline

Sets the location in the source code of the node type.

Parameters
aESelection

Definition at line 125 of file element.hxx.

References m_aESelection.

◆ setParentElement()

void SmMlElement::setParentElement ( SmMlElement aParentElement)
inline

Sets the parent element No allocation / free is done.

Parameters
aParentElement

Definition at line 276 of file element.hxx.

References m_aParentElement.

Referenced by setSubElement().

◆ setSubElement()

void SmMlElement::setSubElement ( size_t  nPos,
SmMlElement aElement 
)

Sets a given sub element.

Parameters
nPos
aElement

Definition at line 106 of file element.cxx.

References m_aSubElements, nPos, setParentElement(), and setSubElementId().

Referenced by mathml::cloneElement().

◆ setSubElementId()

void SmMlElement::setSubElementId ( size_t  nSubElementId)
inline

Sets subelement id.

Parameters
nSubElementId

Definition at line 256 of file element.hxx.

References m_nSubElementId.

Referenced by setSubElement().

◆ setText()

void SmMlElement::setText ( OUString  aText)
inline

Returns the element text.

Definition at line 287 of file element.hxx.

References m_aText.

◆ SmImplAttributeType()

void SmMlElement::SmImplAttributeType ( )
private

Member Data Documentation

◆ m_aAttributeList

std::vector<SmMlAttribute> SmMlElement::m_aAttributeList
private

◆ m_aAttributePosList

std::vector<SmMlAttributePos> SmMlElement::m_aAttributePosList
private

◆ m_aElementType

SmMlElementType SmMlElement::m_aElementType
private

Definition at line 65 of file element.hxx.

Referenced by getMlElementType(), isMlElementType(), and SmImplAttributeType().

◆ m_aESelection

ESelection SmMlElement::m_aESelection
private

◆ m_aParentElement

SmMlElement* SmMlElement::m_aParentElement
private

Definition at line 83 of file element.hxx.

Referenced by getParentElement(), and setParentElement().

◆ m_aSubElements

std::vector<SmMlElement*> SmMlElement::m_aSubElements
private

Definition at line 80 of file element.hxx.

Referenced by getSubElement(), getSubElementsCount(), and setSubElement().

◆ m_aText

OUString SmMlElement::m_aText
private

Definition at line 68 of file element.hxx.

Referenced by getText(), and setText().

◆ m_nSubElementId

size_t SmMlElement::m_nSubElementId
private

Definition at line 86 of file element.hxx.

Referenced by getSubElementId(), and setSubElementId().


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