KateTextLine Class Reference
The KateTextLine represents a line of text. More...
#include <katetextline.h>
Inheritance diagram for KateTextLine:


Public Types | |
typedef KSharedPtr< KateTextLine > | Ptr |
enum | Flags { flagNoOtherData = 0x1, flagHlContinue = 0x2, flagAutoWrapped = 0x4, flagFoldingColumnsOutdated = 0x8 } |
Public Member Functions | |
KateTextLine () | |
~KateTextLine () | |
void | setFoldingColumnsOutdated (bool set) |
bool | foldingColumnsOutdated () |
uint | length () const |
bool | hlLineContinue () const |
bool | isAutoWrapped () const |
int | firstChar () const |
int | lastChar () const |
int | nextNonSpaceChar (uint pos) const |
int | previousNonSpaceChar (uint pos) const |
QChar | getChar (uint pos) const |
const QChar * | text () const |
uchar * | attributes () const |
const QString & | string () const |
QString | string (uint startCol, uint length) const |
void | stringAsHtml (uint startCol, uint length, KateRenderer *renderer, QTextStream *outputStream) const |
void | stringAsHtml (KateRenderer *renderer, QTextStream *outputStream) const |
const QChar * | firstNonSpace () const |
uint | indentDepth (uint tabwidth) const |
int | cursorX (uint pos, uint tabChars) const |
uint | lengthWithTabs (uint tabChars) const |
bool | stringAtPos (uint pos, const QString &match) const |
bool | startingWith (const QString &match) const |
bool | endingWith (const QString &match) const |
bool | searchText (uint startCol, const QString &text, uint *foundAtCol, uint *matchLen, bool casesensitive=true, bool backwards=false) |
bool | searchText (uint startCol, const QRegExp ®exp, uint *foundAtCol, uint *matchLen, bool backwards=false) |
uchar | attribute (uint pos) const |
const QMemArray< short > & | ctxArray () const |
const QMemArray< uint > & | foldingListArray () const |
const QMemArray< unsigned short > & | indentationDepthArray () const |
void | insertText (uint pos, uint insLen, const QChar *insText, uchar *insAttribs=0) |
void | removeText (uint pos, uint delLen) |
void | truncate (uint newLen) |
void | setHlLineContinue (bool cont) |
void | setAutoWrapped (bool wrapped) |
void | setContext (QMemArray< short > &val) |
void | setFoldingList (QMemArray< uint > &val) |
void | setIndentationDepth (QMemArray< unsigned short > &val) |
uint | dumpSize (bool withHighlighting) const |
char * | dump (char *buf, bool withHighlighting) const |
char * | restore (char *buf) |
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 41 of file katetextline.h.
Member Typedef Documentation
|
Define a Shared-Pointer type.
Definition at line 47 of file katetextline.h. |
Member Enumeration Documentation
|
Used Flags.
Definition at line 53 of file katetextline.h. |
Constructor & Destructor Documentation
|
Constructor Creates an empty text line with given attribute and syntax highlight context.
Definition at line 31 of file katetextline.cpp. |
|
Destructor.
Definition at line 36 of file katetextline.cpp. |
Member Function Documentation
|
Set the flag that only positions have changed, not folding region begins/ends themselve.
Definition at line 81 of file katetextline.h. |
|
folding columns outdated ?
Definition at line 88 of file katetextline.h. |
|
Returns the length.
Definition at line 95 of file katetextline.h. References QString::length(). |
|
has the line the hl continue flag set
Definition at line 101 of file katetextline.h. |
|
was this line automagically wrapped
Definition at line 107 of file katetextline.h. |
|
Returns the position of the first non-whitespace character.
Definition at line 136 of file katetextline.cpp. References nextNonSpaceChar(). Referenced by firstNonSpace(). |
|
Returns the position of the last non-whitespace character.
Definition at line 141 of file katetextline.cpp. References QString::length(), and previousNonSpaceChar(). |
|
Find the position of the next char that is not a space.
Definition at line 111 of file katetextline.cpp. References QString::length(). Referenced by firstChar(). |
|
Find the position of the previous char that is not a space.
Definition at line 122 of file katetextline.cpp. References QString::length(). Referenced by lastChar(). |
|
Gets the char at the given position.
Definition at line 143 of file katetextline.h. Referenced by stringAsHtml(). |
|
Gets the text as a unicode representation.
Definition at line 149 of file katetextline.h. References QString::unicode(). Referenced by searchText(). |
|
Highlighting array The size of this is string().length(). This contains the index for the attributes (so you can only have a maximum of 2^8 different highlighting styles in a document) To turn this into actual attributes (bold, green, etc), you need to feed these values into KRenderer::attributes e.g: m_renderer->attributes(attributes[3]);
Definition at line 165 of file katetextline.h. References QMemArray::data(). |
|
Gets a QString.
Definition at line 171 of file katetextline.h. |
|
Gets a substring.
Definition at line 179 of file katetextline.h. References QString::mid(). |
|
Gets a substring in valid-xml html. Example: "<b>const</b> b = <i>34</i>" It won't contain or <body> or <html> or anything like that.
Definition at line 411 of file katetextline.cpp. References attribute(), KateAttribute::bold(), QStyleSheet::escape(), getChar(), KateAttribute::italic(), QString::number(), QColor::rgb(), and KateAttribute::textColor(). Referenced by stringAsHtml(). |
|
Gets the string a valid-xml html. Overloaded version of stringAsHtml
Definition at line 205 of file katetextline.h. References QString::length(), and stringAsHtml(). |
|
Gets a null terminated pointer to first non space char.
Definition at line 146 of file katetextline.cpp. References firstChar(), and QString::unicode(). |
|
indentation depth of this line
Definition at line 152 of file katetextline.cpp. References QString::length(). |
|
Returns the x position of the cursor at the given position, which depends on the number of tab characters.
Definition at line 209 of file katetextline.cpp. References QString::length(). |
|
Returns the text length with tabs calced in.
Definition at line 225 of file katetextline.cpp. References QString::length(). |
|
Can we find the given string at the given position.
Definition at line 172 of file katetextline.cpp. References QString::length(). |
|
Is the line starting with the given string.
Definition at line 184 of file katetextline.cpp. References QString::length(). |
|
Is the line ending with the given string.
Definition at line 196 of file katetextline.cpp. References QString::length(). |
|
search given string
Definition at line 240 of file katetextline.cpp. References QString::find(), QString::findRev(), QString::length(), and text(). |
|
search given regexp
Definition at line 271 of file katetextline.cpp. References QString::length(). |
|
Gets the attribute at the given position use KRenderer::attributes to get the KTextAttribute for this.
Definition at line 295 of file katetextline.h. References QMemArray::size(). Referenced by stringAsHtml(). |
|
context stack
Definition at line 305 of file katetextline.h. |
|
folding list
Definition at line 311 of file katetextline.h. |
|
indentation stack
Definition at line 317 of file katetextline.h. |
|
insert text into line
Definition at line 40 of file katetextline.cpp. References QString::insert(), QString::length(), and QMemArray::resize(). |
|
remove text at given position
Definition at line 77 of file katetextline.cpp. References QString::length(), QString::remove(), and QMemArray::resize(). |
|
Truncates the textline to the new length.
Definition at line 102 of file katetextline.cpp. References QString::length(), QMemArray::truncate(), and QString::truncate(). |
|
set hl continue flag
Definition at line 345 of file katetextline.h. |
|
auto-wrapped
Definition at line 355 of file katetextline.h. |
|
Sets the syntax highlight context number.
Definition at line 365 of file katetextline.h. References QMemArray::assign(). |
|
update folding list
Definition at line 371 of file katetextline.h. References QMemArray::assign(), and QMemArray::detach(). |
|
update indentation stack
Definition at line 377 of file katetextline.h. References QMemArray::assign(). |
|
Dumpsize in bytes.
Definition at line 388 of file katetextline.h. References QString::length(), and QMemArray::size(). |
|
Dumps the line to *buf and counts buff dumpSize bytes up as return value.
Definition at line 302 of file katetextline.cpp. References QMemArray::data(), QString::length(), QMemArray::size(), and QString::unicode(). |
|
Restores the line from *buf and counts buff dumpSize bytes up as return value.
Definition at line 350 of file katetextline.cpp. References QMemArray::duplicate(), QMemArray::fill(), and QString::setUnicode(). |
The documentation for this class was generated from the following files: