23 #ifndef __KATE_TEXTLINE_H__
24 #define __KATE_TEXTLINE_H__
26 #include <ksharedptr.h>
28 #include <tqmemarray.h>
58 flagFoldingColumnsOutdated = 8,
59 flagNoIndentationBasedFolding = 16,
60 flagNoIndentationBasedFoldingAtStart = 32
97 inline uint
length()
const {
return m_text.length(); }
103 inline bool hlLineContinue ()
const {
return m_flags & KateTextLine::flagHlContinue; }
109 inline bool isAutoWrapped ()
const {
return m_flags & KateTextLine::flagAutoWrapped; }
145 inline TQChar
getChar (uint pos)
const {
return m_text[pos]; }
151 inline const TQChar *
text()
const {
return m_text.unicode(); }
167 inline uchar *
attributes ()
const {
return m_attributes.data(); }
173 inline const TQString&
string()
const {
return m_text; }
182 {
return m_text.mid(startCol, length); }
204 int cursorX(uint pos, uint tabChars)
const;
219 bool stringAtPos(uint pos,
const TQString& match)
const;
246 uint *foundAtCol, uint *matchLen,
247 bool casesensitive =
true,
248 bool backwards =
false);
259 bool searchText (uint startCol,
const TQRegExp ®exp,
260 uint *foundAtCol, uint *matchLen,
261 bool backwards =
false);
273 if (pos < m_attributes.size())
return m_attributes[pos];
281 inline const TQMemArray<short> &
ctxArray ()
const {
return m_ctx; };
286 inline const bool noIndentBasedFolding()
const {
return m_flags & KateTextLine::flagNoIndentationBasedFolding; };
287 inline const bool noIndentBasedFoldingAtStart()
const {
return m_flags & KateTextLine::flagNoIndentationBasedFoldingAtStart; };
307 void insertText (uint pos, uint insLen,
const TQChar *insText, uchar *insAttribs = 0);
328 if (cont) m_flags = m_flags | KateTextLine::flagHlContinue;
329 else m_flags = m_flags & ~
KateTextLine::flagHlContinue;
338 if (wrapped) m_flags = m_flags | KateTextLine::flagAutoWrapped;
339 else m_flags = m_flags & ~
KateTextLine::flagAutoWrapped;
346 inline void setContext (TQMemArray<short> &val) { m_ctx.assign (val); }
353 if (val) m_flags = m_flags | KateTextLine::flagNoIndentationBasedFolding;
354 else m_flags = m_flags & ~
KateTextLine::flagNoIndentationBasedFolding;
357 inline void setNoIndentBasedFoldingAtStart(
bool val)
359 if (val) m_flags = m_flags | KateTextLine::flagNoIndentationBasedFoldingAtStart;
360 else m_flags = m_flags & ~
KateTextLine::flagNoIndentationBasedFoldingAtStart;
367 inline void setFoldingList (TQMemArray<uint> &val) { m_foldingList.assign (val); m_foldingList.detach(); }
388 + (m_text.length() *
sizeof(TQChar))
389 + ( withHighlighting ?
391 + (m_text.length() *
sizeof(uchar))
392 + (m_ctx.size() *
sizeof(short))
393 + (m_foldingList.size() *
sizeof(uint))
394 + (m_indentationDepth.size() *
sizeof(
unsigned short))
407 char *
dump (
char *buf,
bool withHighlighting)
const;
431 TQMemArray<uchar> m_attributes;
436 TQMemArray<short> m_ctx;
441 TQMemArray<uint> m_foldingList;
446 TQMemArray<unsigned short> m_indentationDepth;