KTextEditor
smartcursor.cpp
Go to the documentation of this file.
26SmartCursor::SmartCursor( const Cursor & position, Document * doc, InsertBehavior insertBehavior )
virtual void setPosition(const Cursor &position)
Set the current cursor position to position.
Definition cursor.cpp:96
void position(int &line, int &column) const
Get both the line and column of the cursor position.
Definition cursor.cpp:119
virtual QChar character(const Cursor &position) const =0
Get the character at cursor.
virtual int lineLength(int line) const =0
Get the length of a given line in characters.
virtual bool insertText(const Cursor &position, const QString &text, bool block=false)=0
Insert text at position.
Document * document() const
Returns the document to which this cursor is attached.
Definition smartcursor.cpp:68
InsertBehavior insertBehavior() const
Returns how this cursor behaves when text is inserted at the cursor.
Definition smartcursor.cpp:78
virtual bool atEndOfDocument() const
Determine if this cursor is located at the end of the document.
Definition smartcursor.cpp:43
void setInsertBehavior(InsertBehavior insertBehavior)
Change the behavior of the cursor when text is inserted at the cursor.
Definition smartcursor.cpp:83
SmartCursor(const Cursor &position, Document *doc, InsertBehavior insertBehavior)
Definition smartcursor.cpp:26
virtual bool insertText(const QStringList &text, bool block=false)
Insert text into the associated Document.
Definition smartcursor.cpp:53
QChar character() const
Returns the character in the document immediately after this position, ie.
Definition smartcursor.cpp:58
virtual SmartCursor * toSmartCursor() const
Returns this cursor as a SmartCursor.
Definition smartcursor.cpp:88
SmartRange * smartRange() const
Returns the range that this cursor belongs to, if any.
Definition smartcursor.cpp:63
virtual bool isSmartCursor() const
Returns that this cursor is a SmartCursor.
Definition smartcursor.cpp:48
virtual bool advance(int distance, AdvanceMode mode=ByCharacter)
Move cursor by specified distance along the document buffer.
Definition smartcursor.cpp:93
virtual bool atEndOfLine() const
Determine if this cursor is located at the end of the current line.
Definition smartcursor.cpp:73
@ ByCharacter
Movement is calculated on the basis of absolute numbers of characters.
Definition smartcursor.h:151
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.