Kate
Kate::TextLineData Class Reference
Class representing a single text line. More...
#include <katetextline.h>
Public Types | |
| enum | Flags { flagHlContinue = 1, flagAutoWrapped = 2, flagFoldingColumnsOutdated = 4, flagNoIndentationBasedFolding = 8, flagNoIndentationBasedFoldingAtStart = 16 } |
Public Member Functions | |
| TextLineData () | |
| TextLineData (const QString &text) | |
| ~TextLineData () | |
| void | addAttribute (int start, int length, int attribute) |
| QChar | at (int column) const |
| int | 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 |
| bool | isAutoWrapped () const |
| int | lastChar () const |
| QString | leadingWhitespace () const |
| int | length () const |
| bool | matchesAt (int column, const QString &match) const |
| int | nextNonSpaceChar (int pos) const |
| bool | noIndentBasedFolding () const |
| bool | noIndentBasedFoldingAtStart () const |
| QChar | operator[] (int column) const |
| int | previousNonSpaceChar (int pos) 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 |
| const QString & | string () const |
| QString | string (int column, int length) const |
| const QString & | text () const |
| int | toVirtualColumn (int column, int tabWidth) const |
| int | virtualLength (int tabWidth) const |
Detailed Description
Class representing a single text line.
For efficience reasons, not only pure text is stored here, but also additional data. Will be only accessed over shared pointers.
Definition at line 37 of file katetextline.h.
Member Enumeration Documentation
Flags of TextLineData.
- Enumerator:
flagHlContinue flagAutoWrapped flagFoldingColumnsOutdated flagNoIndentationBasedFolding flagNoIndentationBasedFoldingAtStart
Definition at line 48 of file katetextline.h.
Constructor & Destructor Documentation
| Kate::TextLineData::TextLineData | ( | ) |
Construct an empty text line.
Definition at line 25 of file katetextline.cpp.
| Kate::TextLineData::TextLineData | ( | const QString & | text | ) |
Construct an text line with given text.
- Parameters:
-
text text to use for this line
Definition at line 30 of file katetextline.cpp.
| Kate::TextLineData::~TextLineData | ( | ) |
Destruct the text line.
Definition at line 36 of file katetextline.cpp.
Member Function Documentation
| void Kate::TextLineData::addAttribute | ( | int | start, |
| int | length, | ||
| int | attribute | ||
| ) |
Add attribute for given start + length to this line.
- Parameters:
-
start start column of this attribute length length in chars this attribute should span attribute attribute to use
Definition at line 185 of file katetextline.cpp.
| QChar Kate::TextLineData::at | ( | int | column | ) | const [inline] |
Returns the character at the given column.
If column is out of range, the return value is QChar().
- Parameters:
-
column column you want char for
- Returns:
- char at given column or QChar()
Definition at line 113 of file katetextline.h.
| int Kate::TextLineData::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 234 of file katetextline.h.
| const QVector<int>& Kate::TextLineData::attributesList | ( | ) | const [inline] |
Accessor to attributes.
- Returns:
- attributes of this line
Definition at line 293 of file katetextline.h.
| void Kate::TextLineData::clearAttributes | ( | ) | [inline] |
Clear attributes of this line.
Definition at line 287 of file katetextline.h.
| const QVector<short>& Kate::TextLineData::ctxArray | ( | ) | const [inline] |
Returns true, if the line ends with match, otherwise returns false.
Definition at line 225 of file katetextline.h.
| int Kate::TextLineData::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 40 of file katetextline.cpp.
| bool Kate::TextLineData::foldingColumnsOutdated | ( | ) | const [inline] |
Returns true, if the folding columns are outdated, otherwise returns false.
- Returns:
- folding columns our of date?
Definition at line 148 of file katetextline.h.
| const QVector<int>& Kate::TextLineData::foldingListArray | ( | ) | const [inline] |
| int Kate::TextLineData::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 144 of file katetextline.cpp.
| bool Kate::TextLineData::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.
- Returns:
- hl-continue flag is set
Definition at line 160 of file katetextline.h.
| const QVector<unsigned short>& Kate::TextLineData::indentationDepthArray | ( | ) | const [inline] |
| int Kate::TextLineData::indentDepth | ( | int | tabWidth | ) | const |
Returns the indentation depth with each tab expanded into tabWidth characters.
Definition at line 81 of file katetextline.cpp.
| bool Kate::TextLineData::isAutoWrapped | ( | ) | const [inline] |
Returns true, if the line was automagically wrapped, otherwise returns false.
- Returns:
- was this line auto-wrapped?
Definition at line 167 of file katetextline.h.
| int Kate::TextLineData::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 45 of file katetextline.cpp.
| QString Kate::TextLineData::leadingWhitespace | ( | ) | const |
Leading whitespace of this line.
- Returns:
- leading whitespace of this line
Definition at line 73 of file katetextline.cpp.
| int Kate::TextLineData::length | ( | ) | const [inline] |
Returns the line's length.
Definition at line 153 of file katetextline.h.
Returns true, if match equals to the text at position column, otherwise returns false.
Definition at line 103 of file katetextline.cpp.
| int Kate::TextLineData::nextNonSpaceChar | ( | int | 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 50 of file katetextline.cpp.
| bool Kate::TextLineData::noIndentBasedFolding | ( | ) | const [inline] |
- Returns:
- true if any context at the line end has the noIndentBasedFolding flag set
Definition at line 257 of file katetextline.h.
| bool Kate::TextLineData::noIndentBasedFoldingAtStart | ( | ) | const [inline] |
- Returns:
- true if any context at the line end has the noIndentationBasedFoldingAtStart flag set
Definition at line 262 of file katetextline.h.
| QChar Kate::TextLineData::operator[] | ( | int | column | ) | const [inline] |
Same as at().
- Parameters:
-
column column you want char for
- Returns:
- char at given column or QChar()
Definition at line 126 of file katetextline.h.
| int Kate::TextLineData::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 61 of file katetextline.cpp.
| void Kate::TextLineData::setAutoWrapped | ( | bool | wrapped | ) | [inline] |
set auto-wrapped property
- Parameters:
-
wrapped line was wrapped?
Definition at line 309 of file katetextline.h.
| void Kate::TextLineData::setContext | ( | QVector< short > & | val | ) | [inline] |
Sets the syntax highlight context number.
- Parameters:
-
val new context array
Definition at line 319 of file katetextline.h.
| void Kate::TextLineData::setFoldingColumnsOutdated | ( | bool | set | ) | [inline] |
Set the flag that only positions have changed, not folding region begins/ends themselve.
- Parameters:
-
set folding columns our of date?
Definition at line 138 of file katetextline.h.
| void Kate::TextLineData::setFoldingList | ( | QVector< int > & | val | ) | [inline] |
| void Kate::TextLineData::setHlLineContinue | ( | bool | cont | ) | [inline] |
| void Kate::TextLineData::setIndentationDepth | ( | QVector< unsigned short > & | val | ) | [inline] |
update indentation stack
- Parameters:
-
val new indentation stack
Definition at line 351 of file katetextline.h.
| void Kate::TextLineData::setNoIndentBasedFolding | ( | bool | val | ) | [inline] |
sets if for the next line indent based folding should be disabled
- Parameters:
-
val should indent folding be disabled
Definition at line 325 of file katetextline.h.
| void Kate::TextLineData::setNoIndentBasedFoldingAtStart | ( | bool | val | ) | [inline] |
sets if indent based folding should be disabled at start
- Parameters:
-
val should indent based folding be disabled at start
Definition at line 335 of file katetextline.h.
Returns true, if the line starts with match, otherwise returns false.
Definition at line 220 of file katetextline.h.
| QString Kate::TextLineData::string | ( | int | column, |
| int | length | ||
| ) | const [inline] |
Returns the substring with length beginning at the given column.
- Parameters:
-
column start column of text to return length length of text to return
- Returns:
- wanted part of text
Definition at line 181 of file katetextline.h.
| const QString& Kate::TextLineData::string | ( | ) | const [inline] |
Returns the complete text line (as a QString reference).
- Returns:
- text of this line, read-only
Definition at line 173 of file katetextline.h.
| const QString& Kate::TextLineData::text | ( | ) | const [inline] |
Accessor to the text contained in this line.
- Returns:
- text of this line as constant reference
Definition at line 77 of file katetextline.h.
| int Kate::TextLineData::toVirtualColumn | ( | int | column, |
| int | tabWidth | ||
| ) | const |
Returns the column with each tab expanded into tabWidth characters.
Definition at line 124 of file katetextline.cpp.
| int Kate::TextLineData::virtualLength | ( | int | tabWidth | ) | const |
Returns the text length with each tab expanded into tabWidth characters.
Definition at line 168 of file katetextline.cpp.
The documentation for this class was generated from the following files:
KDE 4.6 API Reference