forked from qt-creator/qt-creator
		
	C++: Moved completion/highlighting into the model manager.
This way the editor does not need to know all the details of instantiating or maintaining classes for highlighting and/or completion, it can just ask the model manager. The change also enables different highlighting- or completion-engines without changes to the cppeditor. Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
		@@ -36,6 +36,7 @@
 | 
			
		||||
#include <QtCore/QObject>
 | 
			
		||||
#include <QtCore/QPointer>
 | 
			
		||||
#include <QtCore/QFuture>
 | 
			
		||||
#include <QtCore/QScopedPointer>
 | 
			
		||||
#include <QtCore/QSharedPointer>
 | 
			
		||||
 | 
			
		||||
#include <QtGui/QTextCursor>
 | 
			
		||||
@@ -56,6 +57,10 @@ namespace TextEditor {
 | 
			
		||||
} // namespace TextEditor
 | 
			
		||||
 | 
			
		||||
namespace CppTools {
 | 
			
		||||
 | 
			
		||||
class CppCompletionSupport;
 | 
			
		||||
class CppHighlightingSupport;
 | 
			
		||||
 | 
			
		||||
namespace Internal {
 | 
			
		||||
 | 
			
		||||
class CppModelManager;
 | 
			
		||||
@@ -77,6 +82,9 @@ public:
 | 
			
		||||
    QString contents();
 | 
			
		||||
    unsigned editorRevision() const;
 | 
			
		||||
 | 
			
		||||
    CppCompletionSupport *completionSupport() const;
 | 
			
		||||
    CppHighlightingSupport *highlightingSupport() const;
 | 
			
		||||
 | 
			
		||||
Q_SIGNALS:
 | 
			
		||||
    void contentsChanged();
 | 
			
		||||
 | 
			
		||||
@@ -94,6 +102,8 @@ private:
 | 
			
		||||
    QFuture<void> _documentParser;
 | 
			
		||||
    QString _cachedContents;
 | 
			
		||||
    unsigned _revision;
 | 
			
		||||
    QScopedPointer<CppCompletionSupport> m_completionSupport;
 | 
			
		||||
    QScopedPointer<CppHighlightingSupport> m_highlightingSupport;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace Internal
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user