C++: make highlighting/completion plugable.

Change-Id: I990fdf5411153041c6b4c62f31b453342d59de53
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Erik Verbruggen
2012-02-20 12:39:08 +01:00
parent d66acb51d0
commit 6fe6f5cdb1
15 changed files with 407 additions and 94 deletions

View File

@@ -40,21 +40,38 @@
#include <QFuture>
namespace CppTools {
namespace Internal {
class CppEditorSupport;
namespace TextEditor {
class ITextEditor;
}
namespace CppTools {
class CPPTOOLS_EXPORT CppHighlightingSupport
{
public:
typedef TextEditor::SemanticHighlighter::Result Use;
public:
CppHighlightingSupport();
CppHighlightingSupport(TextEditor::ITextEditor *editor);
virtual ~CppHighlightingSupport() = 0;
QFuture<Use> highlightingFuture(const CPlusPlus::Document::Ptr &doc,
const CPlusPlus::Snapshot &snapshot) const;
virtual QFuture<Use> highlightingFuture(const CPlusPlus::Document::Ptr &doc,
const CPlusPlus::Snapshot &snapshot) const = 0;
protected:
TextEditor::ITextEditor *editor() const
{ return m_editor; }
private:
TextEditor::ITextEditor *m_editor;
};
class CPPTOOLS_EXPORT CppHighlightingSupportFactory
{
public:
virtual ~CppHighlightingSupportFactory() = 0;
virtual CppHighlightingSupport *highlightingSupport(TextEditor::ITextEditor *editor) = 0;
};
} // namespace CppTools