forked from qt-creator/qt-creator
CMakeProjectManager: Use a BaseEditorFactory derived class
Change-Id: Ia5f2b789d82c63552ec7abe5ec22bbc29100a59a Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -129,6 +129,8 @@ public:
|
||||
BaseTextEditor();
|
||||
~BaseTextEditor();
|
||||
|
||||
virtual void finalizeInitialization() {}
|
||||
|
||||
void setEditorCreator(const BaseTextEditorCreator &creator);
|
||||
void setDocumentCreator(const BaseTextDocumentCreator &creator);
|
||||
void setWidgetCreator(const BaseTextEditorWidgetCreator &creator);
|
||||
@@ -545,6 +547,7 @@ protected:
|
||||
virtual void onRefactorMarkerClicked(const RefactorMarker &) {}
|
||||
|
||||
void showDefaultContextMenu(QContextMenuEvent *e, Core::Id menuContextId);
|
||||
virtual void finalizeInitialization() {}
|
||||
|
||||
public:
|
||||
struct Link
|
||||
@@ -621,10 +624,6 @@ private:
|
||||
friend class RefactorOverlay;
|
||||
};
|
||||
|
||||
typedef std::function<SyntaxHighlighter *()> SyntaxHighLighterCreator;
|
||||
typedef std::function<Indenter *()> IndenterCreator;
|
||||
typedef std::function<AutoCompleter *()> AutoCompleterCreator;
|
||||
|
||||
class TEXTEDITOR_EXPORT BaseTextEditorFactory : public Core::IEditorFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -632,6 +631,10 @@ class TEXTEDITOR_EXPORT BaseTextEditorFactory : public Core::IEditorFactory
|
||||
public:
|
||||
BaseTextEditorFactory(QObject *parent = 0);
|
||||
|
||||
typedef std::function<SyntaxHighlighter *()> SyntaxHighLighterCreator;
|
||||
typedef std::function<Indenter *()> IndenterCreator;
|
||||
typedef std::function<AutoCompleter *()> AutoCompleterCreator;
|
||||
|
||||
void setDocumentCreator(const BaseTextDocumentCreator &creator);
|
||||
void setEditorWidgetCreator(const BaseTextEditorWidgetCreator &creator);
|
||||
void setEditorCreator(const BaseTextEditorCreator &creator);
|
||||
@@ -643,10 +646,12 @@ public:
|
||||
void setEditorActionHandlers(Core::Id contextId, uint optionalActions);
|
||||
void setEditorActionHandlers(uint optionalActions);
|
||||
|
||||
BaseTextEditor *duplicateTextEditor(BaseTextEditor *);
|
||||
private:
|
||||
friend class BaseTextEditor;
|
||||
|
||||
Core::IEditor *createEditor();
|
||||
BaseTextEditor *createEditorHelper(const BaseTextDocumentPtr &doc);
|
||||
BaseTextEditor *duplicateTextEditor(BaseTextEditor *);
|
||||
|
||||
BaseTextDocumentCreator m_documentCreator;
|
||||
BaseTextEditorWidgetCreator m_widgetCreator;
|
||||
|
||||
Reference in New Issue
Block a user