• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kate

KateTextLine Class Reference

The KateTextLine represents a line of text. More...

#include <katetextline.h>

Inheritance diagram for KateTextLine:
KShared

List of all members.

Public Types

enum  Flags {
  flagHlContinue = 1, flagAutoWrapped = 2, flagFoldingColumnsOutdated = 4, flagNoIndentationBasedFolding = 8,
  flagNoIndentationBasedFoldingAtStart = 16
}
typedef KSharedPtr< KateTextLine > Ptr

Public Member Functions

void addAttribute (int start, int length, int attribute)
QChar at (int column) const
uchar attribute (int pos) const
const QVector< int > & attributesList () const
void clearAttributes ()
const QVector< short > & ctxArray () const
bool endsWith (const QString &match) const
int firstChar () const
bool foldingColumnsOutdated () const
const QVector< int > & foldingListArray () const
int fromVirtualColumn (int column, int tabWidth) const
bool hlLineContinue () const
const QVector< unsigned short > & indentationDepthArray () const
int indentDepth (int tabWidth) const
void insertText (int pos, const QString &insText)
bool isAutoWrapped () const
 KateTextLine (const QChar *data, int length)
 KateTextLine ()
int lastChar () const
QString leadingWhitespace () const
int length () const
bool matchesAt (int column, const QString &match) const
int nextNonSpaceChar (uint pos) const
bool noIndentBasedFolding () const
bool noIndentBasedFoldingAtStart () const
QChar operator[] (int column) const
int previousNonSpaceChar (int pos) const
void removeText (uint pos, uint delLen)
bool searchText (uint startCol, const QRegExp &regexp, uint *foundAtCol, uint *matchLen, bool backwards=false) const
bool searchText (uint startCol, uint endCol, const QString &text, uint *foundAtCol, uint *matchLen, bool casesensitive=true, bool backwards=false) const
void setAutoWrapped (bool wrapped)
void setContext (QVector< short > &val)
void setFoldingColumnsOutdated (bool set)
void setFoldingList (QVector< int > &val)
void setHlLineContinue (bool cont)
void setIndentationDepth (QVector< unsigned short > &val)
void setNoIndentBasedFolding (bool val)
void setNoIndentBasedFoldingAtStart (bool val)
bool startsWith (const QString &match) const
QString string (int column, int length) const
const QString & string () const
int toVirtualColumn (int column, int tabWidth) const
void truncate (int newLen)
int virtualLength (int tabWidth) const
 ~KateTextLine ()

Detailed Description

The KateTextLine represents a line of text.

A text line that contains the text, an attribute for each character, an attribute for the free space behind the last character and a context number for the syntax highlight. The attribute stores the index to a table that contains fonts and colors and also if a character is selected.

Definition at line 39 of file katetextline.h.


Member Typedef Documentation

typedef KSharedPtr<KateTextLine> KateTextLine::Ptr

Define a Shared-Pointer type.

Definition at line 45 of file katetextline.h.


Member Enumeration Documentation

enum KateTextLine::Flags

Used Flags.

Enumerator:
flagHlContinue 
flagAutoWrapped 
flagFoldingColumnsOutdated 
flagNoIndentationBasedFolding 
flagNoIndentationBasedFoldingAtStart 

Definition at line 51 of file katetextline.h.


Constructor & Destructor Documentation

KateTextLine::KateTextLine (  ) 

Constructor Creates an empty text line with given attribute and syntax highlight context.

Definition at line 31 of file katetextline.cpp.

KateTextLine::KateTextLine ( const QChar *  data,
int  length 
)

Definition at line 36 of file katetextline.cpp.

KateTextLine::~KateTextLine (  ) 

Destructor.

Definition at line 41 of file katetextline.cpp.


Member Function Documentation

void KateTextLine::addAttribute ( int  start,
int  length,
int  attribute 
)

methodes to manipulate the attribute list

Definition at line 313 of file katetextline.cpp.

QChar KateTextLine::at ( int  column  )  const [inline]

