kate Library API Documentation

KateSuperRange Class Reference

Represents a range of text, from the start() to the end(). More...

#include <katesupercursor.h>

Inheritance diagram for KateSuperRange:

QObject List of all members.

Public Types

enum  InsertBehaviour { DoNotExpand = 0, ExpandLeft = 0x1, ExpandRight = 0x2 }

Signals

void positionChanged ()
void positionUnChanged ()
void contentsChanged ()
void boundaryDeleted ()
void eliminated ()
void tagRange (KateSuperRange *range)

Public Methods

 KateSuperRange (KateSuperCursor *start, KateSuperCursor *end, QObject *parent=0L, const char *name=0L)
KateSuperCursorsuperStart ()
KateSuperCursorsuperEnd ()
int behaviour () const
void setBehaviour (int behaviour)
virtual bool isValid () const
bool owns (const KateTextCursor &cursor) const
bool includes (const KateTextCursor &cursor) const
bool includes (uint lineNum) const
bool includesWholeLine (uint lineNum) const
bool boundaryAt (const KateTextCursor &cursor) const
bool boundaryOn (uint lineNum) const

Detailed Description

Represents a range of text, from the start() to the end().

Also tracks its position and emits useful signals.

Definition at line 168 of file katesupercursor.h.


Member Enumeration Documentation

enum KateSuperRange::InsertBehaviour
 

Determine how the range reacts to characters inserted immediately outside the range.

Enumeration values:
DoNotExpand  Don't expand to encapsulate new characters in either direction. This is the default.
ExpandLeft  Expand to encapsulate new characters to the left of the range.
ExpandRight  Expand to encapsulate new characters to the right of the range.

Definition at line 176 of file katesupercursor.h.


Constructor & Destructor Documentation

KateSuperRange::KateSuperRange KateSuperCursor   start,
KateSuperCursor   end,
QObject   parent = 0L,
const char *    name = 0L
 

Constructor.

Takes posession of start and end.

Definition at line 275 of file katesupercursor.cpp.

References KStdAccel::end().


Member Function Documentation

KateSuperCursor & KateSuperRange::superStart  
 

Returns the super start cursor.

Definition at line 363 of file katesupercursor.cpp.

Referenced by boundaryAt(), boundaryOn(), includes(), includesWholeLine(), and isValid().

KateSuperCursor & KateSuperRange::superEnd  
 

Returns the super end cursor.

Definition at line 373 of file katesupercursor.cpp.

Referenced by boundaryAt(), boundaryOn(), includes(), includesWholeLine(), and isValid().

int KateSuperRange::behaviour  
 

Returns how this range reacts to characters inserted immediately outside the range.

Definition at line 383 of file katesupercursor.cpp.

References DoNotExpand, ExpandLeft, ExpandRight, and KateSuperCursor::moveOnInsert().

Referenced by setBehaviour().

void KateSuperRange::setBehaviour int    behaviour
 

Determine how the range should react to characters inserted immediately outside the range.

TODO does this need a custom function to enable determining of the behavior based on the text that is inserted / deleted?

See also:
InsertBehaviour

Definition at line 388 of file katesupercursor.cpp.

References behaviour(), ExpandLeft, ExpandRight, and KateSuperCursor::setMoveOnInsert().

bool KateSuperRange::isValid   [virtual]
 

Start and end must be valid and start <= end.

Definition at line 394 of file katesupercursor.cpp.

References superEnd(), and superStart().

Referenced by boundaryAt(), boundaryOn(), includes(), and includesWholeLine().

bool KateSuperRange::owns const KateTextCursor   cursor const
 

This is for use where the ranges are used in a heirachy, ie.

their parents are KateSuperRanges which completely encapsulate them.

Returns:
true if the range contains the cursor and no children also contain it; false otherwise.

Definition at line 399 of file katesupercursor.cpp.

References QObject::children(), and includes().

bool KateSuperRange::includes const KateTextCursor   cursor const
 

Returns true if the range includes cursor 's character.

Returns false if cursor == end().

Definition at line 412 of file katesupercursor.cpp.

References isValid(), superEnd(), and superStart().

Referenced by owns().

bool KateSuperRange::includes uint    lineNum const
 

Returns true if the range includes line.

Definition at line 417 of file katesupercursor.cpp.

References isValid(), KateTextCursor::line(), superEnd(), and superStart().

bool KateSuperRange::includesWholeLine uint    lineNum const
 

Returns true if the range totally encompasses line.

Definition at line 422 of file katesupercursor.cpp.

References KateSuperCursor::atEndOfLine(), KateSuperCursor::atStartOfLine(), isValid(), KateTextCursor::line(), superEnd(), and superStart().

bool KateSuperRange::boundaryAt const KateTextCursor   cursor const
 

Returns whether cursor is the site of a boundary of this range.

Definition at line 427 of file katesupercursor.cpp.

References isValid(), superEnd(), and superStart().

bool KateSuperRange::boundaryOn uint    lineNum const
 

Returns whether there is a boundary of this range on line.

Definition at line 432 of file katesupercursor.cpp.

References isValid(), KateTextCursor::line(), superEnd(), and superStart().

void KateSuperRange::positionChanged   [signal]
 

The range's position changed.

void KateSuperRange::positionUnChanged   [signal]
 

The range's position was unchanged.

void KateSuperRange::contentsChanged   [signal]
 

The contents of the range changed.

void KateSuperRange::boundaryDeleted   [signal]
 

Either cursor's surrounding characters were both deleted.

void KateSuperRange::eliminated   [signal]
 

The range now contains no characters (ie.

the start and end cursors are the same).

To eliminate this range under different conditions, connect the other signal directly to this signal.

void KateSuperRange::tagRange KateSuperRange *    range [signal]
 

Indicates the region needs re-drawing.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kate Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:37:44 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003