Editors: Move auto-completion code out of the editor

This is basically a continuation of the commits which
refactor code out of the base text editor. For instance,
36fa1de4c6 and
3a684586fa.

Also removed the doXXXX() forwarding methods.
This commit is contained in:
Leandro Melo
2010-11-30 14:14:33 +01:00
parent e117f04fab
commit ea8cb4764b
21 changed files with 448 additions and 513 deletions

View File

@@ -168,12 +168,6 @@ public:
void setParenthesesMatchingEnabled(bool b);
bool isParenthesesMatchingEnabled() const;
void setAutoParenthesesEnabled(bool b);
bool isAutoParenthesesEnabled() const;
void setSurroundWithEnabled(bool b);
bool isSurroundWithEnabled() const;
void setHighlightCurrentLine(bool b);
bool highlightCurrentLine() const;
@@ -424,24 +418,10 @@ protected:
void dragEnterEvent(QDragEnterEvent *e);
public:
// Returns the text to complete at the cursor position, or an empty string
virtual QString autoComplete(QTextCursor &cursor, const QString &text) const;
// Handles backspace. When returning true, backspace processing is stopped
virtual bool autoBackspace(QTextCursor &cursor);
// Hook to insert special characters on enter. Returns the number of extra blocks inserted.
virtual int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor);
void indentInsertedText(const QTextCursor &tc);
void indent(QTextDocument *doc, const QTextCursor &cursor, QChar typedChar);
void reindent(QTextDocument *doc, const QTextCursor &cursor);
protected:
static void countBracket(QChar open, QChar close, QChar c, int *errors, int *stillopen);
static void countBrackets(QTextCursor cursor, int from, int end, QChar open, QChar close,
int *errors, int *stillopen);
public:
struct Link
{
Link(const QString &fileName = QString(),