Returns the character at the given column.

If column is out of range, the return value is QChar().

Definition at line 140 of file katetextline.h.

uchar KateTextLine::attribute ( int  pos  )  const [inline]

Gets the attribute at the given position use KRenderer::attributes to get the KTextAttribute for this.

Parameters:
pos position of attribute requested
Returns:
value of attribute

Definition at line 245 of file katetextline.h.

const QVector<int>& KateTextLine::attributesList (  )  const [inline]

Definition at line 363 of file katetextline.h.

void KateTextLine::clearAttributes (  )  [inline]

Definition at line 361 of file katetextline.h.

const QVector<short>& KateTextLine::ctxArray (  )  const [inline]

context stack

Returns:
context stack

Definition at line 263 of file katetextline.h.

bool KateTextLine::endsWith ( const QString &  match  )  const [inline]

Returns true, if the line ends with match, otherwise returns false.

Definition at line 207 of file katetextline.h.

int KateTextLine::firstChar (  )  const

Returns the position of the first non-whitespace character.

Returns:
position of first non-whitespace char or -1 if there is none

Definition at line 117 of file katetextline.cpp.

bool KateTextLine::foldingColumnsOutdated (  )  const [inline]

Returns true, if the folding colums are outdated, otherwise returns false.

Definition at line 88 of file katetextline.h.

const QVector<int>& KateTextLine::foldingListArray (  )  const [inline]

folding list

Returns:
folding array

Definition at line 274 of file katetextline.h.

int KateTextLine::fromVirtualColumn ( int  column,
int  tabWidth 
) const

Returns the "real" column where each tab only counts one character.

The conversion calculates with tabWidth characters for each tab.

Definition at line 198 of file katetextline.cpp.

bool KateTextLine::hlLineContinue (  )  const [inline]

Returns true, if the line's hl-continue flag is set, otherwise returns false.

The hl-continue flag is set in the hl-definition files.

Definition at line 100 of file katetextline.h.

const QVector<unsigned short>& KateTextLine::indentationDepthArray (  )  const [inline]

indentation stack

Returns:
indentation array

Definition at line 280 of file katetextline.h.

int KateTextLine::indentDepth ( int  tabWidth  )  const

Returns the indentation depth with each tab expanded into tabWidth characters.

Definition at line 135 of file katetextline.cpp.

void KateTextLine::insertText ( int  pos,
const QString &  insText 
)

insert text into line

Parameters:
pos insert position
insText text to insert

Definition at line 45 of file katetextline.cpp.

bool KateTextLine::isAutoWrapped (  )  const [inline]

Returns true, if the line was automagically wrapped, otherwise returns false.

Definition at line 106 of file katetextline.h.

int KateTextLine::lastChar (  )  const

Returns the position of the last non-whitespace character.

Returns:
position of last non-whitespace char or -1 if there is none

Definition at line 122 of file katetextline.cpp.

QString KateTextLine::leadingWhitespace (  )  const

Definition at line 127 of file katetextline.cpp.

int KateTextLine::length (  )  const [inline]

Returns the line's length.

Definition at line 94 of file katetextline.h.

bool KateTextLine::matchesAt ( int  column,
const QString &  match 
) const

Returns true, if match equals to the text at position column, otherwise returns false.

Definition at line 157 of file katetextline.cpp.

int KateTextLine::nextNonSpaceChar ( uint  pos  )  const

Find the position of the next char that is not a space.

Parameters:
pos Column of the character which is examined first.
Returns:
True if the specified or a following character is not a space Otherwise false.

Definition at line 83 of file katetextline.cpp.

bool KateTextLine::noIndentBasedFolding (  )  const [inline]
Returns:
true if any context at the line end has the noIndentBasedFolding flag set

Definition at line 268 of file katetextline.h.

bool KateTextLine::noIndentBasedFoldingAtStart (  )  const [inline]

Definition at line 269 of file katetextline.h.

QChar KateTextLine::operator[] ( int  column  )  const [inline]

Same as at().

