Kate::TextCursor
#include <katetextcursor.h>
Additional Inherited Members | |
Public Types inherited from KTextEditor::MovingCursor | |
enum | InsertBehavior { StayOnInsert = 0x0 , MoveOnInsert = 0x1 } |
enum | WrapBehavior { Wrap = 0x0 , NoWrap = 0x1 } |
Protected Member Functions inherited from KTextEditor::MovingCursor | |
MovingCursor () | |
Detailed Description
Class representing a 'clever' text cursor.
It will automagically move if the text inside the buffer it belongs to is modified. By intention no subclass of KTextEditor::Cursor, must be converted manually.
Definition at line 28 of file katetextcursor.h.
Constructor & Destructor Documentation
◆ TextCursor()
Kate::TextCursor::TextCursor | ( | TextBuffer * | buffer, |
const KTextEditor::Cursor | position, | ||
InsertBehavior | insertBehavior ) |
Construct a text cursor.
- Parameters
-
buffer text buffer this cursor belongs to position wanted cursor position, if not valid for given buffer, will lead to invalid cursor insertBehavior behavior of this cursor on insert of text at its position
Definition at line 18 of file katetextcursor.cpp.
◆ ~TextCursor()
|
override |
Destruct the text cursor.
Definition at line 35 of file katetextcursor.cpp.
Member Function Documentation
◆ column()
|
inlineoverridevirtual |
Retrieve the column on which this cursor is situated.
- Returns
- column number, where 0 is the first column.
Implements KTextEditor::MovingCursor.
Definition at line 137 of file katetextcursor.h.
◆ columnInternal()
|
inline |
Non-virtual version of column(), which is faster.
- Returns
- column number, where 0 is the first column.
Definition at line 146 of file katetextcursor.h.
◆ document()
|
overridevirtual |
Gets the document to which this cursor is bound.
- Returns
- a pointer to the document
Implements KTextEditor::MovingCursor.
Definition at line 104 of file katetextcursor.cpp.
◆ insertBehavior()
|
inlineoverridevirtual |
Get current insert behavior.
- Returns
- current insert behavior
Implements KTextEditor::MovingCursor.
Definition at line 76 of file katetextcursor.h.
◆ kateRange()
|
inline |
Get range this cursor belongs to, if any.
- Returns
- range this pointer is part of, else 0
Definition at line 161 of file katetextcursor.h.
◆ line()
|
inlineoverridevirtual |
Retrieve the line on which this cursor is situated.
- Returns
- line number, where 0 is the first line.
Implements KTextEditor::MovingCursor.
Definition at line 115 of file katetextcursor.h.
◆ lineInBlock()
|
inline |
Get offset into block this cursor belongs to, if any.
- Returns
- offset into block this pointer is part of, else -1
Definition at line 170 of file katetextcursor.h.
◆ lineInternal()
|
inline |
Non-virtual version of line(), which is faster.
Inlined for fast access (especially in KateTextBuffer::rangesForLine
- Returns
- line number, where 0 is the first line or -1 if invalid.
Definition at line 125 of file katetextcursor.h.
◆ range()
|
overridevirtual |
Get range this cursor belongs to, if any.
- Returns
- range this pointer is part of, else 0
Implements KTextEditor::MovingCursor.
Definition at line 109 of file katetextcursor.cpp.
◆ setInsertBehavior()
|
inlineoverridevirtual |
Set insert behavior.
- Parameters
-
insertBehavior new insert behavior
Implements KTextEditor::MovingCursor.
Definition at line 67 of file katetextcursor.h.
◆ setPosition() [1/3]
void Kate::TextCursor::setPosition | ( | const TextCursor & | position | ) |
Fast way to set the current cursor position to position.
- Parameters
-
position new cursor position
Definition at line 43 of file katetextcursor.cpp.
◆ setPosition() [2/3]
void Kate::TextCursor::setPosition | ( | int | line, |
int | column ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Set the cursor position to line and column.
- Parameters
-
line new cursor line column new cursor column
Definition at line 119 of file katetextcursor.cpp.
◆ setPosition() [3/3]
|
overridevirtual |
Set the current cursor position to position.
- Parameters
-
position new cursor position
Implements KTextEditor::MovingCursor.
Definition at line 114 of file katetextcursor.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.