summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/quickfix.h
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-06-03 15:15:11 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-06-03 15:15:11 +0200
commitbcf50a0a49371e3e3eb791b66d4d63bc217d110b (patch)
treeb114eeaf52027ab957b9b103429af6e87d84ee50 /src/plugins/texteditor/quickfix.h
parent3d81ae8574b03301099428823627683f31811bfc (diff)
downloadqt-creator-bcf50a0a49371e3e3eb791b66d4d63bc217d110b.tar.gz
Generalized the quickfix collector.
Diffstat (limited to 'src/plugins/texteditor/quickfix.h')
-rw-r--r--src/plugins/texteditor/quickfix.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/texteditor/quickfix.h b/src/plugins/texteditor/quickfix.h
index fbbdf8ac1f..f3393142cb 100644
--- a/src/plugins/texteditor/quickfix.h
+++ b/src/plugins/texteditor/quickfix.h
@@ -31,6 +31,7 @@
#define TEXTEDITORQUICKFIX_H
#include "texteditor_global.h"
+#include "icompletioncollector.h"
#include <utils/changeset.h>
#include <QtCore/QSharedPointer>
@@ -111,6 +112,34 @@ private:
Utils::ChangeSet _changeSet;
};
+
+class TEXTEDITOR_EXPORT QuickFixCollector: public TextEditor::IQuickFixCollector
+{
+ Q_OBJECT
+
+public:
+ QuickFixCollector();
+ virtual ~QuickFixCollector();
+
+ QList<TextEditor::QuickFixOperation::Ptr> quickFixes() const { return _quickFixes; }
+
+ virtual TextEditor::ITextEditable *editor() const;
+ virtual int startPosition() const;
+ virtual bool supportsEditor(TextEditor::ITextEditable *editor);
+ virtual bool triggersCompletion(TextEditor::ITextEditable *editor);
+ virtual int startCompletion(TextEditor::ITextEditable *editor);
+ virtual void completions(QList<TextEditor::CompletionItem> *completions);
+ virtual void complete(const TextEditor::CompletionItem &item);
+ virtual void cleanup();
+
+ virtual TextEditor::QuickFixState *initializeCompletion(TextEditor::ITextEditable *editable) = 0;
+ virtual QList<TextEditor::QuickFixOperation::Ptr> quickFixOperations(TextEditor::BaseTextEditor *editor) const = 0;
+
+private:
+ TextEditor::ITextEditable *_editable;
+ QList<TextEditor::QuickFixOperation::Ptr> _quickFixes;
+};
+
} // end of namespace TextEditor
#endif // TEXTEDITORQUICKFIX_H