From 3a5d3a2fe93f2d565713790cee6c981169a888c2 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 4 Sep 2013 18:15:08 +0200 Subject: C++: unify highlighting/code-completion support "factories". Both semantic highlighting and code-completion go hand-in-hand, so now the ModelManagerSupport class acts as a "factory" for the model manager. Depending on the mime-type of the document in the editor, the model manager will return the appropriate highlighter or code-completion engine. If none is registered, the built-in fall-back is used. Change-Id: I3e5dbb0e3b58e077dd5eda9aecb2ce5d448ac0b8 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppmodelmanagerinterface.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/cpptools/cppmodelmanagerinterface.h') diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index 8a276ece48..33954d47ea 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -52,6 +52,7 @@ namespace Utils { class FileName; } namespace CppTools { class AbstractEditorSupport; +class ModelManagerSupport; class CppCompletionAssistProvider; class CppEditorSupport; class CppHighlightingSupport; @@ -243,14 +244,13 @@ public: virtual void setIfdefedOutBlocks(const QString &fileName, const QList &ifdeffedOutBlocks) = 0; + virtual void addModelManagerSupport(ModelManagerSupport *modelManagerSupport) = 0; + virtual ModelManagerSupport *modelManagerSupportForMimeType(const QString &mimeType) const = 0; virtual CppCompletionAssistProvider *completionAssistProvider(Core::IEditor *editor) const = 0; - virtual void setCppCompletionAssistProvider(CppTools::CppCompletionAssistProvider *completionAssistProvider) = 0; - - virtual CppTools::CppHighlightingSupport *highlightingSupport(Core::IEditor *editor) const = 0; - virtual void setHighlightingSupportFactory(CppTools::CppHighlightingSupportFactory *highlightingFactory) = 0; + virtual CppHighlightingSupport *highlightingSupport(Core::IEditor *editor) const = 0; virtual void setIndexingSupport(CppTools::CppIndexingSupport *indexingSupport) = 0; - virtual CppTools::CppIndexingSupport *indexingSupport() = 0; + virtual CppIndexingSupport *indexingSupport() = 0; signals: /// Project data might be locked while this is emitted. -- cgit v1.2.1