LibreOffice Module starmath (master) 1
|
Representation of caret position with an equation. More...
#include <caret.hxx>
Public Member Functions | |
SmCaretPos (SmNode *selectedNode=nullptr, int iIndex=0) | |
bool | IsValid () const |
True, if this is a valid caret position. More... | |
bool | operator== (const SmCaretPos &pos) const |
Static Public Member Functions | |
static SmCaretPos | GetPosAfter (SmNode *pNode) |
Get the caret position after pNode, regardless of pNode. More... | |
Public Attributes | |
SmNode * | pSelectedNode |
Selected node. More... | |
int | nIndex |
Index (invariant: non-negative) within the selected node. More... | |
|
inlinestatic |
Get the caret position after pNode, regardless of pNode.
Gets the caret position following pNode, this is SmCaretPos(pNode, 1). Unless pNode is an instance of SmTextNode, then the index is the text length.
Definition at line 51 of file caret.hxx.
References getLength(), SmNode::GetType(), SmCaretPos(), and Text.
Referenced by SmCursor::InsertSubSup(), and SmCursor::PatchLineList().
|
inline |
True, if this is a valid caret position.
Definition at line 41 of file caret.hxx.
References pSelectedNode.
Referenced by SmCursor::BuildGraph(), SmCaretLinesVisitor::DoIt(), and SmCursor::InsertBrackets().
|
inline |
Definition at line 42 of file caret.hxx.
References nIndex, pos, and pSelectedNode.
int SmCaretPos::nIndex |
Index (invariant: non-negative) within the selected node.
0: Position in front of a node 1: Position after a node or after first char in SmTextNode n: Position after n char in SmTextNode
Notice how there's special cases for SmTextNode.
Definition at line 38 of file caret.hxx.
Referenced by SmCaretLinesVisitor::DefaultVisit(), SmCaretPos2LineVisitor::DefaultVisit(), SmSetSelectionVisitor::DefaultVisit(), SmCursor::DeletePrev(), SmCursor::FindPositionInLineList(), operator==(), SmCaretPos(), SmSetSelectionVisitor::SmSetSelectionVisitor(), SmCaretLinesVisitor::Visit(), SmCaretPos2LineVisitor::Visit(), SmSetSelectionVisitor::Visit(), and SmSetSelectionVisitor::VisitCompositionNode().
SmNode* SmCaretPos::pSelectedNode |
Selected node.
Definition at line 26 of file caret.hxx.
Referenced by SmSetSelectionVisitor::DefaultVisit(), SmCursor::DeletePrev(), SmCaretLinesVisitor::DoIt(), SmCursor::FindPositionInLineList(), SmCursor::InsertBrackets(), SmCursor::InsertFraction(), SmCursor::InsertRow(), SmCursor::InsertSubSup(), IsValid(), operator==(), SmCaretPos2LineVisitor::SmCaretPos2LineVisitor(), SmSetSelectionVisitor::SmSetSelectionVisitor(), SmSetSelectionVisitor::Visit(), and SmSetSelectionVisitor::VisitCompositionNode().