Definition at line 151 of file katetextline.h.

int KateTextLine::previousNonSpaceChar ( int  pos  )  const

Find the position of the previous char that is not a space.

Parameters:
pos Column of the character which is examined first.
Returns:
The position of the first non-whitespace character preceding pos, or -1 if none is found.

Definition at line 97 of file katetextline.cpp.

void KateTextLine::removeText ( uint  pos,
uint  delLen 
)

remove text at given position

Parameters:
pos start position of remove
delLen length to remove

Definition at line 54 of file katetextline.cpp.

bool KateTextLine::searchText ( uint  startCol,
const QRegExp &  regexp,
uint *  foundAtCol,
uint *  matchLen,
bool  backwards = false 
) const

search given regexp

Parameters:
startCol column to start search
regexp regex to search for
foundAtCol column where text was found
matchLen length of matching
backwards search backwards?
Returns:
regexp found?

Definition at line 282 of file katetextline.cpp.

bool KateTextLine::searchText ( uint  startCol,
uint  endCol,
const QString &  text,
uint *  foundAtCol,
uint *  matchLen,
bool  casesensitive = true,
bool  backwards = false 
) const

search given string

Parameters:
startCol column to start search
endCol column to end search
text string to search for
foundAtCol column where text was found
matchLen length of matching
casesensitive should search be case-sensitive
backwards search backwards?
Returns:
string found?

Definition at line 239 of file katetextline.cpp.

void KateTextLine::setAutoWrapped ( bool  wrapped  )  [inline]

auto-wrapped

Parameters:
wrapped line was wrapped?

Definition at line 316 of file katetextline.h.

void KateTextLine::setContext ( QVector< short > &  val  )  [inline]

Sets the syntax highlight context number.

Parameters:
val new context array

Definition at line 326 of file katetextline.h.

void KateTextLine::setFoldingColumnsOutdated ( bool  set  )  [inline]

Methods to get data.

Set the flag that only positions have changed, not folding region begins/ends themselve

Definition at line 82 of file katetextline.h.

void KateTextLine::setFoldingList ( QVector< int > &  val  )  [inline]

update folding list

Parameters:
val new folding list

Definition at line 347 of file katetextline.h.

void KateTextLine::setHlLineContinue ( bool  cont  )  [inline]

set hl continue flag

Parameters:
cont continue flag?

Definition at line 306 of file katetextline.h.

void KateTextLine::setIndentationDepth ( QVector< unsigned short > &  val  )  [inline]

update indentation stack

Parameters:
val new indentation stack

Definition at line 353 of file katetextline.h.

void KateTextLine::setNoIndentBasedFolding ( bool  val  )  [inline]

sets if for the next line indent based folding should be disabled

Definition at line 331 of file katetextline.h.

void KateTextLine::setNoIndentBasedFoldingAtStart ( bool  val  )  [inline]

Definition at line 337 of file katetextline.h.

bool KateTextLine::startsWith ( const QString &  match  )  const [inline]

Returns true, if the line starts with match, otherwise returns false.

Definition at line 202 of file katetextline.h.

QString KateTextLine::string ( int  column,
int  length 
) const [inline]

Returns the substring with length beginning at the given column.

Definition at line 167 of file katetextline.h.

const QString& KateTextLine::string (  )  const [inline]

Returns the complete text line (as a QString reference).

Definition at line 162 of file katetextline.h.

int KateTextLine::toVirtualColumn ( int  column,
int  tabWidth 
) const

Returns the column with each tab expanded into tabWidth characters.

Definition at line 178 of file katetextline.cpp.

void KateTextLine::truncate ( int  newLen  ) 

Truncates the textline to the new length.

Parameters:
newLen new length of line

Definition at line 74 of file katetextline.cpp.

int KateTextLine::virtualLength ( int  tabWidth  )  const

Returns the text length with each tab expanded into tabWidth characters.

Definition at line 222 of file katetextline.cpp.


The documentation for this class was generated from the following files:
  • katetextline.h
  • katetextline.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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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