• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

Kate

  • Kate
  • TextCursor
Public Member Functions

Kate::TextCursor Class Reference

Class representing a 'clever' text cursor. More...

#include <katetextcursor.h>

Inheritance diagram for Kate::TextCursor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 TextCursor (TextBuffer &buffer, const KTextEditor::Cursor &position, InsertBehavior insertBehavior)
 ~TextCursor ()
TextBlock * block () const
int column () const
int columnInternal () const
KTextEditor::Document * document () const
InsertBehavior insertBehavior () const
Kate::TextRange * kateRange () const
int line () const
int lineInBlock () const
int lineInternal () const
KTextEditor::MovingRange * range () const
void setInsertBehavior (InsertBehavior insertBehavior)
void setPosition (const TextCursor &position)
void setPosition (const KTextEditor::Cursor &position)
void setPosition (int line, int column)

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 43 of file katetextcursor.h.


Constructor & Destructor Documentation

Kate::TextCursor::TextCursor ( TextBuffer &  buffer,
const KTextEditor::Cursor &  position,
InsertBehavior  insertBehavior 
)

Construct a text cursor.

Parameters:
buffertext buffer this cursor belongs to
positionwanted cursor position, if not valid for given buffer, will lead to invalid cursor
insertBehaviorbehavior of this cursor on insert of text at it's position

Definition at line 29 of file katetextcursor.cpp.

Kate::TextCursor::~TextCursor ( )

Destruct the text cursor.

Definition at line 53 of file katetextcursor.cpp.


Member Function Documentation

TextBlock* Kate::TextCursor::block ( ) const [inline]

Get block this cursor belongs to, if any.

Returns:
block this pointer is part of, else 0

Definition at line 165 of file katetextcursor.h.

int Kate::TextCursor::column ( ) const [inline, virtual]

Retrieve the column on which this cursor is situated.

Returns:
column number, where 0 is the first column.

Implements KTextEditor::MovingCursor.

Definition at line 141 of file katetextcursor.h.

int Kate::TextCursor::columnInternal ( ) const [inline]

Non-virtual version of column(), which is faster.

Returns:
column number, where 0 is the first column.

Definition at line 147 of file katetextcursor.h.

KTextEditor::Document * Kate::TextCursor::document ( ) const [virtual]

Gets the document to which this cursor is bound.

Returns:
a pointer to the document

Implements KTextEditor::MovingCursor.

Definition at line 135 of file katetextcursor.cpp.

InsertBehavior Kate::TextCursor::insertBehavior ( ) const [inline, virtual]

Get current insert behavior.

Returns:
current insert behavior

Implements KTextEditor::MovingCursor.

Definition at line 84 of file katetextcursor.h.

Kate::TextRange* Kate::TextCursor::kateRange ( ) const [inline]

Get range this cursor belongs to, if any.

Returns:
range this pointer is part of, else 0

Definition at line 159 of file katetextcursor.h.

int Kate::TextCursor::line ( ) const [virtual]

Retrieve the line on which this cursor is situated.

Returns:
line number, where 0 is the first line.

Implements KTextEditor::MovingCursor.

Definition at line 125 of file katetextcursor.cpp.

int Kate::TextCursor::lineInBlock ( ) const [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 171 of file katetextcursor.h.

int Kate::TextCursor::lineInternal ( ) const [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.

Definition at line 127 of file katetextcursor.h.

KTextEditor::MovingRange * Kate::TextCursor::range ( ) const [virtual]

Get range this cursor belongs to, if any.

Returns:
range this pointer is part of, else 0

Implements KTextEditor::MovingCursor.

Definition at line 140 of file katetextcursor.cpp.

void Kate::TextCursor::setInsertBehavior ( InsertBehavior  insertBehavior) [inline, virtual]

Set insert behavior.

Parameters:
insertBehaviornew insert behavior

Implements KTextEditor::MovingCursor.

Definition at line 78 of file katetextcursor.h.

void Kate::TextCursor::setPosition ( const TextCursor &  position)

Fast way to set the current cursor position to position.

Parameters:
positionnew cursor position

Definition at line 64 of file katetextcursor.cpp.

void Kate::TextCursor::setPosition ( const KTextEditor::Cursor &  position) [virtual]

Set the current cursor position to position.

Parameters:
positionnew cursor position

Implements KTextEditor::MovingCursor.

Definition at line 120 of file katetextcursor.cpp.

void Kate::TextCursor::setPosition ( int  line,
int  column 
) [inline]

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:
linenew cursor line
columnnew cursor column

Reimplemented from KTextEditor::MovingCursor.

Definition at line 114 of file katetextcursor.h.


The documentation for this class was generated from the following files:
  • katetextcursor.h
  • katetextcursor.cpp

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal