Commit 62a870a1 authored by hjk's avatar hjk

TextEditor: Simplify HighlighterFactory hierarchy

Change-Id: I555639a9137dcb8ccb471e1615823870c8158b3c
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 922f2517
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "cmakehighlighterfactory.h"
#include "cmakeprojectconstants.h"
#include "cmakehighlighter.h"
using namespace CMakeProjectManager::Internal;
CMakeHighlighterFactory::CMakeHighlighterFactory()
{
setId(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
addMimeType(CMakeProjectManager::Constants::CMAKEMIMETYPE);
}
TextEditor::SyntaxHighlighter *CMakeHighlighterFactory::createHighlighter() const
{
return new CMakeHighlighter;
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef CMAKEHIGHLIGHTERFACTORY_H
#define CMAKEHIGHLIGHTERFACTORY_H
#include <texteditor/ihighlighterfactory.h>
namespace CMakeProjectManager {
namespace Internal {
class CMakeHighlighterFactory : public TextEditor::IHighlighterFactory
{
Q_OBJECT
public:
CMakeHighlighterFactory();
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
};
} // namespace Internal
} // namespace CMakeProjectManager
#endif // CMAKEHIGHLIGHTERFACTORY_H
......@@ -13,7 +13,6 @@ HEADERS = cmakebuildinfo.h \
cmakeeditorfactory.h \
cmakeeditor.h \
cmakehighlighter.h \
cmakehighlighterfactory.h \
cmakelocatorfilter.h \
cmakefilecompletionassist.h \
cmaketool.h \
......@@ -32,7 +31,6 @@ SOURCES = cmakeproject.cpp \
cmakeeditorfactory.cpp \
cmakeeditor.cpp \
cmakehighlighter.cpp \
cmakehighlighterfactory.cpp \
cmakelocatorfilter.cpp \
cmakefilecompletionassist.cpp \
cmaketool.cpp \
......
......@@ -32,8 +32,6 @@ QtcPlugin {
"cmakefilecompletionassist.h",
"cmakehighlighter.cpp",
"cmakehighlighter.h",
"cmakehighlighterfactory.cpp",
"cmakehighlighterfactory.h",
"cmakelocatorfilter.cpp",
"cmakelocatorfilter.h",
"cmakeopenprojectwizard.cpp",
......
......@@ -36,11 +36,12 @@
#include "cmakeprojectconstants.h"
#include "cmakelocatorfilter.h"
#include "cmakefilecompletionassist.h"
#include "cmakehighlighterfactory.h"
#include "cmakehighlighter.h"
#include <coreplugin/featureprovider.h>
#include <coreplugin/mimedatabase.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/highlighterfactory.h>
#include <QtPlugin>
#include <QDebug>
......@@ -82,7 +83,13 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
addAutoReleasedObject(new CMakeLocatorFilter);
addAutoReleasedObject(new CMakeFileCompletionAssistProvider(cmp));
addAutoReleasedObject(new CMakeFeatureProvider);
addAutoReleasedObject(new CMakeHighlighterFactory);
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<CMakeHighlighter>();
hf->setId(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
hf->addMimeType(CMakeProjectManager::Constants::CMAKEMIMETYPE);
addAutoReleasedObject(hf);
return true;
}
......
......@@ -19,7 +19,6 @@ HEADERS += \
cppfollowsymbolundercursor.h \
cppfunctiondecldeflink.h \
cpphighlighter.h \
cpphighlighterfactory.h \
cpphoverhandler.h \
cppincludehierarchy.h \
cppincludehierarchyitem.h \
......@@ -52,7 +51,6 @@ SOURCES += \
cppfollowsymbolundercursor.cpp \
cppfunctiondecldeflink.cpp \
cpphighlighter.cpp \
cpphighlighterfactory.cpp \
cpphoverhandler.cpp \
cppincludehierarchy.cpp \
cppincludehierarchyitem.cpp \
......
......@@ -37,7 +37,6 @@ QtcPlugin {
"cppfollowsymbolundercursor.cpp", "cppfollowsymbolundercursor.h",
"cppfunctiondecldeflink.cpp", "cppfunctiondecldeflink.h",
"cpphighlighter.cpp", "cpphighlighter.h",
"cpphighlighterfactory.cpp", "cpphighlighterfactory.h",
"cpphoverhandler.cpp", "cpphoverhandler.h",
"cppincludehierarchy.cpp", "cppincludehierarchy.h",
"cppincludehierarchyitem.cpp", "cppincludehierarchyitem.h",
......
......@@ -35,7 +35,7 @@
#include "cppeditor.h"
#include "cppeditoroutline.h"
#include "cppfilewizard.h"
#include "cpphighlighterfactory.h"
#include "cpphighlighter.h"
#include "cpphoverhandler.h"
#include "cppincludehierarchy.h"
#include "cppoutline.h"
......@@ -55,6 +55,7 @@
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/highlighterfactory.h>
#include <utils/hostosinfo.h>
......@@ -165,7 +166,15 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
addAutoReleasedObject(new CppTypeHierarchyFactory);
addAutoReleasedObject(new CppIncludeHierarchyFactory);
addAutoReleasedObject(new CppSnippetProvider);
addAutoReleasedObject(new CppHighlighterFactory);
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<CppHighlighter>();
hf->setId(CppEditor::Constants::CPPEDITOR_ID);
hf->addMimeType(CppEditor::Constants::C_SOURCE_MIMETYPE);
hf->addMimeType(CppEditor::Constants::C_HEADER_MIMETYPE);
hf->addMimeType(CppEditor::Constants::CPP_SOURCE_MIMETYPE);
hf->addMimeType(CppEditor::Constants::CPP_HEADER_MIMETYPE);
addAutoReleasedObject(hf);
m_quickFixProvider = new CppQuickFixAssistProvider;
addAutoReleasedObject(m_quickFixProvider);
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "cpphighlighterfactory.h"
#include "cppeditorconstants.h"
#include "cpphighlighter.h"
using namespace CppEditor::Internal;
CppHighlighterFactory::CppHighlighterFactory()
{
setId(CppEditor::Constants::CPPEDITOR_ID);
addMimeType(CppEditor::Constants::C_SOURCE_MIMETYPE);
addMimeType(CppEditor::Constants::C_HEADER_MIMETYPE);
addMimeType(CppEditor::Constants::CPP_SOURCE_MIMETYPE);
addMimeType(CppEditor::Constants::CPP_HEADER_MIMETYPE);
}
TextEditor::SyntaxHighlighter *CppHighlighterFactory::createHighlighter() const
{
return new CppHighlighter;
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef CPPHIGHLIGHTERFACTORY_H
#define CPPHIGHLIGHTERFACTORY_H
#include <texteditor/ihighlighterfactory.h>
namespace CppEditor {
namespace Internal {
class CppHighlighterFactory : public TextEditor::IHighlighterFactory
{
Q_OBJECT
public:
CppHighlighterFactory();
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
};
} // namespace Internal
} // namespace CppEditor
#endif // CPPHIGHLIGHTERFACTORY_H
......@@ -46,7 +46,7 @@
#include <texteditor/basetexteditor.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/ihighlighterfactory.h>
#include <texteditor/highlighterfactory.h>
#include <texteditor/syntaxhighlighter.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/texteditorsettings.h>
......@@ -110,7 +110,7 @@ protected:
private:
SideDiffEditorWidget *m_editor;
QMap<QString, IHighlighterFactory *> m_mimeTypeToHighlighterFactory;
QMap<QString, HighlighterFactory *> m_mimeTypeToHighlighterFactory;
QList<SyntaxHighlighter *> m_highlighters;
QList<QTextDocument *> m_documents;
};
......@@ -235,9 +235,9 @@ MultiHighlighter::MultiHighlighter(SideDiffEditorWidget *editor, QTextDocument *
: SyntaxHighlighter(document),
m_editor(editor)
{
const QList<IHighlighterFactory *> &factories =
ExtensionSystem::PluginManager::getObjects<TextEditor::IHighlighterFactory>();
foreach (IHighlighterFactory *factory, factories) {
const QList<HighlighterFactory *> &factories =
ExtensionSystem::PluginManager::getObjects<TextEditor::HighlighterFactory>();
foreach (HighlighterFactory *factory, factories) {
QStringList mimeTypes = factory->mimeTypes();
foreach (const QString &mimeType, mimeTypes)
m_mimeTypeToHighlighterFactory.insert(mimeType, factory);
......@@ -274,7 +274,7 @@ void MultiHighlighter::setDocuments(const QList<QPair<DiffFileInfo, QString> > &
QTextDocument *document = new QTextDocument(contents);
const MimeType mimeType = MimeDatabase::findByFile(QFileInfo(fileInfo.fileName));
SyntaxHighlighter *highlighter = 0;
if (const IHighlighterFactory *factory = m_mimeTypeToHighlighterFactory.value(mimeType.type())) {
if (const HighlighterFactory *factory = m_mimeTypeToHighlighterFactory.value(mimeType.type())) {
highlighter = factory->createHighlighter();
if (highlighter)
highlighter->setDocument(document);
......
......@@ -45,7 +45,7 @@
#include <texteditor/basetexteditor.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/ihighlighterfactory.h>
#include <texteditor/highlighterfactory.h>
#include <texteditor/syntaxhighlighter.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/texteditorsettings.h>
......
......@@ -11,7 +11,6 @@ glsleditorfactory.h \
glsleditorplugin.h \
glslfilewizard.h \
glslhighlighter.h \
glslhighlighterfactory.h \
glslautocompleter.h \
glslindenter.h \
glslhoverhandler.h \
......@@ -25,7 +24,6 @@ glsleditorfactory.cpp \
glsleditorplugin.cpp \
glslfilewizard.cpp \
glslhighlighter.cpp \
glslhighlighterfactory.cpp \
glslautocompleter.cpp \
glslindenter.cpp \
glslhoverhandler.cpp \
......
......@@ -34,8 +34,6 @@ QtcPlugin {
"glslfilewizard.h",
"glslhighlighter.cpp",
"glslhighlighter.h",
"glslhighlighterfactory.cpp",
"glslhighlighterfactory.h",
"glslhoverhandler.cpp",
"glslhoverhandler.h",
"glslindenter.cpp",
......
......@@ -34,7 +34,7 @@
#include "glslfilewizard.h"
#include "glslhoverhandler.h"
#include "glslcompletionassist.h"
#include "glslhighlighterfactory.h"
#include "glslhighlighter.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
......@@ -47,6 +47,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/taskhub.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/highlighterfactory.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/textfilewizard.h>
#include <utils/qtcassert.h>
......@@ -219,7 +220,15 @@ bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
wizard->setId(QLatin1String("K.GLSL"));
addAutoReleasedObject(wizard);
addAutoReleasedObject(new GLSLHighlighterFactory);
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<Highlighter>();
hf->setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE);
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT);
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG);
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT_ES);
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG_ES);
addAutoReleasedObject(hf);
return true;
}
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "glslhighlighterfactory.h"
#include "glsleditorconstants.h"
#include "glslhighlighter.h"
using namespace GLSLEditor::Internal;
GLSLHighlighterFactory::GLSLHighlighterFactory()
{
setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE);
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT);
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG);
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT_ES);
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG_ES);
}
TextEditor::SyntaxHighlighter *GLSLHighlighterFactory::createHighlighter() const
{
return new Highlighter;
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef GLSLHIGHLIGHTERFACTORY_H
#define GLSLHIGHLIGHTERFACTORY_H
#include <texteditor/ihighlighterfactory.h>
namespace GLSLEditor {
namespace Internal {
class GLSLHighlighterFactory : public TextEditor::IHighlighterFactory
{
Q_OBJECT
public:
GLSLHighlighterFactory();
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
};
} // namespace Internal
} // namespace GLSLEditor
#endif // GLSLHIGHLIGHTERFACTORY_H
......@@ -18,7 +18,6 @@ HEADERS += \
wizard/pythonclasswizarddialog.h \
wizard/pythonsourcegenerator.h \
tools/pythonhighlighter.h \
tools/pythonhighlighterfactory.h \
tools/pythonindenter.h \
tools/lexical/pythonformattoken.h \
tools/lexical/pythonscanner.h \
......@@ -35,6 +34,5 @@ SOURCES += \
wizard/pythonclassnamepage.cpp \
wizard/pythonsourcegenerator.cpp \
tools/pythonhighlighter.cpp \
tools/pythonhighlighterfactory.cpp \
tools/pythonindenter.cpp \
tools/lexical/pythonscanner.cpp
......@@ -33,7 +33,6 @@ QtcPlugin {
"lexical/pythonscanner.h", "lexical/pythonscanner.cpp",
"lexical/sourcecodestream.h",
"pythonhighlighter.h", "pythonhighlighter.cpp",
"pythonhighlighterfactory.h", "pythonhighlighterfactory.cpp",
"pythonindenter.cpp", "pythonindenter.h"
]
}
......
......@@ -33,7 +33,7 @@
#include "wizard/pythonclasswizard.h"
#include "pythoneditorwidget.h"
#include "pythoneditorfactory.h"
#include "tools/pythonhighlighterfactory.h"
#include "tools/pythonhighlighter.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
......@@ -43,6 +43,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/highlighterfactory.h>
#include <QtPlugin>
#include <QCoreApplication>
......@@ -229,7 +230,12 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
// Add Python files and classes creation dialogs
addAutoReleasedObject(new FileWizard);
addAutoReleasedObject(new ClassWizard);
addAutoReleasedObject(new Internal::PythonHighlighterFactory);
auto hf = new TextEditor::HighlighterFactory;
hf->setId(Constants::C_PYTHONEDITOR_ID);
hf->setProductType<PythonHighlighter>();
hf->addMimeType(QLatin1String(Constants::C_PY_MIMETYPE));
addAutoReleasedObject(hf);
return true;
}
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "pythonhighlighterfactory.h"
#include "../pythoneditorconstants.h"
#include "pythonhighlighter.h"
using namespace PythonEditor::Internal;
PythonHighlighterFactory::PythonHighlighterFactory()
{
setId(Constants::C_PYTHONEDITOR_ID);
addMimeType(QLatin1String(Constants::C_PY_MIMETYPE));
}
TextEditor::SyntaxHighlighter *PythonHighlighterFactory::createHighlighter() const
{
return new PythonHighlighter;
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef PYTHONHIGHLIGHTERFACTORY_H
#define PYTHONHIGHLIGHTERFACTORY_H
#include <texteditor/ihighlighterfactory.h>
namespace PythonEditor {
namespace Internal {
class PythonHighlighterFactory : public TextEditor::IHighlighterFactory
{
Q_OBJECT
public:
PythonHighlighterFactory();
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
};
} // namespace Internal
} // namespace PythonEditor
#endif // PYTHONHIGHLIGHTERFACTORY_H
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception