diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-06-03 15:15:11 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-06-03 15:15:11 +0200 |
commit | bcf50a0a49371e3e3eb791b66d4d63bc217d110b (patch) | |
tree | b114eeaf52027ab957b9b103429af6e87d84ee50 /src/plugins/texteditor/quickfix.h | |
parent | 3d81ae8574b03301099428823627683f31811bfc (diff) | |
download | qt-creator-bcf50a0a49371e3e3eb791b66d4d63bc217d110b.tar.gz |
Generalized the quickfix collector.
Diffstat (limited to 'src/plugins/texteditor/quickfix.h')
-rw-r--r-- | src/plugins/texteditor/quickfix.h | 29 |
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 |