19#define HORIZONTICAL_DISTANCE_FACTOR 10
256 rList.push_front(pNode);
270 void InsertNodes(std::unique_ptr<SmNodeList> pNewNodes);
405 return pList->front();
void Delete()
Delete the current selection or do nothing.
void InsertElement(SmFormulaElement element)
Insert an element into the formula.
static SmNodeList::iterator TakeSelectedNodesFromList(SmNodeList *pLineList, SmNodeList *pSelectedNodes=nullptr)
Take selected nodes from a list.
void InsertFraction()
Insert a fraction, use selection as numerator.
SmCaretPosGraphEntry * mpPosition
const SmCaretPos & GetPosition() const
Get position.
void InsertBrackets(SmBracketType eBracketType)
Create brackets around current selection, or new SmPlaceNode.
void Copy()
Copy the current selection.
static SmNode * CreateBracket(SmBracketType eBracketType, bool bIsLeft)
Create an instance of SmMathSymbolNode usable for brackets.
void DeletePrev(OutputDevice *pDev)
Delete selection, previous element or merge lines.
void Draw(OutputDevice &pDev, Point Offset, bool isCaretVisible)
Draw the caret.
SmNode * mpTree
Formula tree.
static SmNode * FindTopMostNodeInLine(SmNode *pSNode, bool MoveUpIfSelected=false)
Finds the topmost node in a visual line.
SmCursor(SmNode *tree, SmDocShell *pShell)
SmCaretPosGraphEntry * mpAnchor
bool HasSelection() const
True, if the cursor has a selection.
bool IsAtTailOfBracket(SmBracketType eBracketType) const
static std::unique_ptr< SmNodeList > CloneList(SmClipboard &rClipboard)
Clone list of nodes in a clipboard (creates a deep clone)
void InsertNodes(std::unique_ptr< SmNodeList > pNewNodes)
Insert new nodes in the tree after position.
int CountSelectedNodes(SmNode *pNode)
Count number of selected nodes, excluding line composition nodes.
void FinishEdit(std::unique_ptr< SmNodeList > pLineList, SmStructureNode *pParent, int nParentIndex, SmCaretPos PosAfterEdit, SmNode *pStartLine=nullptr)
Finish editing.
void EndEdit()
End edit section where the tree will be modified.
void MoveTo(OutputDevice *pDev, const Point &pos, bool bMoveAnchor)
Move to the caret position closest to a given point.
static void NodeToList(SmNode *&rpNode, SmNodeList &rList)
Auxiliary function for calling LineToList on a node.
SmClipboard maClipboard
Clipboard holder.
void Cut()
Cut the current selection.
void Paste()
Paste the clipboard.
SmNode * FindSelectedNode(SmNode *pNode)
Returns a node that is selected, if any could be found.
static void CloneLineToClipboard(SmStructureNode *pLine, SmClipboard *pClipboard)
Clone a visual line to a clipboard.
void BuildGraph()
Build pGraph over caret positions.
SmDocShell * mpDocShell
Owner of the formula tree.
void RequestRepaint()
Request the formula is repainted.
bool SetCaretPosition(SmCaretPos pos)
tries to set position to a specific SmCaretPos
int mnEditSections
The number of times BeginEdit have been called Used to allow nesting of BeginEdit() and EndEdit() sec...
bool HasComplexSelection()
Returns true if more than one node is selected.
static bool IsLineCompositionNode(SmNode const *pNode)
Is this one of the nodes used to compose a line.
std::unique_ptr< SmCaretPosGraph > mpGraph
Graph over caret position in the current tree.
tools::Rectangle GetCaretRectangle(OutputDevice &rOutDev) const
void InsertSubSup(SmSubSup eSubSup)
Create sub-/super script.
void InsertCommandText(const OUString &aCommandText)
Insert command text translated into line entries at position.
static SmNodeList::iterator FindPositionInLineList(SmNodeList *pLineList, const SmCaretPos &rCaretPos)
Find an iterator pointing to the node in pLineList following rCaretPos.
bool InsertRow()
Insert a new row or newline.
void BeginEdit()
Begin edit section where the tree will be modified.
bool mbIsEnabledSetModifiedSmDocShell
Holds data for BeginEdit() and EndEdit()
static void LineToList(SmStructureNode *pLine, SmNodeList &rList)
Convert a visual line to a list.
static SmCaretPos PatchLineList(SmNodeList *pLineList, SmNodeList::iterator aIter)
Patch a line list after modification, merge SmTextNode, remove SmPlaceNode etc.
void AnnotateSelection() const
Set selected on nodes of the tree.
void InsertText(const OUString &aString)
Insert text at the current position.
void Move(OutputDevice *pDev, SmMovementDirection direction, bool bMoveAnchor=true)
Move the position of this cursor.
tools::Rectangle GetSelectionRectangle(OutputDevice &rOutDev) const
void InsertSpecial(std::u16string_view aString)
Insert a special node created from aString.
Minimalistic recursive decent SmNodeList parser.
SmNode * Parse(SmNodeList *list)
Parse a list of nodes to an expression.
static bool IsOperator(const SmToken &token)
True, if the token is an operator.
static bool IsRelationOperator(const SmToken &token)
True, if the token is a relation operator.
SmNode * Next()
Move to next terminal.
SmNode * Take()
Take the current terminal.
static bool IsProductOperator(const SmToken &token)
True, if the token is a product operator.
static bool IsUnaryOperator(const SmToken &token)
True, if the token is a unary operator.
SmNodeListParser()
Create an instance of SmNodeListParser.
static bool IsSumOperator(const SmToken &token)
True, if the token is a sum operator.
static bool IsPostfixOperator(const SmToken &token)
True, if the token is a postfix operator.
SmNode * Terminal()
Get the current terminal.
const SmStructureNode * GetParent() const
Gets the parent node of this node.
Abstract baseclass for all composite node.
int IndexOfSubNode(SmNode const *pSubNode)
Get the index of the child node pSubNode.
void SetSubNode(size_t nIndex, SmNode *pNode)
Sets the subnode pNode at nIndex.
SmFormulaElement
Enum of elements that can inserted into a formula.
std::list< SmNode * > SmNodeList
A list of nodes.
std::list< std::unique_ptr< SmNode > > SmClipboard
SmBracketType
Bracket types that can be inserted.
@ Curly
Curly brackets, left command "lbrace".
SmMovementDirection
Enum of direction for movement.
SmSubSup
Enum used to index sub-/supscripts in the 'maSubNodes' array in 'SmSubSupNode'.
An entry in SmCaretPosGraph.
const SmCaretPos CaretPos
Caret position.
Representation of caret position with an equation.