Kate
KateTextLine Class Reference
The KateTextLine represents a line of text. More...
#include <katetextline.h>

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 |
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 ®exp, 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 |
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 | ( | ) |
Member Function Documentation
void KateTextLine::addAttribute | ( | int | start, | |
int | length, | |||
int | attribute | |||
) |
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 243 of file katetextline.h.
const QVector<int>& KateTextLine::attributesList | ( | ) | const [inline] |
Definition at line 361 of file katetextline.h.
void KateTextLine::clearAttributes | ( | ) | [inline] |
Definition at line 359 of file katetextline.h.
const QVector<short>& KateTextLine::ctxArray | ( | ) | const [inline] |
bool KateTextLine::endsWith | ( | const QString & | match | ) | const [inline] |
Returns true, if the line ends with match, otherwise returns false.
Definition at line 205 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] |
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 190 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] |
int KateTextLine::indentDepth | ( | int | tabWidth | ) | const |
Returns the indentation depth with each tab expanded into tabWidth characters.
Definition at line 127 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.
int KateTextLine::length | ( | ) | const [inline] |
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 149 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 266 of file katetextline.h.
bool KateTextLine::noIndentBasedFoldingAtStart | ( | ) | const [inline] |
Definition at line 267 of file katetextline.h.
QChar KateTextLine::operator[] | ( | int | column | ) | const [inline] |
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 274 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 231 of file katetextline.cpp.
void KateTextLine::setAutoWrapped | ( | bool | wrapped | ) | [inline] |
void KateTextLine::setContext | ( | QVector< short > & | val | ) | [inline] |
Sets the syntax highlight context number.
- Parameters:
-
val new context array
Definition at line 324 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] |
void KateTextLine::setHlLineContinue | ( | bool | cont | ) | [inline] |
void KateTextLine::setIndentationDepth | ( | QVector< unsigned short > & | val | ) | [inline] |
update indentation stack
- Parameters:
-
val new indentation stack
Definition at line 351 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 329 of file katetextline.h.
void KateTextLine::setNoIndentBasedFoldingAtStart | ( | bool | val | ) | [inline] |
Definition at line 335 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 200 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 170 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 214 of file katetextline.cpp.
The documentation for this class was generated from the following files: