16 #ifndef _QDOCUMENT_LINE_P_H_
17 #define _QDOCUMENT_LINE_P_H_
37 #include <QTextLayout>
39 #if QT_VERSION < 0x040400
45 typedef QVector<int> QSmallArray;
46 typedef QVector<int> QMediumArray;
75 int xToCursor(
int x)
const;
76 int cursorToX(
int i)
const;
78 int wrappedLineForCursor(
int cpos)
const;
80 int documentOffsetToCursor(
int x,
int y)
const;
81 void cursorToDocumentOffset(
int cpos,
int& x,
int& y)
const;
83 QPoint cursorToDocumentOffset(
int cpos)
const;
87 int nextNonSpaceChar(uint pos)
const;
88 int previousNonSpaceChar(
int pos)
const;
90 bool hasFlag(
int flag)
const;
91 void setFlag(
int flag,
bool y =
true)
const;
98 void updateWrap()
const;
100 void setFormats(
const QVector<int>& formats);
102 void clearOverlays();
106 void shiftOverlays(
int position,
int offset);
108 void draw( QPainter *p,
111 const QSmallArray& sel,
112 const QSmallArray& cursors,
116 inline QString& textBuffer() { setFlag(QDocumentLine::LayoutDirty,
true);
return m_text; }
118 inline void ref() { m_ref.ref(); }
119 inline void deref() {
if ( m_ref ) m_ref.deref();
if ( !m_ref )
delete this; }
126 void applyOverlays()
const;
128 QMediumArray compose()
const;
133 #if QT_VERSION < 0x040400
138 mutable int m_indent;
140 mutable QTextLayout *m_layout;
141 mutable QVector<int> m_cache;
142 mutable QVector< QPair<int, int> > m_frontiers;
146 QVector<int> m_formats;
147 QVector<QParenthesis> m_parens;
153 #endif // !_QDOCUMENT_LINE_P_H_