diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
index da58a14197810e091b44a05be63b324988355105..bf485f6148d0661b53091038ef15a51327230535 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
@@ -51,6 +51,7 @@
 #include <extensionsystem/pluginmanager.h>
 #include <cpptools/ModelManagerInterface.h>
 #include <coreplugin/icore.h>
+#include <coreplugin/icontext.h>
 #include <utils/qtcassert.h>
 #include <utils/filesystemwatcher.h>
 
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index 5db94d13ddcf39979a7d0730ec9415052f153f3a..637c57ff5c21ae6677fec961f7278a2baf53bca0 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -43,6 +43,7 @@
 #include "modeltest.h"
 #endif
 
+#include <QTimerEvent>
 #include <QDir>
 #include <QDebug>
 
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 68d466214231996caf10458a261b8aab5e7499e3..fb7ac6ad6a981c89d558121acaabccf97f1a62a9 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -53,6 +53,7 @@
 
 #include <coreplugin/icore.h>
 #include <projectexplorer/taskhub.h>
+#include <texteditor/itexteditor.h>
 
 #include <utils/synchronousprocess.h>
 #include <utils/qtcprocess.h>
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index a37b2b6cd320ed5a5a4e8b262c39ce3d17d4da0e..af4a9bc27e913daf1bf5ae69a0a3d30d3922f791 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -49,12 +49,15 @@
 
 #include <coreplugin/icore.h>
 #include <coreplugin/editormanager/editormanager.h>
+#include <coreplugin/editormanager/ieditor.h>
 #include <coreplugin/progressmanager/progressmanager.h>
 #include <coreplugin/progressmanager/futureprogress.h>
 
 #include <projectexplorer/projectexplorer.h>
 #include <projectexplorer/taskhub.h>
 
+#include <texteditor/itexteditor.h>
+
 #include <utils/savedaction.h>
 #include <utils/qtcassert.h>
 #include <utils/fileinprojectfinder.h>
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 6088620a51da3ffe07737c7355fc9d3e848b3f01..a5b12216901364ec01cc4817fcb35e4a36db28ae 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -65,6 +65,7 @@
 #include <coreplugin/icore.h>
 #include <projectexplorer/taskhub.h>
 #include <projectexplorer/itaskhandler.h>
+#include <texteditor/itexteditor.h>
 #include <utils/hostosinfo.h>
 #include <utils/qtcassert.h>
 #include <utils/qtcprocess.h>
diff --git a/src/plugins/debugger/memoryagent.cpp b/src/plugins/debugger/memoryagent.cpp
index fe318ba61ff9a33a2bcea671037280803828669f..0d045a4679a6ac975b47e7952a2488cfae7c6573 100644
--- a/src/plugins/debugger/memoryagent.cpp
+++ b/src/plugins/debugger/memoryagent.cpp
@@ -37,6 +37,7 @@
 #include "debuggerinternalconstants.h"
 
 #include <coreplugin/coreconstants.h>
+#include <coreplugin/editormanager/ieditor.h>
 #include <coreplugin/editormanager/editormanager.h>
 
 #include <utils/qtcassert.h>
diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp
index bcd329d2413d20ec53fe204fd3b09bade399d36d..22768218f54db13ac326c4aacdfa197dd0f442b5 100644
--- a/src/plugins/debugger/qml/qmlcppengine.cpp
+++ b/src/plugins/debugger/qml/qmlcppengine.cpp
@@ -35,6 +35,7 @@
 #include "watchhandler.h"
 
 #include <utils/qtcassert.h>
+#include <texteditor/itexteditor.h>
 #include <qmljseditor/qmljseditorconstants.h>
 #include <cppeditor/cppeditorconstants.h>
 #include <qmljs/consolemanagerinterface.h>
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index e44cf92dab7da2b8909225bec57c38e40abd5690..78c424307578a5162825cc57cd30c7a943eb3c98 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -53,6 +53,7 @@
 
 #include <utils/qtcassert.h>
 
+#include <texteditor/itexteditor.h>
 #include <coreplugin/editormanager/editormanager.h>
 #include <coreplugin/helpmanager.h>
 #include <coreplugin/icore.h>
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 9b58fcc0e5f01190e6e23ef058cdb5d34eace074..e7828bbd52f88e8572dbf25790b5f1dfdeadc836 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -92,6 +92,7 @@
 
 #include <extensionsystem/pluginspec.h>
 #include <coreplugin/icore.h>
+#include <coreplugin/editormanager/ieditor.h>
 #include <coreplugin/id.h>
 #include <coreplugin/coreconstants.h>
 #include <coreplugin/documentmanager.h>
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index b23ccbd6f347b7286a03db2c51362de608dfb412..2179276e11a3526ff474046bfe178025de371e19 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -42,6 +42,7 @@
 #include <utils/checkablemessagebox.h>
 
 #include <coreplugin/icore.h>
+#include <coreplugin/icontext.h>
 
 #include <QTimer>
 #include <QPushButton>
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index e9c5835e0cbddddd8b1d937c7f78414a54faf992..14a8750f9415d4da64ee936505f09e1c9545f709 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -53,6 +53,7 @@
 #include <projectexplorer/target.h>
 #include <projectexplorer/session.h>
 #include <projectexplorer/localapplicationrunconfiguration.h>
