kformula/flake
FormulaCursor Class Reference
The cursor being moved through a formula. More...
#include <FormulaCursor.h>
Public Member Functions | |
| FormulaCursor (const FormulaCursor &other) | |
| FormulaCursor () | |
| FormulaCursor (BasicElement *element, int position) | |
| FormulaCursor (BasicElement *element, bool selecting, int position, int mark) | |
| BasicElement * | currentElement () const |
| CursorDirection | direction () const |
| QPointF | getCursorPosition () |
| bool | hasSelection () const |
| bool | insideFixedElement () const |
| bool | insideInferredRow () const |
| bool | insideToken () const |
| bool | isAccepted () const |
| bool | isEnd () const |
| bool | isHome () const |
| bool | isSelecting () const |
| int | mark () const |
| void | move (CursorDirection direction) |
| bool | moveCloseTo (BasicElement *element, FormulaCursor &cursor) |
| void | moveEnd () |
| void | moveHome () |
| void | moveTo (BasicElement *element) |
| void | moveTo (BasicElement *element, int position) |
| void | moveTo (const FormulaCursor &pos) |
| int | offset () |
| FormulaCursor & | operator+= (int step) |
| void | paint (QPainter &painter) const |
| bool | performMovement (FormulaCursor &oldcursor) |
| int | position () const |
| void | selectElement (BasicElement *element) |
| QPair< int, int > | selection () const |
| void | setCurrentElement (BasicElement *element) |
| void | setCursorTo (const QPointF &point) |
| void | setMark (int position) |
| void | setPosition (int position) |
| void | setSelecting (bool selecting) |
Detailed Description
The cursor being moved through a formula.
The FormulaCursor is used to store a cursor position (or selection) in a formula as well as to manipulate it. It therefore has a selection state, a starting position and (if it is selecting) a selection end position, called mark.
Definition at line 56 of file FormulaCursor.h.
Constructor & Destructor Documentation
| FormulaCursor::FormulaCursor | ( | BasicElement * | element, | |
| bool | selecting, | |||
| int | position, | |||
| int | mark | |||
| ) |
Definition at line 42 of file FormulaCursor.cpp.
| FormulaCursor::FormulaCursor | ( | BasicElement * | element, | |
| int | position | |||
| ) |
Definition at line 49 of file FormulaCursor.cpp.
| FormulaCursor::FormulaCursor | ( | ) |
Definition at line 58 of file FormulaCursor.cpp.
| FormulaCursor::FormulaCursor | ( | const FormulaCursor & | other | ) |
Definition at line 63 of file FormulaCursor.cpp.
Member Function Documentation
| BasicElement * FormulaCursor::currentElement | ( | ) | const |
- Returns:
- The element the FormulaCursor is currently inside
Definition at line 287 of file FormulaCursor.cpp.
| CursorDirection FormulaCursor::direction | ( | ) | const |
- Returns:
- The current direction the cursor is moving in
Definition at line 305 of file FormulaCursor.cpp.
| QPointF FormulaCursor::getCursorPosition | ( | ) |
- Returns:
- the midpoint of the current cursorLine in global coordinates
Definition at line 161 of file FormulaCursor.cpp.
| bool FormulaCursor::hasSelection | ( | ) | const |
- Returns:
truewhen the cursor is selecting
Definition at line 343 of file FormulaCursor.cpp.
| bool FormulaCursor::insideFixedElement | ( | ) | const |
- Returns:
- true if the cursor is inside a element with fixed number of children
Definition at line 272 of file FormulaCursor.cpp.
| bool FormulaCursor::insideInferredRow | ( | ) | const |
- Returns:
- true if the cursor is inside a row or inferred row
Definition at line 267 of file FormulaCursor.cpp.
| bool FormulaCursor::insideToken | ( | ) | const |
- Returns:
- true if the cursor is inside a token element
Definition at line 257 of file FormulaCursor.cpp.
| bool FormulaCursor::isAccepted | ( | ) | const |
- Returns:
- checks if the cursor is valid were it is
Definition at line 349 of file FormulaCursor.cpp.
| bool FormulaCursor::isEnd | ( | ) | const |
- Returns:
- whether the cursor is at the last position
Definition at line 252 of file FormulaCursor.cpp.
| bool FormulaCursor::isHome | ( | ) | const |
- Returns:
- whether the cursor is at the first position
Definition at line 247 of file FormulaCursor.cpp.
| bool FormulaCursor::isSelecting | ( | ) | const |
- Returns:
truewhen the cursor is selecting
Definition at line 310 of file FormulaCursor.cpp.
| int FormulaCursor::mark | ( | ) | const |
- Returns:
- the selection starting position
Definition at line 232 of file FormulaCursor.cpp.
| void FormulaCursor::move | ( | CursorDirection | direction | ) |
Move the cursor in the specified direction.
Definition at line 142 of file FormulaCursor.cpp.
| bool FormulaCursor::moveCloseTo | ( | BasicElement * | element, | |
| FormulaCursor & | cursor | |||
| ) |
Put the cursor in element, as close as possible to the point where cursor is.
Definition at line 152 of file FormulaCursor.cpp.
| void FormulaCursor::moveEnd | ( | ) |
Move the cursor to the last position in the current element.
Definition at line 242 of file FormulaCursor.cpp.
| void FormulaCursor::moveHome | ( | ) |
Move the cursor to the first position in the current element.
Definition at line 237 of file FormulaCursor.cpp.
| void FormulaCursor::moveTo | ( | BasicElement * | element | ) |
Definition at line 176 of file FormulaCursor.cpp.
| void FormulaCursor::moveTo | ( | BasicElement * | element, | |
| int | position | |||
| ) |
Definition at line 185 of file FormulaCursor.cpp.
| void FormulaCursor::moveTo | ( | const FormulaCursor & | pos | ) |
Definition at line 167 of file FormulaCursor.cpp.
| int FormulaCursor::offset | ( | ) |
Definition at line 424 of file FormulaCursor.cpp.
| FormulaCursor & FormulaCursor::operator+= | ( | int | step | ) |
Definition at line 418 of file FormulaCursor.cpp.
| void FormulaCursor::paint | ( | QPainter & | painter | ) | const |
Draw the cursor to the given QPainter.
- Parameters:
-
painter The QPainter the cursor draws itsself to
Definition at line 72 of file FormulaCursor.cpp.
| bool FormulaCursor::performMovement | ( | FormulaCursor & | oldcursor | ) |
Definition at line 358 of file FormulaCursor.cpp.
| int FormulaCursor::position | ( | ) | const |
- Returns:
- The current position in m_currentElement
Definition at line 292 of file FormulaCursor.cpp.
| void FormulaCursor::selectElement | ( | BasicElement * | element | ) |
select the element completely
Definition at line 134 of file FormulaCursor.cpp.
| QPair< int, int > FormulaCursor::selection | ( | ) | const |
return the end and beginning of the current selection where the first element is the smaller one
Definition at line 333 of file FormulaCursor.cpp.
| void FormulaCursor::setCurrentElement | ( | BasicElement * | element | ) |
set the element, in which the cursor is
Definition at line 297 of file FormulaCursor.cpp.
| void FormulaCursor::setCursorTo | ( | const QPointF & | point | ) |
Set the cursor to the element at point.
Definition at line 191 of file FormulaCursor.cpp.
| void FormulaCursor::setMark | ( | int | position | ) |
set the start position of the selection
Definition at line 329 of file FormulaCursor.cpp.
| void FormulaCursor::setPosition | ( | int | position | ) |
set the position of the cursor in the current element
Definition at line 301 of file FormulaCursor.cpp.
| void FormulaCursor::setSelecting | ( | bool | selecting | ) |
Make the cursor selecting.
- Parameters:
-
selecting When true the cursor is selecting
Definition at line 315 of file FormulaCursor.cpp.
The documentation for this class was generated from the following files:
