16 #ifndef _QDOCUMENT_LINE_H_ 17 #define _QDOCUMENT_LINE_H_ 48 : id(0), role(0), offset(0), length(0)
52 : id(i), role(r), offset(pos), length(len)
73 CollapsedBlockStart = 2,
74 CollapsedBlockEnd = 4,
80 Q_DECLARE_FLAGS(States, State);
113 void operator ++ (
int);
114 void operator -- (
int);
118 int lineNumber()
const;
119 int position()
const;
121 QString text()
const;
124 int lineSpan()
const;
126 int firstChar()
const;
127 int lastChar()
const;
131 int nextNonSpaceChar(
int pos)
const;
132 int previousNonSpaceChar(
int pos)
const;
134 inline QString indentation()
const 135 {
int idx = firstChar();
return idx != -1 ? text().left(idx) : text(); }
137 inline bool isHidden()
const 138 {
return hasFlag(Hidden); }
140 bool hasFlag(State s)
const;
141 bool hasAnyFlag(
int s)
const;
142 void setFlag(State s,
bool y =
true);
149 int xToCursor(
int x)
const;
150 int cursorToX(
int cpos)
const;
152 int wrappedLineForCursor(
int cpos)
const;
154 int documentOffsetToCursor(
int x,
int y)
const;
155 void cursorToDocumentOffset(
int cpos,
int& x,
int& y)
const;
157 QPoint cursorToDocumentOffset(
int cpos)
const;
159 void addMark(
int id);
160 void removeMark(
int id);
161 void toggleMark(
int id);
164 bool hasMark(
int id)
const;
166 bool hasOverlay(
int fid)
const;
169 void clearOverlays();
187 Q_DECLARE_OPERATORS_FOR_FLAGS(QDocumentLine::States)
Definition: qdocumentline.h:36
#define QCE_EXPORT
Macro needed for cross-platform shared libraries creation.
Definition: qce-config.h:40
Utility file for shared library creation.
Definition: qdocumentcursor_p.h:45
A class storing a document.
Definition: qdocument.h:62
Private implementation of a document line.
Definition: qdocumentline_p.h:55
A reference to line objects.
Definition: qdocumentline.h:63