+#include <texteditor/itexteditor.h>
 
 #include <remotelinux/remotelinuxrunconfiguration.h>
 #include <remotelinux/linuxdevice.h>
diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp
index d8a377d9547d631ca036eb22e4734840fb2414a1..23622a48932dbb13b2413e93f10a07d64bec8737 100644
--- a/src/plugins/texteditor/basetextmark.cpp
+++ b/src/plugins/texteditor/basetextmark.cpp
@@ -27,6 +27,7 @@
 **
 ****************************************************************************/
 
+#include "basetextmarkregistry.h"
 #include "basetextmark.h"
 #include "itexteditor.h"
 #include "basetextdocument.h"
diff --git a/src/plugins/texteditor/basetextmark.h b/src/plugins/texteditor/basetextmark.h
index a6e3994bfe9f07d9c56996d4ac37983ef97c859c..7b31e061d5ffac1915b8e4a804413d5bedd54104 100644
--- a/src/plugins/texteditor/basetextmark.h
+++ b/src/plugins/texteditor/basetextmark.h
@@ -31,18 +31,7 @@
 #define BASETEXTMARK_H
 
 #include "texteditor_global.h"
-#include "itexteditor.h"
-
-#include <utils/fileutils.h>
-
-#include <QWeakPointer>
-#include <QHash>
-#include <QSet>
-
-QT_BEGIN_NAMESPACE
-class QTextBlock;
-class QPainter;
-QT_END_NAMESPACE
+#include "itextmark.h"
 
 namespace TextEditor {
 namespace Internal {
@@ -70,24 +59,6 @@ private:
     QString m_fileName;
 };
 
-namespace Internal {
-class BaseTextMarkRegistry : public QObject
-{
-    Q_OBJECT
-public:
-    BaseTextMarkRegistry(QObject *parent);
-
-    void add(BaseTextMark *mark);
-    bool remove(BaseTextMark *mark);
-private slots:
-    void editorOpened(Core::IEditor *editor);
-    void documentRenamed(Core::IDocument *document, const QString &oldName, const QString &newName);
-    void allDocumentsRenamed(const QString &oldName, const QString &newName);
-private:
-    QHash<Utils::FileName, QSet<BaseTextMark *> > m_marks;
-};
-}
-
 } // namespace TextEditor
 
 #endif // BASETEXTMARK_H
diff --git a/src/plugins/texteditor/basetextmarkregistry.h b/src/plugins/texteditor/basetextmarkregistry.h
new file mode 100644
index 0000000000000000000000000000000000000000..0b3978055ddd15ef90f1104f5fae2110365fef9f
--- /dev/null
+++ b/src/plugins/texteditor/basetextmarkregistry.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 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 BASETEXTMARKREGISTRY_H
+#define BASETEXTMARKREGISTRY_H
+
+#include <utils/fileutils.h>
+
+#include <QObject>
+#include <QHash>
+#include <QSet>
+
+namespace Core {
+class IEditor;
+class IDocument;
+}
+
+namespace TextEditor {
+class BaseTextMark;
+namespace Internal {
+
+class BaseTextMarkRegistry : public QObject
+{
+    Q_OBJECT
+public:
+    BaseTextMarkRegistry(QObject *parent);
+
+    void add(BaseTextMark *mark);
+    bool remove(BaseTextMark *mark);
+private slots:
+    void editorOpened(Core::IEditor *editor);
+    void documentRenamed(Core::IDocument *document, const QString &oldName, const QString &newName);
+    void allDocumentsRenamed(const QString &oldName, const QString &newName);
+private:
+    QHash<Utils::FileName, QSet<BaseTextMark *> > m_marks;
+};
+
+} // namespace Internal
+} // namespace TextEditor
+
+#endif // BASETEXTMARKREGISTRY_H
diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro
index e4e9be0c6676d15eea953129d31269a90649750b..19f62afaf06d2cadbd338a63f0ab876dc840c777 100644
--- a/src/plugins/texteditor/texteditor.pro
+++ b/src/plugins/texteditor/texteditor.pro
@@ -226,7 +226,8 @@ HEADERS += texteditorplugin.h \
     circularclipboard.h \
     circularclipboardassist.h \
     itextmark.h \
-    codeassist/keywordscompletionassist.h
+    codeassist/keywordscompletionassist.h \
+    basetextmarkregistry.h
 
 FORMS += \
     displaysettingspage.ui \
diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp
index ab26fca731ba15209ad14dc3afe983c9a4dabbb4..0384ae2bc76e81ebc618280f4cb7e2a0203200af 100644
--- a/src/plugins/texteditor/texteditorplugin.cpp
+++ b/src/plugins/texteditor/texteditorplugin.cpp
@@ -44,6 +44,7 @@
 #include "snippets/plaintextsnippetprovider.h"
 #include "codeassist/assistenums.h"
 #include "basetextmark.h"
+#include "basetextmarkregistry.h"
 
 #include <coreplugin/icore.h>
 #include <coreplugin/coreconstants.h>