123 CodeEditor(QWidget* parent = NULL,
bool createDefaultActions =
true);
126 bool useSpacesInsteadOfTabs()
const;
127 void setUseSpacesInsteadOfTabs(
bool value);
129 bool selectLineOnCopyEmpty()
const;
130 void setSelectLineOnCopyEmpty(
bool value);
132 bool showContextMenu()
const;
133 void setShowContextMenu(
bool value);
135 bool showWhitespaces()
const;
136 void setShowWhitespaces(
bool value);
138 QString fontName()
const;
139 void setFontName(
const QString& value);
141 int fontSize()
const;
142 void setFontSize(
int fontSize);
144 int zoomLevel()
const;
145 void setZoomLevel(
int value);
147 int tabLength()
const;
148 void setTabLength(
int value);
150 QColor background()
const;
151 void setBackground(
const QColor& value);
153 QColor foreground()
const;
154 void setForeground(
const QColor& value);
156 QColor selectionForeground()
const;
157 void setSelectionForeground(
const QColor& value);
159 QColor selectionBackground()
const;
160 void setSelectionBackground(
const QColor& value);
162 QColor whitespacesForeground()
const;
163 void setWhitespacesForeground(
const QColor& value);
165 bool saveOnFocusOut()
const;
166 void setSaveOnFocusOut(
bool value);
171 int edgeColumn()
const;
172 void setEdgeColumn(
int column);
174 QColor edgeColor()
const;
175 void setEdgeColor(
const QColor& color);
177 bool showIndentationGuides()
const;
178 void setShowIndentationGuides(
bool value);
180 QColor indentationGuidesColor()
const;
181 void setIndentationGuidesColor(
const QColor& color);
183 QList<VisibleBlock> visibleBlocks()
const;
186 int firstVisibleLine()
const;
187 void setFirstVisibleLine(
int line);
189 bool isModified()
const;
190 void setModified(
bool modified);
192 QString wordSeparators()
const
194 return m_wordSeparators;
197 bool isUndoAvailable()
const
199 return m_undoAvailable;
201 bool isRedoAvailable()
const
203 return m_redoAvailable;
206 void setMouseCursor(
const QCursor& cursor);
208 void cursorPosition(
int& line,
int& column)
const;
210 void setViewportMargins(
int left,
int top,
int right,
int bottom);
212 QRectF blockBoundingGeometry(
const QTextBlock& block)
const {
return QPlainTextEdit::blockBoundingGeometry(block); }
213 QPointF contentOffset()
const {
return QPlainTextEdit::contentOffset(); }
215 PanelsManager* panels()
const;
216 TextDecorationsManager* decorations()
const;
217 ModesManager* modes()
const;
219 SyntaxHighlighterBase* syntaxHighlighter()
const;
221 int currentLineNumber()
const;
222 int currentColumnNumber()
const;
223 int lineNbrFromPosition(
int yPos)
const;
224 int lineCount()
const;
225 int lineLength(
int line)
const;
226 QTextCursor selectWholeLine(
int line = -1,
bool applySelection =
true);
227 QTextCursor selectLines(
int start = 0,
int end = -1,
bool applySelection =
true);
228 QPair<int, int> selectionRange()
const;
229 void getSelection(
int* lineFrom,
int* indexFrom,
int* lineTo,
int* indexTo);
230 void setSelection(
int lineFrom,
int indexFrom,
int lineTo,
int indexTo);
231 bool hasSelectedText()
const;
232 int linePosFromNumber(
int lineNumber)
const;
233 void lineIndexFromPosition(
const QPoint& pos,
int* line,
int* column)
const;
234 void lineIndexFromPosition(
int pos,
int* line,
int* column)
const;
235 void getCursorPosition(
int* line,
int* column)
const;
236 QTextCursor setCursorPosition(
int line,
int column,
bool applySelection =
true);
237 void unfoldCursorPosition();
238 void ensureLineVisible(
int line);
239 QTextCursor gotoLine(
int line,
int column,
bool move =
true);
241 void removeSelectedText();
254 void replace(
const QString& text);
258 textCursor().endEditBlock();
260 void beginUndoAction()
262 textCursor().beginEditBlock();
265 QString selectedText()
const;
268 return toPlainText().size();
270 int positionFromLineIndex(
int line,
int column)
const;
272 int lineIndent(
int lineNumber = -1)
const;
273 int lineIndent(
const QTextBlock* lineNbr)
const;
274 QString lineText(
int lineIdx)
const;
275 void markWholeDocDirty();
276 void callResizeEvent(QResizeEvent* evt)
281 virtual QString codeText(
int& ,
int& )
const
283 return toPlainText();
293 void resetStylesheet();
295 void rehighlightBlock(
int lineFromIdx,
int lineToIdx );
297 void showTooltip(
const QPoint& pos,
const QString& tooltip);
299 const QPoint& pos,
const QString& tooltip,
const TextDecoration::Ptr& senderDeco);
302 const QString& text,
const QString& mimeType =
"",
const QString& encoding =
"");
303 void insertAt(
const QString& text,
int line,
int index);
304 void append(
const QString& text);
306 bool isCommentOrString(
307 const QTextCursor& cursor,
308 const QList<StyleItem::StyleType>& formats = QList<StyleItem::StyleType>());
309 bool isCommentOrString(
310 const QTextBlock& block,
311 const QList<StyleItem::StyleType>& formats = QList<StyleItem::StyleType>());
312 bool isNumber(
const QTextCursor& cursor)
const;
313 bool isNumber(
const QTextBlock& block)
const;
315 QTextCursor wordUnderCursor(
bool selectWholeWord)
const;
316 QTextCursor wordUnderCursor(
const QTextCursor& cursor,
bool selectWholeWord)
const;
317 QString wordAtPosition(
int line,
int index,
bool selectWholeWord)
const;
318 QTextCursor wordUnderMouseCursor()
const;
320 TextBlockUserData* getTextBlockUserData(
int lineIndex,
bool createIfNotExist =
true);
321 TextBlockUserData* getTextBlockUserData(QTextBlock& block,
bool createIfNotExist =
true);
322 QSet<TextBlockUserData*>& textBlockUserDataList()
324 return m_textBlockUserDataList;
326 const QSet<TextBlockUserData*>& textBlockUserDataList()
const
328 return m_textBlockUserDataList;
330 const TextBlockUserData* getConstTextBlockUserData(
int lineIndex)
const;
332 virtual bool removeTextBlockUserData(TextBlockUserData* userData);
334 bool bookmarksAvailable()
const;
335 bool breakpointsAvailable()
const;
337 void callWheelEvent(QWheelEvent* e);
339 void reportPositionAsGoBackNavigationItem(
340 const QTextCursor& cursor,
const QString& reason)
const;
347 cursor(textCursor), editorUID(UID){};
351 cursor = QTextCursor();
364 QMenu* contextMenu()
const
366 return m_pContextMenu;
369 void showTooltipDelayJobRunner(QList<QVariant> args);
374 QString previousLineText()
const;
375 QString currentLineText()
const;
377 void setWhitespacesFlags(
bool show);
378 void updateTabStopAndIndentationWidth();
380 void updateVisibleBlocks();
382 void doHomeKey(QEvent* event = NULL,
bool select =
false);
384 QTextCursor moveCursorTo(
int line)
const;
386 virtual void reportGoBackNavigationCursorMovement(
387 const CursorPosition& cursor,
const QString& origin)
const;
389 virtual void contextMenuAboutToShow(
int contextMenuLine);
391 virtual void resizeEvent(QResizeEvent* e);
392 virtual void closeEvent(QCloseEvent* e);
393 virtual void keyPressEvent(QKeyEvent* e);
394 virtual void keyReleaseEvent(QKeyEvent* e);
395 virtual void mouseDoubleClickEvent(QMouseEvent* e);
396 virtual void mousePressEvent(QMouseEvent* e);
397 virtual void mouseReleaseEvent(QMouseEvent* e);
398 virtual void mouseMoveEvent(QMouseEvent* e);
399 virtual void showEvent(QShowEvent* e);
400 virtual void paintEvent(QPaintEvent* e);
401 virtual void wheelEvent(QWheelEvent* e);
402 virtual void contextMenuEvent(QContextMenuEvent* e);
404 virtual void focusInEvent(QFocusEvent* e);
405 virtual void focusOutEvent(QFocusEvent* e);
407 virtual bool eventFilter(QObject* obj, QEvent* e);
409 virtual bool keyPressInternalEvent(QKeyEvent* e)
430 int m_defaultFontSize;
431 bool m_useSpacesInsteadOfTabs;
432 QColor m_whitespacesForeground;
433 QColor m_selBackground;
434 QColor m_selForeground;
437 bool m_showWhitespaces;
441 QString m_fontFamily;
442 bool m_selectLineOnCopyEmpty;
443 QString m_wordSeparators;
444 QPoint m_lastMousePos;
445 int m_prevTooltipBlockNbr;
446 int m_indentationBarWidth;
447 int m_minLineJumpsForGoBackNavigationReport;
453 bool m_showIndentationGuides;
454 QColor m_indentationGuidesColor;
456 bool m_redoAvailable;
457 bool m_undoAvailable;
460 QList<VisibleBlock> m_visibleBlocks;
461 QSet<TextBlockUserData*> m_textBlockUserDataList;
463 QMenu* m_pContextMenu;
472 void emitDirtyChanged(
bool state);
473 void setUndoAvailable(
bool available);
474 void setRedoAvailable(
bool available);
477 void dirtyChanged(
bool state);
478 void painted(QPaintEvent* e);
479 void keyPressed(QKeyEvent* e);
480 void keyReleased(QKeyEvent* e);
481 void postKeyPressed(QKeyEvent* e);
482 void mouseDoubleClicked(
484 void mousePressed(QMouseEvent* e);
485 void mouseReleased(QMouseEvent* e);
486 void mouseMoved(QMouseEvent* e);
487 void mouseWheelActivated(QWheelEvent* e);
489 void focusedIn(QFocusEvent* e);
491 void indentRequested();
492 void unindentRequested();
494 void updateRequest();
496 void updateActions();
Definition textBlockUserData.h:56
Definition textDecorationsManager.h:57