LibreOffice Module starmath (master) 1
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SmCaretPos Struct Reference

Representation of caret position with an equation. More...

#include <caret.hxx>

Collaboration diagram for SmCaretPos:
[legend]

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

SmNodepSelectedNode
 Selected node. More...
 
int nIndex
 Index (invariant: non-negative) within the selected node. More...
 

Detailed Description

Representation of caret position with an equation.

Definition at line 16 of file caret.hxx.

Constructor & Destructor Documentation

◆ SmCaretPos()

SmCaretPos::SmCaretPos ( SmNode selectedNode = nullptr,
int  iIndex = 0 
)
inline

Definition at line 18 of file caret.hxx.

References nIndex.

Referenced by GetPosAfter().

Member Function Documentation

◆ GetPosAfter()

static SmCaretPos SmCaretPos::GetPosAfter ( SmNode pNode)
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().

◆ IsValid()

bool SmCaretPos::IsValid ( ) const
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().

◆ operator==()

bool SmCaretPos::operator== ( const SmCaretPos pos) const
inline

Definition at line 42 of file caret.hxx.

References nIndex, pos, and pSelectedNode.

Member Data Documentation

◆ nIndex

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().

◆ pSelectedNode

SmNode* SmCaretPos::pSelectedNode

The documentation for this struct was generated from the following file: