aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-19 12:54:36 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-19 12:54:36 (GMT)
commit9d94e9b19892e093c188fa650df223b73a79543b (patch)
treee6de266ecc3accaffa16d1e256a9a417d39a0dc8
parente9a418bcfb198a78c04667d02e5aab9c4d16f59d (diff)
DocumentPrivate impl, that way we can avoid lots of virtual functions
-rw-r--r--autotests/src/bug286887.cpp2
-rw-r--r--autotests/src/bug313759.cpp2
-rw-r--r--autotests/src/bug313769.cpp2
-rw-r--r--autotests/src/bug317111.cpp4
-rw-r--r--autotests/src/katedocument_test.cpp24
-rw-r--r--autotests/src/katefoldingtest.cpp4
-rw-r--r--autotests/src/kateview_test.cpp12
-rw-r--r--autotests/src/kte_documentcursor.cpp4
-rw-r--r--autotests/src/messagetest.cpp16
-rw-r--r--autotests/src/modificationsystem_test.cpp24
-rw-r--r--autotests/src/movingcursor_test.cpp8
-rw-r--r--autotests/src/movingrange_test.cpp8
-rw-r--r--autotests/src/plaintextsearch_test.cpp2
-rw-r--r--autotests/src/plaintextsearch_test.h4
-rw-r--r--autotests/src/range_test.cpp6
-rw-r--r--autotests/src/regexpsearch_test.cpp8
-rw-r--r--autotests/src/revision_test.cpp4
-rw-r--r--autotests/src/script_test_base.cpp2
-rw-r--r--autotests/src/script_test_base.h4
-rw-r--r--autotests/src/scriptdocument_test.cpp2
-rw-r--r--autotests/src/scriptdocument_test.h4
-rw-r--r--autotests/src/searchbar_test.cpp36
-rw-r--r--autotests/src/templatehandler_test.cpp2
-rw-r--r--autotests/src/testutils.cpp4
-rw-r--r--autotests/src/testutils.h4
-rw-r--r--autotests/src/undomanager_test.cpp4
-rw-r--r--autotests/src/vimode_test.cpp2
-rw-r--r--autotests/src/vimode_test.h2
-rw-r--r--src/buffer/katetextbuffer.cpp2
-rw-r--r--src/buffer/katetextbuffer.h8
-rw-r--r--src/completion/katecompletiondelegate.cpp2
-rw-r--r--src/completion/katecompletiondelegate.h4
-rw-r--r--src/completion/katewordcompletion.cpp2
-rw-r--r--src/dialogs/katedialogs.cpp8
-rw-r--r--src/dialogs/katedialogs.h6
-rw-r--r--src/document/katebuffer.cpp4
-rw-r--r--src/document/katebuffer.h6
-rw-r--r--src/document/katedocument.cpp480
-rw-r--r--src/document/katedocument.h17
-rw-r--r--src/include/ktexteditor/document.h12
-rw-r--r--src/mode/katemodemanager.cpp2
-rw-r--r--src/mode/katemodemanager.h4
-rw-r--r--src/mode/katemodemenu.cpp6
-rw-r--r--src/mode/katemodemenu.h4
-rw-r--r--src/printing/kateprinter.cpp2
-rw-r--r--src/printing/printpainter.h4
-rw-r--r--src/render/katelinelayout.cpp2
-rw-r--r--src/render/katelinelayout.h4
-rw-r--r--src/render/katerenderer.cpp2
-rw-r--r--src/render/katerenderer.h8
-rw-r--r--src/script/data/libraries/documentcursor.js2
-rw-r--r--src/script/katescriptdocument.cpp4
-rw-r--r--src/script/katescriptdocument.h10
-rw-r--r--src/search/katematch.cpp2
-rw-r--r--src/search/katematch.h6
-rw-r--r--src/search/katesearchbar.cpp2
-rw-r--r--src/spellcheck/ontheflycheck.cpp14
-rw-r--r--src/spellcheck/ontheflycheck.h10
-rw-r--r--src/spellcheck/spellcheck.cpp14
-rw-r--r--src/spellcheck/spellcheck.h12
-rw-r--r--src/spellcheck/spellcheckdialog.cpp4
-rw-r--r--src/spellcheck/spellingmenu.cpp2
-rw-r--r--src/src/document.cpp23
-rw-r--r--src/src/documentcursor.cpp2
-rw-r--r--src/swapfile/kateswapdiffcreator.cpp2
-rw-r--r--src/swapfile/kateswapfile.cpp4
-rw-r--r--src/swapfile/kateswapfile.h6
-rw-r--r--src/syntax/katehighlight.cpp6
-rw-r--r--src/syntax/katehighlightmenu.cpp2
-rw-r--r--src/syntax/katehighlightmenu.h6
-rw-r--r--src/syntax/katesyntaxmanager.cpp2
-rw-r--r--src/undo/katemodifiedundo.cpp32
-rw-r--r--src/undo/katemodifiedundo.h12
-rw-r--r--src/undo/kateundo.cpp42
-rw-r--r--src/undo/kateundo.h22
-rw-r--r--src/undo/kateundomanager.cpp2
-rw-r--r--src/undo/kateundomanager.h6
-rw-r--r--src/utils/kateautoindent.cpp4
-rw-r--r--src/utils/kateautoindent.h10
-rw-r--r--src/utils/katecmds.cpp6
-rw-r--r--src/utils/katecmds.h6
-rw-r--r--src/utils/kateconfig.cpp4
-rw-r--r--src/utils/kateconfig.h6
-rw-r--r--src/utils/katefactory.cpp2
-rw-r--r--src/utils/kateglobal.cpp6
-rw-r--r--src/utils/kateglobal.h10
-rw-r--r--src/utils/katetemplatehandler.cpp2
-rw-r--r--src/utils/katetemplatehandler.h6
-rw-r--r--src/variableeditor/variablelineedit.cpp2
-rw-r--r--src/view/katetextanimation.h4
-rw-r--r--src/view/kateview.cpp10
-rw-r--r--src/view/kateview.h10
-rw-r--r--src/view/kateviewhelpers.cpp2
-rw-r--r--src/view/kateviewhelpers.h10
-rw-r--r--src/view/kateviewinternal.cpp6
-rw-r--r--src/view/kateviewinternal.h4
-rw-r--r--src/vimode/kateviinputmodemanager.cpp2
-rw-r--r--src/vimode/kateviinputmodemanager.h4
-rw-r--r--src/vimode/katevikeymapper.cpp2
-rw-r--r--src/vimode/katevikeymapper.h6
-rw-r--r--src/vimode/katevimodebase.h4
101 files changed, 582 insertions, 586 deletions
diff --git a/autotests/src/bug286887.cpp b/autotests/src/bug286887.cpp
index 019572f..eb21299 100644
--- a/autotests/src/bug286887.cpp
+++ b/autotests/src/bug286887.cpp
@@ -49,7 +49,7 @@ void BugTest::cleanupTestCase()
void BugTest::ctrlShiftLeft()
{
- KateDocument doc(false, false);
+ KTextEditor::DocumentPrivate doc(false, false);
// view must be visible...
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
diff --git a/autotests/src/bug313759.cpp b/autotests/src/bug313759.cpp
index ecdac31..9763454 100644
--- a/autotests/src/bug313759.cpp
+++ b/autotests/src/bug313759.cpp
@@ -54,7 +54,7 @@ void BugTest::tryCrash()
{
// set up document and view
KMainWindow *toplevel = new KMainWindow();
- KateDocument *doc = new KateDocument(true, false, toplevel);
+ KTextEditor::DocumentPrivate *doc = new KTextEditor::DocumentPrivate(true, false, toplevel);
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc->createView(0));
bool outputWasCustomised = false;
TestScriptEnv *env = new TestScriptEnv(doc, outputWasCustomised);
diff --git a/autotests/src/bug313769.cpp b/autotests/src/bug313769.cpp
index 9ec6ce2..c011345 100644
--- a/autotests/src/bug313769.cpp
+++ b/autotests/src/bug313769.cpp
@@ -52,7 +52,7 @@ void BugTest::cleanupTestCase()
void BugTest::tryCrash()
{
- KateDocument doc(false, false);
+ KTextEditor::DocumentPrivate doc(false, false);
const QUrl url = QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"bug313769.cpp"));
doc.openUrl(url);
doc.discardDataRecovery();
diff --git a/autotests/src/bug317111.cpp b/autotests/src/bug317111.cpp
index 90f4e55..ec6a5d1 100644
--- a/autotests/src/bug317111.cpp
+++ b/autotests/src/bug317111.cpp
@@ -54,7 +54,7 @@ void BugTest::tryCrash()
{
// set up document and view
KMainWindow *toplevel = new KMainWindow();
- KateDocument *doc = new KateDocument(true, false, toplevel);
+ KTextEditor::DocumentPrivate *doc = new KTextEditor::DocumentPrivate(true, false, toplevel);
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc->createView(0));
bool outputWasCustomised = false;
TestScriptEnv *env = new TestScriptEnv(doc, outputWasCustomised);
@@ -75,7 +75,7 @@ void BugTest::tryCrash()
view->setCursorPosition(Cursor(0, 0));
// evaluate test-script
- qDebug() << "attempting crash by calling KateDocument::defStyle(-1, 0)";
+ qDebug() << "attempting crash by calling KTextEditor::DocumentPrivate::defStyle(-1, 0)";
QFile sourceFile(QLatin1String(TEST_DATA_DIR "bug317111.js"));
QVERIFY(sourceFile.open(QFile::ReadOnly));
QTextStream stream(&sourceFile);
diff --git a/autotests/src/katedocument_test.cpp b/autotests/src/katedocument_test.cpp
index 1b7232f..cc9fd1f 100644
--- a/autotests/src/katedocument_test.cpp
+++ b/autotests/src/katedocument_test.cpp
@@ -94,13 +94,13 @@ KateDocumentTest::~KateDocumentTest()
}
// tests:
-// KateDocument::insertText with word wrap enabled. It is checked whether the
+// KTextEditor::DocumentPrivate::insertText with word wrap enabled. It is checked whether the
// text is correctly wrapped and whether the moving cursors maintain the correct
// position.
// see also: http://bugs.kde.org/show_bug.cgi?id=168534
void KateDocumentTest::testWordWrap()
{
- KateDocument doc(false, false);
+ KTextEditor::DocumentPrivate doc(false, false);
doc.setWordWrap(true);
doc.setWordWrapAt(80);
@@ -134,7 +134,7 @@ void KateDocumentTest::testWordWrap()
void KateDocumentTest::testReplaceQStringList()
{
- KateDocument doc(false, false);
+ KTextEditor::DocumentPrivate doc(false, false);
doc.setWordWrap(false);
doc.setText(QLatin1String("asdf\n"
"foo\n"
@@ -149,7 +149,7 @@ void KateDocumentTest::testReplaceQStringList()
void KateDocumentTest::testMovingInterfaceSignals()
{
- KateDocument *doc = new KateDocument;
+ KTextEditor::DocumentPrivate *doc = new KTextEditor::DocumentPrivate;
QSignalSpy aboutToDeleteSpy(doc, SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)));
QSignalSpy aboutToInvalidateSpy(doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)));
@@ -186,7 +186,7 @@ void KateDocumentTest::testSetTextPerformance()
Q_ASSERT(columns % (rangeLength + rangeGap) == 0);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
MovingRangeInvalidator invalidator;
connect(&doc, SIGNAL(aboutToInvalidateMovingInterfaceContent(KTextEditor::Document*)),
&invalidator, SLOT(aboutToInvalidateMovingInterfaceContent()));
@@ -233,7 +233,7 @@ void KateDocumentTest::testRemoveTextPerformance()
const int lines = 5000;
const int columns = 80;
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QString text;
const QString line = QString().fill('a', columns);
@@ -264,7 +264,7 @@ void KateDocumentTest::testRemoveTextPerformance()
void KateDocumentTest::testForgivingApiUsage()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QVERIFY(doc.isEmpty());
QVERIFY(doc.replaceText(Range(0, 0, 100, 100), "asdf"));
@@ -304,7 +304,7 @@ public Q_SLOTS:
void KateDocumentTest::testRemoveMultipleLines()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("line1\n"
"line2\n"
@@ -318,7 +318,7 @@ void KateDocumentTest::testRemoveMultipleLines()
void KateDocumentTest::testInsertNewline()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("this is line\n"
"this is line2\n");
@@ -329,7 +329,7 @@ void KateDocumentTest::testInsertNewline()
}
// we have two different ways of creating the md5 checksum:
-// in KateFileLoader and KateDocument::createDigest. Make
+// in KateFileLoader and KTextEditor::DocumentPrivate::createDigest. Make
// sure, these two implementations result in the same checksum.
void KateDocumentTest::testDigest()
{
@@ -337,8 +337,8 @@ void KateDocumentTest::testDigest()
// QCryptographicHash is used, therefore we need fromHex here
const QByteArray fileDigest = QByteArray::fromHex("ff6e0fddece03adeb8f902e8c540735a");
- // make sure, Kate::TextBuffer and KateDocument::createDigest() equal
- KateDocument doc;
+ // make sure, Kate::TextBuffer and KTextEditor::DocumentPrivate::createDigest() equal
+ KTextEditor::DocumentPrivate doc;
doc.openUrl(QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"md5checksum.txt")));
const QByteArray bufferDigest(doc.digest());
QVERIFY(doc.createDigest());
diff --git a/autotests/src/katefoldingtest.cpp b/autotests/src/katefoldingtest.cpp
index e87f69d..7ffc722 100644
--- a/autotests/src/katefoldingtest.cpp
+++ b/autotests/src/katefoldingtest.cpp
@@ -59,7 +59,7 @@ void KateFoldingTest::cleanupTestCase()
// Buggy behavior: the cursor is hidden, and moving the hidden cursor crashes kate
void KateFoldingTest::testCrash311866()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
const QUrl url = QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"bug311866.cpp"));
doc.openUrl(url);
doc.setHighlightingMode("C++");
@@ -89,7 +89,7 @@ void KateFoldingTest::testCrash311866()
// See https://bugs.kde.org/show_bug.cgi?id=295632
void KateFoldingTest::testBug295632()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QString text = "oooossssssss\n"
"{\n"
"\n"
diff --git a/autotests/src/kateview_test.cpp b/autotests/src/kateview_test.cpp
index a9dccb2..d2a438e 100644
--- a/autotests/src/kateview_test.cpp
+++ b/autotests/src/kateview_test.cpp
@@ -65,7 +65,7 @@ void KateViewTest::testReloadMultipleViews()
stream << flush;
file.close();
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
QCOMPARE(doc.highlightingMode(), QString("C++"));
@@ -81,7 +81,7 @@ void KateViewTest::testReloadMultipleViews()
void KateViewTest::testLowerCaseBlockSelection()
{
// testcase for https://bugs.kde.org/show_bug.cgi?id=258480
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("nY\nnYY\n");
KTextEditor::ViewPrivate *view1 = new KTextEditor::ViewPrivate(&doc, 0);
@@ -118,7 +118,7 @@ void KateViewTest::testFolding()
stream << flush;
file.close();
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
QCOMPARE(doc.highlightingMode(), QString("C++"));
@@ -162,7 +162,7 @@ void KateViewTest::testBug287291()
stream << flush;
file.close();
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
QCOMPARE(doc.highlightingMode(), QString("C++"));
@@ -229,7 +229,7 @@ void KateViewTest::testSelection()
stream << flush;
file.close();
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
KTextEditor::ViewPrivate *view = new KTextEditor::ViewPrivate(&doc, 0);
@@ -294,7 +294,7 @@ void KateViewTest::testSelection()
void KateViewTest::testKillline()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.insertLines(0, QStringList()
<< "foo"
<< "bar"
diff --git a/autotests/src/kte_documentcursor.cpp b/autotests/src/kte_documentcursor.cpp
index b382683..fe634b7 100644
--- a/autotests/src/kte_documentcursor.cpp
+++ b/autotests/src/kte_documentcursor.cpp
@@ -63,7 +63,7 @@ void DocumentCursorTest::cleanupTestCase()
// - gotoPreviousLine
void DocumentCursorTest::testConvenienceApi()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("\n"
"1\n"
"22\n"
@@ -123,7 +123,7 @@ void DocumentCursorTest::testConvenienceApi()
void DocumentCursorTest::testOperators()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("--oo--\n"
"--oo--\n"
"--oo--");
diff --git a/autotests/src/messagetest.cpp b/autotests/src/messagetest.cpp
index 5a5c403..97c2dea 100644
--- a/autotests/src/messagetest.cpp
+++ b/autotests/src/messagetest.cpp
@@ -43,7 +43,7 @@ void MessageTest::cleanupTestCase()
void MessageTest::testPostMessage()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
@@ -71,7 +71,7 @@ void MessageTest::testPostMessage()
void MessageTest::testAutoHide()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
@@ -103,7 +103,7 @@ void MessageTest::testAutoHide()
void MessageTest::testAutoHideAfterUserInteraction()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
@@ -146,7 +146,7 @@ void MessageTest::testAutoHideAfterUserInteraction()
void MessageTest::testMessageQueue()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
@@ -203,7 +203,7 @@ void MessageTest::testMessageQueue()
void MessageTest::testPriority()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
@@ -264,7 +264,7 @@ void MessageTest::testPriority()
void MessageTest::testCreateView()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
//
// - first post a message
@@ -307,7 +307,7 @@ void MessageTest::testCreateView()
void MessageTest::testHideView()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
@@ -353,7 +353,7 @@ void MessageTest::testHideView()
void MessageTest::testHideViewAfterUserInteraction()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
diff --git a/autotests/src/modificationsystem_test.cpp b/autotests/src/modificationsystem_test.cpp
index 1af0aca..e50770f 100644
--- a/autotests/src/modificationsystem_test.cpp
+++ b/autotests/src/modificationsystem_test.cpp
@@ -39,7 +39,7 @@ void ModificationSystemTest::cleanupTestCase()
{
}
-static void clearModificationFlags(KateDocument *doc)
+static void clearModificationFlags(KTextEditor::DocumentPrivate *doc)
{
for (int i = 0; i < doc->lines(); ++i) {
Kate::TextLine line = doc->plainKateTextLine(i);
@@ -48,7 +48,7 @@ static void clearModificationFlags(KateDocument *doc)
}
}
-static void markModifiedLinesAsSaved(KateDocument *doc)
+static void markModifiedLinesAsSaved(KTextEditor::DocumentPrivate *doc)
{
for (int i = 0; i < doc->lines(); ++i) {
Kate::TextLine textLine = doc->plainKateTextLine(i);
@@ -60,7 +60,7 @@ static void markModifiedLinesAsSaved(KateDocument *doc)
void ModificationSystemTest::testInsertText()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("first line\n");
doc->setText(content);
@@ -118,7 +118,7 @@ void ModificationSystemTest::testInsertText()
void ModificationSystemTest::testRemoveText()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("first line\n");
doc->setText(content);
@@ -176,7 +176,7 @@ void ModificationSystemTest::testRemoveText()
void ModificationSystemTest::testInsertLine()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("0\n"
"2");
@@ -246,7 +246,7 @@ void ModificationSystemTest::testInsertLine()
void ModificationSystemTest::testRemoveLine()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("0\n"
"1\n"
@@ -315,7 +315,7 @@ void ModificationSystemTest::testWrapLineMid()
{
for (int i = 0; i < 2; ++i) {
bool insertNewLine = (i == 1);
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("aaaa\n"
"bbbb\n"
@@ -387,7 +387,7 @@ void ModificationSystemTest::testWrapLineMid()
void ModificationSystemTest::testWrapLineAtEnd()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("aaaa\n"
"bbbb");
@@ -457,7 +457,7 @@ void ModificationSystemTest::testWrapLineAtEnd()
void ModificationSystemTest::testWrapLineAtStart()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("aaaa\n"
"bbbb");
@@ -527,7 +527,7 @@ void ModificationSystemTest::testWrapLineAtStart()
void ModificationSystemTest::testUnWrapLine()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("aaaa\n"
"bbbb\n"
@@ -594,7 +594,7 @@ void ModificationSystemTest::testUnWrapLine()
void ModificationSystemTest::testUnWrapLine1Empty()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("aaaa\n"
"\n"
@@ -661,7 +661,7 @@ void ModificationSystemTest::testUnWrapLine1Empty()
void ModificationSystemTest::testUnWrapLine2Empty()
{
- KateDocument *doc = qobject_cast<KateDocument *>(KTextEditor::EditorPrivate::self()->createDocument(0));
+ KTextEditor::DocumentPrivate *doc = qobject_cast<KTextEditor::DocumentPrivate *>(KTextEditor::EditorPrivate::self()->createDocument(0));
const QString content("aaaa\n"
"\n"
diff --git a/autotests/src/movingcursor_test.cpp b/autotests/src/movingcursor_test.cpp
index 2bef034..bc099df 100644
--- a/autotests/src/movingcursor_test.cpp
+++ b/autotests/src/movingcursor_test.cpp
@@ -54,7 +54,7 @@ MovingCursorTest::~MovingCursorTest()
// - MovingCursor with MoveOnInsert
void MovingCursorTest::testMovingCursor()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
MovingCursor *invalid = doc.newMovingCursor(Cursor::invalid());
MovingCursor *moveOnInsert = doc.newMovingCursor(Cursor(0, 0), MovingCursor::MoveOnInsert);
MovingCursor *stayOnInsert = doc.newMovingCursor(Cursor(0, 0), MovingCursor::StayOnInsert);
@@ -124,7 +124,7 @@ void MovingCursorTest::testMovingCursor()
// - gotoPreviousLine
void MovingCursorTest::testConvenienceApi()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("\n"
"1\n"
"22\n"
@@ -184,7 +184,7 @@ void MovingCursorTest::testConvenienceApi()
void MovingCursorTest::testOperators()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("--oo--\n"
"--oo--\n"
"--oo--");
@@ -329,7 +329,7 @@ void MovingCursorTest::testOperators()
void MovingCursorTest::testInvalidMovingCursor()
{
- KateDocument *doc = new KateDocument;
+ KTextEditor::DocumentPrivate *doc = new KTextEditor::DocumentPrivate;
// add invalid MovingCursor. Inserts c into KateBuffer::m_invalidCursors
MovingCursor *c = doc->newMovingCursor(Cursor(-1, -1));
diff --git a/autotests/src/movingrange_test.cpp b/autotests/src/movingrange_test.cpp
index e7cf1ae..0063cad 100644
--- a/autotests/src/movingrange_test.cpp
+++ b/autotests/src/movingrange_test.cpp
@@ -152,7 +152,7 @@ MovingRangeTest::~MovingRangeTest()
// - RangeFeedback::rangeEmpty
void MovingRangeTest::testFeedbackEmptyRange()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// the range created below will span the 'x' characters
QString text("..xxxx\n"
"xxxx..");
@@ -220,7 +220,7 @@ void MovingRangeTest::testFeedbackEmptyRange()
// - RangeFeedback::rangeInvalid
void MovingRangeTest::testFeedbackInvalidRange()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// the range created below will span the 'x' characters
QString text("..xxxx\n"
"xxxx..");
@@ -290,7 +290,7 @@ void MovingRangeTest::testFeedbackInvalidRange()
// - RangeFeedback::caretExitedRange
void MovingRangeTest::testFeedbackCaret()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// the range created below will span the 'x' characters
QString text("..xxxx\n"
"xxxx..");
@@ -406,7 +406,7 @@ void MovingRangeTest::testFeedbackCaret()
// - RangeFeedback::mouseExitedRange
void MovingRangeTest::testFeedbackMouse()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// the range created below will span the 'x' characters
QString text("..xxxx\n"
"xxxx..");
diff --git a/autotests/src/plaintextsearch_test.cpp b/autotests/src/plaintextsearch_test.cpp
index 19bfa58..7953789 100644
--- a/autotests/src/plaintextsearch_test.cpp
+++ b/autotests/src/plaintextsearch_test.cpp
@@ -78,7 +78,7 @@ PlainTextSearchTest::~PlainTextSearchTest()
void PlainTextSearchTest::init()
{
- m_doc = new KateDocument(false, false, 0, this);
+ m_doc = new KTextEditor::DocumentPrivate(false, false, 0, this);
m_search = new KatePlainTextSearch(m_doc, Qt::CaseSensitive, false);
}
diff --git a/autotests/src/plaintextsearch_test.h b/autotests/src/plaintextsearch_test.h
index 33600f6..2c35fbe 100644
--- a/autotests/src/plaintextsearch_test.h
+++ b/autotests/src/plaintextsearch_test.h
@@ -22,7 +22,7 @@
#include <QtCore/QObject>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KatePlainTextSearch;
class PlainTextSearchTest : public QObject
@@ -50,7 +50,7 @@ private Q_SLOTS:
void testMultilineSearch();
private:
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KatePlainTextSearch *m_search;
public:
diff --git a/autotests/src/range_test.cpp b/autotests/src/range_test.cpp
index 84ad0fd..113299b 100644
--- a/autotests/src/range_test.cpp
+++ b/autotests/src/range_test.cpp
@@ -94,7 +94,7 @@ void RangeTest::testTextEditorRange()
void RangeTest::testTextRange()
{
// test text range
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::MovingRange *complexRange = doc.newMovingRange(KTextEditor::Range());
KTextEditor::Range range = *complexRange;
rangeCheck(range);
@@ -103,7 +103,7 @@ void RangeTest::testTextRange()
void RangeTest::testInsertText()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// Multi-line insert
KTextEditor::MovingCursor *cursor1 = doc.newMovingCursor(KTextEditor::Cursor(), KTextEditor::MovingCursor::StayOnInsert);
@@ -129,7 +129,7 @@ void RangeTest::testInsertText()
void RangeTest::testCornerCaseInsertion()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// lock first revision
doc.lockRevision(0);
diff --git a/autotests/src/regexpsearch_test.cpp b/autotests/src/regexpsearch_test.cpp
index d4c8711..8ae4187 100644
--- a/autotests/src/regexpsearch_test.cpp
+++ b/autotests/src/regexpsearch_test.cpp
@@ -245,7 +245,7 @@ void RegExpSearchTest::testAnchoredRegexp()
QFETCH(bool, backwards);
QFETCH(Range, expected);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("fe fe fe");
KateRegExpSearch searcher(&doc, Qt::CaseInsensitive);
@@ -263,7 +263,7 @@ void RegExpSearchTest::testAnchoredRegexp()
void RegExpSearchTest::testSearchForward()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText(" \\piinfercong");
KateRegExpSearch search(&doc, Qt::CaseSensitive);
@@ -274,7 +274,7 @@ void RegExpSearchTest::testSearchForward()
void RegExpSearchTest::testSearchBackwardInSelection()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("foobar foo bar foo bar foo");
KateRegExpSearch search(&doc, Qt::CaseSensitive);
@@ -285,7 +285,7 @@ void RegExpSearchTest::testSearchBackwardInSelection()
void RegExpSearchTest::test()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("\\newcommand{\\piReductionOut}");
KateRegExpSearch search(&doc, Qt::CaseSensitive);
diff --git a/autotests/src/revision_test.cpp b/autotests/src/revision_test.cpp
index 38dc08f..bfde0aa 100644
--- a/autotests/src/revision_test.cpp
+++ b/autotests/src/revision_test.cpp
@@ -68,7 +68,7 @@ RevisionTest::~RevisionTest()
// - transformCursor()
void RevisionTest::testTransformCursor()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
// initial saved revision of unsaved document is -1
QVERIFY(doc.lastSavedRevision() == -1);
@@ -123,7 +123,7 @@ void RevisionTest::testTransformCursor()
// - transformRange()
void RevisionTest::testTransformRange()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
QCOMPARE(doc.revision(), (qint64) 0);
diff --git a/autotests/src/script_test_base.cpp b/autotests/src/script_test_base.cpp
index ae301cc..2997203 100644
--- a/autotests/src/script_test_base.cpp
+++ b/autotests/src/script_test_base.cpp
@@ -58,7 +58,7 @@ void ScriptTestBase::initTestCase()
{
m_msgHandler = qInstallMessageHandler(noDebugMessageOutput);
m_toplevel = new QMainWindow();
- m_document = new KateDocument(true, false, m_toplevel);
+ m_document = new KTextEditor::DocumentPrivate(true, false, m_toplevel);
m_view = static_cast<KTextEditor::ViewPrivate *>(m_document->widget());
m_env = new TestScriptEnv(m_document, m_outputWasCustomised);
}
diff --git a/autotests/src/script_test_base.h b/autotests/src/script_test_base.h
index 79a98df..fa745f3 100644
--- a/autotests/src/script_test_base.h
+++ b/autotests/src/script_test_base.h
@@ -23,7 +23,7 @@
#include <QtCore/QPair>
class TestScriptEnv;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
class QMainWindow;
@@ -40,7 +40,7 @@ protected:
void runTest(const ExpectedFailures &failures);
TestScriptEnv *m_env;
- KateDocument *m_document;
+ KTextEditor::DocumentPrivate *m_document;
QMainWindow *m_toplevel;
bool m_outputWasCustomised;
QStringList m_commands;
diff --git a/autotests/src/scriptdocument_test.cpp b/autotests/src/scriptdocument_test.cpp
index f783cc4..7060071 100644
--- a/autotests/src/scriptdocument_test.cpp
+++ b/autotests/src/scriptdocument_test.cpp
@@ -78,7 +78,7 @@ ScriptDocumentTest::~ScriptDocumentTest()
void ScriptDocumentTest::init()
{
- m_doc = new KateDocument;
+ m_doc = new KTextEditor::DocumentPrivate;
m_view = m_doc->createView(0);
m_scriptDoc = new KateScriptDocument(this);
m_scriptDoc->setDocument(m_doc);
diff --git a/autotests/src/scriptdocument_test.h b/autotests/src/scriptdocument_test.h
index 3fbac4a..3e68408 100644
--- a/autotests/src/scriptdocument_test.h
+++ b/autotests/src/scriptdocument_test.h
@@ -27,7 +27,7 @@ namespace KTextEditor
class View;
}
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateScriptDocument;
class ScriptDocumentTest : public QObject
@@ -49,7 +49,7 @@ private Q_SLOTS:
void testRfind();
private:
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KTextEditor::View *m_view;
KateScriptDocument *m_scriptDoc;
diff --git a/autotests/src/searchbar_test.cpp b/autotests/src/searchbar_test.cpp
index 491d8cf..5df75e4 100644
--- a/autotests/src/searchbar_test.cpp
+++ b/autotests/src/searchbar_test.cpp
@@ -71,7 +71,7 @@ void SearchBarTest::cleanupTestCase()
void SearchBarTest::testFindNextIncremental()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
doc.setText("a a a b b");
KTextEditor::ViewPrivate view(&doc, 0);
@@ -106,7 +106,7 @@ void SearchBarTest::testFindNextIncremental()
void SearchBarTest::testSetMatchCaseIncremental()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -140,7 +140,7 @@ void SearchBarTest::testSetMatchCaseIncremental()
void SearchBarTest::testSetMatchCasePower()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -181,7 +181,7 @@ void SearchBarTest::testSetMatchCasePower()
void SearchBarTest::testSetSelectionOnlyPower()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -230,7 +230,7 @@ void SearchBarTest::testSetSearchPattern()
QFETCH(bool, power);
QFETCH(int, numMatches2);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -254,7 +254,7 @@ void SearchBarTest::testSetSearchPattern()
void SearchBarTest::testSetSelectionOnly()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -290,7 +290,7 @@ void SearchBarTest::testFindAll()
QFETCH(int, numMatches2);
QFETCH(int, numMatches4);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -326,7 +326,7 @@ void SearchBarTest::testFindAll()
void SearchBarTest::testReplaceAll()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -381,7 +381,7 @@ void SearchBarTest::testFindSelectionForward()
QFETCH(Range, selectionRange);
QFETCH(Range, match);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -418,7 +418,7 @@ void SearchBarTest::testRemoveWithSelectionForward()
QFETCH(Range, selectionRange);
QFETCH(Range, match);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -452,7 +452,7 @@ void SearchBarTest::testRemoveInSelectionForward()
QFETCH(Range, selectionRange);
QFETCH(Range, match);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -497,7 +497,7 @@ void SearchBarTest::testReplaceWithDoubleSelecion()
QFETCH(QString, result);
QFETCH(Range, match);
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -516,7 +516,7 @@ void SearchBarTest::testReplaceWithDoubleSelecion()
void SearchBarTest::testReplaceDollar()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
@@ -535,7 +535,7 @@ void SearchBarTest::testReplaceDollar()
void SearchBarTest::testSearchHistoryIncremental()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig *const config = view.config();
config->patternHistoryModel()->setStringList(QStringList());
@@ -555,7 +555,7 @@ void SearchBarTest::testSearchHistoryIncremental()
QCOMPARE(bar.m_incUi->pattern->findText("bar"), 0);
QCOMPARE(bar.m_incUi->pattern->findText("foo"), 1);
- KateDocument doc2;
+ KTextEditor::DocumentPrivate doc2;
KTextEditor::ViewPrivate view2(&doc2, 0);
KateViewConfig *const config2 = view2.config();
KateSearchBar bar2(false, &view2, config2);
@@ -572,7 +572,7 @@ void SearchBarTest::testSearchHistoryIncremental()
void SearchBarTest::testSearchHistoryPower()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig *const config = view.config();
config->patternHistoryModel()->setStringList(QStringList());
@@ -600,7 +600,7 @@ void SearchBarTest::testSearchHistoryPower()
QCOMPARE(bar.m_powerUi->pattern->findText("foo"), 1);
QCOMPARE(bar.m_powerUi->pattern->count(), 2);
- KateDocument doc2;
+ KTextEditor::DocumentPrivate doc2;
KTextEditor::ViewPrivate view2(&doc2, 0);
KateViewConfig *const config2 = view2.config();
KateSearchBar bar2(true, &view2, config2);
@@ -612,7 +612,7 @@ void SearchBarTest::testSearchHistoryPower()
// Make sure Kate doesn't replace anything outside selection in block mode (see bug 253191)
void SearchBarTest::testReplaceInBlockMode()
{
- KateDocument doc;
+ KTextEditor::DocumentPrivate doc;
KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
diff --git a/autotests/src/templatehandler_test.cpp b/autotests/src/templatehandler_test.cpp
index ceda254..e8af2d6 100644
--- a/autotests/src/templatehandler_test.cpp
+++ b/autotests/src/templatehandler_test.cpp
@@ -38,7 +38,7 @@ void TemplateHandlerTest::testUndo()
initialValues.insert("type", "int");
initialValues.insert("index", "i");
- KateDocument doc(false, false, 0, this);
+ KTextEditor::DocumentPrivate doc(false, false, 0, this);
KTextEditor::ViewPrivate view(&doc, 0);
view.insertTemplateTextImplementation(Cursor(0, 0), snippet, initialValues, 0);
diff --git a/autotests/src/testutils.cpp b/autotests/src/testutils.cpp
index c197038..06c22bf 100644
--- a/autotests/src/testutils.cpp
+++ b/autotests/src/testutils.cpp
@@ -77,7 +77,7 @@ static void rangeFromScriptValue(const QScriptValue &obj, KTextEditor::Range &ra
}
//END
-TestScriptEnv::TestScriptEnv(KateDocument *part, bool &cflag)
+TestScriptEnv::TestScriptEnv(KTextEditor::DocumentPrivate *part, bool &cflag)
: m_engine(0), m_viewObj(0), m_docObj(0), m_output(0)
{
m_engine = new QScriptEngine(this);
@@ -227,7 +227,7 @@ ALIAS(shiftWordNext, shiftWordRight)
//BEGIN KateDocumentObject
-KateDocumentObject::KateDocumentObject(KateDocument *doc)
+KateDocumentObject::KateDocumentObject(KTextEditor::DocumentPrivate *doc)
: KateScriptDocument()
{
setDocument(doc);
diff --git a/autotests/src/testutils.h b/autotests/src/testutils.h
index 00e80b0..e88006c 100644
--- a/autotests/src/testutils.h
+++ b/autotests/src/testutils.h
@@ -42,7 +42,7 @@ class KateDocumentObject;
class TestScriptEnv : public QObject
{
public:
- explicit TestScriptEnv(KateDocument *part, bool &cflag);
+ explicit TestScriptEnv(KTextEditor::DocumentPrivate *part, bool &cflag);
virtual ~TestScriptEnv();
QScriptEngine *engine() const
@@ -149,7 +149,7 @@ class KateDocumentObject : public KateScriptDocument
Q_OBJECT
public:
- explicit KateDocumentObject(KateDocument *doc);
+ explicit KateDocumentObject(KTextEditor::DocumentPrivate *doc);
virtual ~KateDocumentObject();
private:
diff --git a/autotests/src/undomanager_test.cpp b/autotests/src/undomanager_test.cpp
index 420fd05..8b701d9 100644
--- a/autotests/src/undomanager_test.cpp
+++ b/autotests/src/undomanager_test.cpp
@@ -30,11 +30,11 @@ QTEST_MAIN(UndoManagerTest)
using namespace KTextEditor;
-class UndoManagerTest::TestDocument : public KateDocument
+class UndoManagerTest::TestDocument : public KTextEditor::DocumentPrivate
{
public:
TestDocument()
- : KateDocument(false, false, 0, 0)
+ : KTextEditor::DocumentPrivate(false, false, 0, 0)
{}
};
diff --git a/autotests/src/vimode_test.cpp b/autotests/src/vimode_test.cpp
index 0b4824d..c0c8756 100644
--- a/autotests/src/vimode_test.cpp
+++ b/autotests/src/vimode_test.cpp
@@ -295,7 +295,7 @@ void ViModeTest::init()
delete kate_view;
delete kate_document;
- kate_document = new KateDocument(false, false, 0, NULL);
+ kate_document = new KTextEditor::DocumentPrivate(false, false, 0, NULL);
kate_view = new KTextEditor::ViewPrivate(kate_document, mainWindow);
mainWindowLayout->addWidget(kate_view);
kate_view->config()->setViInputMode(true);
diff --git a/autotests/src/vimode_test.h b/autotests/src/vimode_test.h
index 9177e86..c871e0a 100644
--- a/autotests/src/vimode_test.h
+++ b/autotests/src/vimode_test.h
@@ -186,7 +186,7 @@ private:
const QString &failureReason = QString()
);
- KateDocument *kate_document;
+ KTextEditor::DocumentPrivate *kate_document;
KTextEditor::ViewPrivate *kate_view;
QMainWindow *mainWindow;
QVBoxLayout *mainWindowLayout;
diff --git a/src/buffer/katetextbuffer.cpp b/src/buffer/katetextbuffer.cpp
index 11d5d1b..60fe0ca 100644
--- a/src/buffer/katetextbuffer.cpp
+++ b/src/buffer/katetextbuffer.cpp
@@ -43,7 +43,7 @@
namespace Kate
{
-TextBuffer::TextBuffer(KateDocument *parent, int blockSize)
+TextBuffer::TextBuffer(KTextEditor::DocumentPrivate *parent, int blockSize)
: QObject(parent)
, m_document(parent)
, m_history(*this)
diff --git a/src/buffer/katetextbuffer.h b/src/buffer/katetextbuffer.h
index d2a71db..264c479 100644
--- a/src/buffer/katetextbuffer.h
+++ b/src/buffer/katetextbuffer.h
@@ -71,7 +71,7 @@ public:
* @param parent parent qobject
* @param blockSize block size in lines the buffer should try to hold, default 64 lines
*/
- TextBuffer(KateDocument *parent, int blockSize = 64);
+ TextBuffer(KTextEditor::DocumentPrivate *parent, int blockSize = 64);
/**
* Destruct the text buffer
@@ -475,7 +475,7 @@ public:
* Gets the document to which this buffer is bound.
* \return a pointer to the document
*/
- KateDocument *document() const
+ KTextEditor::DocumentPrivate *document() const
{
return m_document;
}
@@ -515,7 +515,7 @@ public:
public:
/**
* md5 digest of the document on disk, set either through file loading
- * in openFile() or in KateDocument::saveFile()
+ * in openFile() or in KTextEditor::DocumentPrivate::saveFile()
* @return md5 digest for this document
*/
const QByteArray &digest() const;
@@ -534,7 +534,7 @@ private:
/**
* parent document
*/
- KateDocument *m_document;
+ KTextEditor::DocumentPrivate *m_document;
/**
* text history
diff --git a/src/completion/katecompletiondelegate.cpp b/src/completion/katecompletiondelegate.cpp
index c1398f1..83ba958 100644
--- a/src/completion/katecompletiondelegate.cpp
+++ b/src/completion/katecompletiondelegate.cpp
@@ -68,7 +68,7 @@ KateCompletionWidget *KateCompletionDelegate::widget() const
return static_cast<KateCompletionWidget *>(const_cast<QObject *>(parent()));
}
-KateDocument *KateCompletionDelegate::document() const
+KTextEditor::DocumentPrivate *KateCompletionDelegate::document() const
{
return widget()->view()->doc();
}
diff --git a/src/completion/katecompletiondelegate.h b/src/completion/katecompletiondelegate.h
index 6260866..0935df7 100644
--- a/src/completion/katecompletiondelegate.h
+++ b/src/completion/katecompletiondelegate.h
@@ -24,7 +24,7 @@
#include "expandingtree/expandingdelegate.h"
class KateRenderer;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateCompletionWidget;
class KateCompletionDelegate : public ExpandingDelegate
@@ -34,7 +34,7 @@ public:
KateRenderer *renderer() const;
KateCompletionWidget *widget() const;
- KateDocument *document() const;
+ KTextEditor::DocumentPrivate *document() const;
protected:
virtual void adjustStyle(const QModelIndex &index, QStyleOptionViewItem &option) const;
mutable int m_cachedRow;
diff --git a/src/completion/katewordcompletion.cpp b/src/completion/katewordcompletion.cpp
index f7c0f97..7427d0b 100644
--- a/src/completion/katewordcompletion.cpp
+++ b/src/completion/katewordcompletion.cpp
@@ -324,7 +324,7 @@ KateWordCompletionView::KateWordCompletionView(KTextEditor::View *view, KActionC
d->isCompleting = false;
d->dcRange = KTextEditor::Range::invalid();
- d->liRange = static_cast<KateDocument *>(m_view->document())->newMovingRange(KTextEditor::Range::invalid(), KTextEditor::MovingRange::DoNotExpand);
+ d->liRange = static_cast<KTextEditor::DocumentPrivate *>(m_view->document())->newMovingRange(KTextEditor::Range::invalid(), KTextEditor::MovingRange::DoNotExpand);
KColorScheme colors(QPalette::Active);
KTextEditor::Attribute::Ptr a = KTextEditor::Attribute::Ptr(new KTextEditor::Attribute());
diff --git a/src/dialogs/katedialogs.cpp b/src/dialogs/katedialogs.cpp
index f542218..a22f9d7 100644
--- a/src/dialogs/katedialogs.cpp
+++ b/src/dialogs/katedialogs.cpp
@@ -526,7 +526,7 @@ void KateSpellCheckConfigTab::apply()
KateDocumentConfig::global()->configStart();
m_sonnetConfigWidget->save();
KateDocumentConfig::global()->configEnd();
- foreach (KateDocument *doc, KTextEditor::EditorPrivate::self()->kateDocuments()) {
+ foreach (KTextEditor::DocumentPrivate *doc, KTextEditor::EditorPrivate::self()->kateDocuments()) {
doc->refreshOnTheFlyCheck();
}
}
@@ -1389,7 +1389,7 @@ KateDictionaryBar::KateDictionaryBar(KTextEditor::ViewPrivate *view, QWidget *pa
m_dictionaryComboBox = new Sonnet::DictionaryComboBox(centralWidget());
connect(m_dictionaryComboBox, SIGNAL(dictionaryChanged(QString)),
this, SLOT(dictionaryChanged(QString)));
- connect(view->doc(), SIGNAL(defaultDictionaryChanged(KateDocument*)),
+ connect(view->doc(), SIGNAL(defaultDictionaryChanged(KTextEditor::DocumentPrivate*)),
this, SLOT(updateData()));
QLabel *label = new QLabel(i18n("Dictionary:"), centralWidget());
label->setBuddy(m_dictionaryComboBox);
@@ -1406,7 +1406,7 @@ KateDictionaryBar::~KateDictionaryBar()
void KateDictionaryBar::updateData()
{
- KateDocument *document = m_view->doc();
+ KTextEditor::DocumentPrivate *document = m_view->doc();
QString dictionary = document->defaultDictionary();
if (dictionary.isEmpty()) {
dictionary = Sonnet::Speller().defaultLanguage();
@@ -1427,7 +1427,7 @@ void KateDictionaryBar::dictionaryChanged(const QString &dictionary)
//END KateGotoBar
//BEGIN KateModOnHdPrompt
-KateModOnHdPrompt::KateModOnHdPrompt(KateDocument *doc,
+KateModOnHdPrompt::KateModOnHdPrompt(KTextEditor::DocumentPrivate *doc,
KTextEditor::ModificationInterface::ModifiedOnDiskReason modtype,
const QString &reason,
QWidget *parent)
diff --git a/src/dialogs/katedialogs.h b/src/dialogs/katedialogs.h
index b336ca5..589f0ab 100644
--- a/src/dialogs/katedialogs.h
+++ b/src/dialogs/katedialogs.h
@@ -44,7 +44,7 @@
#include <QTreeWidget>
class ModeConfigPage;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
namespace KIO
@@ -376,7 +376,7 @@ public:
Overwrite,
Ignore
};
- KateModOnHdPrompt(KateDocument *doc,
+ KateModOnHdPrompt(KTextEditor::DocumentPrivate *doc,
KTextEditor::ModificationInterface::ModifiedOnDiskReason modtype,
const QString &reason, QWidget *parent);
~KateModOnHdPrompt();
@@ -398,7 +398,7 @@ private Q_SLOTS:
private:
Ui::ModOnHdWidget *ui;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KTextEditor::ModificationInterface::ModifiedOnDiskReason m_modtype;
KProcess *m_proc;
QTemporaryFile *m_diffFile;
diff --git a/src/document/katebuffer.cpp b/src/document/katebuffer.cpp
index cb903f5..4d04786 100644
--- a/src/document/katebuffer.cpp
+++ b/src/document/katebuffer.cpp
@@ -46,7 +46,7 @@ static const int KATE_MAX_DYNAMIC_CONTEXTS = 512;
/**
* Create an empty buffer. (with one block with one empty line)
*/
-KateBuffer::KateBuffer(KateDocument *doc)
+KateBuffer::KateBuffer(KTextEditor::DocumentPrivate *doc)
: Kate::TextBuffer(doc),
m_doc(doc),
m_brokenEncoding(false),
@@ -386,7 +386,7 @@ void KateBuffer::doHighlight(int startLine, int endLine, bool invalidate)
// avoid recursive invalidation
KateHlManager::self()->setForceNoDCReset(true);
- foreach (KateDocument *doc, KTextEditor::EditorPrivate::self()->kateDocuments()) {
+ foreach (KTextEditor::DocumentPrivate *doc, KTextEditor::EditorPrivate::self()->kateDocuments()) {
doc->makeAttribs();
}
diff --git a/src/document/katebuffer.h b/src/document/katebuffer.h
index df9fcd1..c1af056 100644
--- a/src/document/katebuffer.h
+++ b/src/document/katebuffer.h
@@ -28,7 +28,7 @@
#include <QObject>
class KateLineInfo;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateHighlighting;
/**
@@ -46,7 +46,7 @@ public:
* Create an empty buffer.
* @param doc parent document
*/
- explicit KateBuffer(KateDocument *doc);
+ explicit KateBuffer(KTextEditor::DocumentPrivate *doc);
/**
* Goodbye buffer
@@ -249,7 +249,7 @@ private:
/**
* document we belong to
*/
- KateDocument *const m_doc;
+ KTextEditor::DocumentPrivate *const m_doc;
/**
* file loaded with encoding problems?
diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp
index f1b70a5..02059a3 100644
--- a/src/document/katedocument.cpp
+++ b/src/document/katedocument.cpp
@@ -101,12 +101,12 @@ inline bool isBracket(const QChar &c)
//BEGIN d'tor, c'tor
//
-// KateDocument Constructor
+// KTextEditor::DocumentPrivate Constructor
//
-KateDocument::KateDocument(bool bSingleViewMode,
+KTextEditor::DocumentPrivate::DocumentPrivate(bool bSingleViewMode,
bool bReadOnly, QWidget *parentWidget,
QObject *parent)
- : KTextEditor::Document(parent),
+ : KTextEditor::Document (this, parent),
m_bSingleViewMode(bSingleViewMode),
m_bReadOnly(bReadOnly),
m_activeView(0),
@@ -214,9 +214,9 @@ KateDocument::KateDocument(bool bSingleViewMode,
}
//
-// KateDocument Destructor
+// KTextEditor::DocumentPrivate Destructor
//
-KateDocument::~KateDocument()
+KTextEditor::DocumentPrivate::~DocumentPrivate()
{
/**
* we are about to delete cursors/ranges/...
@@ -258,7 +258,7 @@ KateDocument::~KateDocument()
//END
// on-demand view creation
-QWidget *KateDocument::widget()
+QWidget *KTextEditor::DocumentPrivate::widget()
{
// no singleViewMode -> no widget()...
if (!singleViewMode()) {
@@ -279,7 +279,7 @@ QWidget *KateDocument::widget()
//BEGIN KTextEditor::Document stuff
-KTextEditor::View *KateDocument::createView(QWidget *parent, KTextEditor::MainWindow *mainWindow)
+KTextEditor::View *KTextEditor::DocumentPrivate::createView(QWidget *parent, KTextEditor::MainWindow *mainWindow)
{
KTextEditor::ViewPrivate *newView = new KTextEditor::ViewPrivate(this, parent, mainWindow);
if (m_fileChangedDialogsActivated) {
@@ -298,12 +298,12 @@ KTextEditor::View *KateDocument::createView(QWidget *parent, KTextEditor::MainWi
return newView;
}
-const QList<KTextEditor::View *> &KateDocument::views() const
+const QList<KTextEditor::View *> &KTextEditor::DocumentPrivate::views() const
{
return m_textEditViews;
}
-KTextEditor::Range KateDocument::rangeOnLine(KTextEditor::Range range, int line) const
+KTextEditor::Range KTextEditor::DocumentPrivate::rangeOnLine(KTextEditor::Range range, int line) const
{
int col1 = toVirtualColumn(range.start());
int col2 = toVirtualColumn(range.end());
@@ -316,12 +316,12 @@ KTextEditor::Range KateDocument::rangeOnLine(KTextEditor::Range range, int line)
//BEGIN KTextEditor::EditInterface stuff
-QString KateDocument::text() const
+QString KTextEditor::DocumentPrivate::text() const
{
return m_buffer->text();
}
-QString KateDocument::text(const KTextEditor::Range &range, bool blockwise) const
+QString KTextEditor::DocumentPrivate::text(const KTextEditor::Range &range, bool blockwise) const
{
if (!range.isValid()) {
qCWarning(LOG_PART) << "Text requested for invalid range" << range;
@@ -369,7 +369,7 @@ QString KateDocument::text(const KTextEditor::Range &range, bool blockwise) cons
return s;
}
-QChar KateDocument::characterAt(const KTextEditor::Cursor &position) const
+QChar KTextEditor::DocumentPrivate::characterAt(const KTextEditor::Cursor &position) const
{
Kate::TextLine textLine = m_buffer->plainLine(position.line());
@@ -380,12 +380,12 @@ QChar KateDocument::characterAt(const KTextEditor::Cursor &position) const
return textLine->at(position.column());
}
-QString KateDocument::wordAt(const KTextEditor::Cursor &cursor) const
+QString KTextEditor::DocumentPrivate::wordAt(const KTextEditor::Cursor &cursor) const
{
return text(wordRangeAt(cursor));
}
-KTextEditor::Range KateDocument::wordRangeAt(const KTextEditor::Cursor &cursor) const
+KTextEditor::Range KTextEditor::DocumentPrivate::wordRangeAt(const KTextEditor::Cursor &cursor) const
{
// get text line
const int line = cursor.line();
@@ -413,7 +413,7 @@ KTextEditor::Range KateDocument::wordRangeAt(const KTextEditor::Cursor &cursor)
return KTextEditor::Range(line, start, line, end);
}
-QStringList KateDocument::textLines(const KTextEditor::Range &range, bool blockwise) const
+QStringList KTextEditor::DocumentPrivate::textLines(const KTextEditor::Range &range, bool blockwise) const
{
QStringList ret;
@@ -458,7 +458,7 @@ QStringList KateDocument::textLines(const KTextEditor::Range &range, bool blockw
return ret;
}
-QString KateDocument::line(int line) const
+QString KTextEditor::DocumentPrivate::line(int line) const
{
Kate::TextLine l = m_buffer->plainLine(line);
@@ -469,7 +469,7 @@ QString KateDocument::line(int line) const
return l->string();
}
-bool KateDocument::setText(const QString &s)
+bool KTextEditor::DocumentPrivate::setText(const QString &s)
{
if (!isReadWrite()) {
return false;
@@ -498,7 +498,7 @@ bool KateDocument::setText(const QString &s)
return true;
}
-bool KateDocument::setText(const QStringList &text)
+bool KTextEditor::DocumentPrivate::setText(const QStringList &text)
{
if (!isReadWrite()) {
return false;
@@ -527,7 +527,7 @@ bool KateDocument::setText(const QStringList &text)
return true;
}
-bool KateDocument::clear()
+bool KTextEditor::DocumentPrivate::clear()
{
if (!isReadWrite()) {
return false;
@@ -549,7 +549,7 @@ bool KateDocument::clear()
return editRemoveLines(0, lastLine());
}
-bool KateDocument::insertText(const KTextEditor::Cursor &position, const QString &text, bool block)
+bool KTextEditor::DocumentPrivate::insertText(const KTextEditor::Cursor &position, const QString &text, bool block)
{
if (!isReadWrite()) {
return false;
@@ -643,7 +643,7 @@ bool KateDocument::insertText(const KTextEditor::Cursor &position, const QString
return true;
}
-bool KateDocument::insertText(const KTextEditor::Cursor &position, const QStringList &textLines, bool block)
+bool KTextEditor::DocumentPrivate::insertText(const KTextEditor::Cursor &position, const QStringList &textLines, bool block)
{
if (!isReadWrite()) {
return false;
@@ -653,7 +653,7 @@ bool KateDocument::insertText(const KTextEditor::Cursor &position, const QString
return insertText(position, textLines.join(QLatin1String("\n")), block);
}
-bool KateDocument::removeText(const KTextEditor::Range &_range, bool block)
+bool KTextEditor::DocumentPrivate::removeText(const KTextEditor::Range &_range, bool block)
{
KTextEditor::Range range = _range;
@@ -720,7 +720,7 @@ bool KateDocument::removeText(const KTextEditor::Range &_range, bool block)
return true;
}
-bool KateDocument::insertLine(int l, const QString &str)
+bool KTextEditor::DocumentPrivate::insertLine(int l, const QString &str)
{
if (!isReadWrite()) {
return false;
@@ -733,7 +733,7 @@ bool KateDocument::insertLine(int l, const QString &str)
return editInsertLine(l, str);
}
-bool KateDocument::insertLines(int line, const QStringList &text)
+bool KTextEditor::DocumentPrivate::insertLines(int line, const QStringList &text)
{
if (!isReadWrite()) {
return false;
@@ -751,7 +751,7 @@ bool KateDocument::insertLines(int line, const QStringList &text)
return success;
}
-bool KateDocument::removeLine(int line)
+bool KTextEditor::DocumentPrivate::removeLine(int line)
{
if (!isReadWrite()) {
return false;
@@ -764,7 +764,7 @@ bool KateDocument::removeLine(int line)
return editRemoveLine(line);
}
-int KateDocument::totalCharacters() const
+int KTextEditor::DocumentPrivate::totalCharacters() const
{
int l = 0;
@@ -779,12 +779,12 @@ int KateDocument::totalCharacters() const
return l;
}
-int KateDocument::lines() const
+int KTextEditor::DocumentPrivate::lines() const
{
return m_buffer->count();
}
-int KateDocument::lineLength(int line) const
+int KTextEditor::DocumentPrivate::lineLength(int line) const
{
if (line < 0 || line > lastLine()) {
return -1;
@@ -804,7 +804,7 @@ int KateDocument::lineLength(int line) const
//
// Starts an edit session with (or without) undo, update of view disabled during session
//
-void KateDocument::editStart()
+void KTextEditor::DocumentPrivate::editStart()
{
editSessionNumber++;
@@ -826,7 +826,7 @@ void KateDocument::editStart()
//
// End edit session and update Views
//
-void KateDocument::editEnd()
+void KTextEditor::DocumentPrivate::editEnd()
{
if (editSessionNumber == 0) {
Q_ASSERT(0);
@@ -864,12 +864,12 @@ void KateDocument::editEnd()
editIsRunning = false;
}
-void KateDocument::pushEditState()
+void KTextEditor::DocumentPrivate::pushEditState()
{
editStateStack.push(editSessionNumber);
}
-void KateDocument::popEditState()
+void KTextEditor::DocumentPrivate::popEditState()
{
if (editStateStack.isEmpty()) {
return;
@@ -886,17 +886,17 @@ void KateDocument::popEditState()
}
}
-void KateDocument::inputMethodStart()
+void KTextEditor::DocumentPrivate::inputMethodStart()
{
m_undoManager->inputMethodStart();
}
-void KateDocument::inputMethodEnd()
+void KTextEditor::DocumentPrivate::inputMethodEnd()
{
m_undoManager->inputMethodEnd();
}
-bool KateDocument::wrapText(int startLine, int endLine)
+bool KTextEditor::DocumentPrivate::wrapText(int startLine, int endLine)
{
if (startLine < 0 || endLine < 0) {
return false;
@@ -1015,7 +1015,7 @@ bool KateDocument::wrapText(int startLine, int endLine)
return true;
}
-bool KateDocument::editInsertText(int line, int col, const QString &s)
+bool KTextEditor::DocumentPrivate::editInsertText(int line, int col, const QString &s)
{
// verbose debug
EDIT_DEBUG << "editInsertText" << line << col << s;
@@ -1060,7 +1060,7 @@ bool KateDocument::editInsertText(int line, int col, const QString &s)
return true;
}
-bool KateDocument::editRemoveText(int line, int col, int len)
+bool KTextEditor::DocumentPrivate::editRemoveText(int line, int col, int len)
{
// verbose debug
EDIT_DEBUG << "editRemoveText" << line << col << len;
@@ -1109,7 +1109,7 @@ bool KateDocument::editRemoveText(int line, int col, int len)
return true;
}
-bool KateDocument::editMarkLineAutoWrapped(int line, bool autowrapped)
+bool KTextEditor::DocumentPrivate::editMarkLineAutoWrapped(int line, bool autowrapped)
{
// verbose debug
EDIT_DEBUG << "editMarkLineAutoWrapped" << line << autowrapped;
@@ -1139,7 +1139,7 @@ bool KateDocument::editMarkLineAutoWrapped(int line, bool autowrapped)
return true;
}
-bool KateDocument::editWrapLine(int line, int col, bool newLine, bool *newLineAdded)
+bool KTextEditor::DocumentPrivate::editWrapLine(int line, int col, bool newLine, bool *newLineAdded)
{
// verbose debug
EDIT_DEBUG << "editWrapLine" << line << col << newLine;
@@ -1211,7 +1211,7 @@ bool KateDocument::editWrapLine(int line, int col, bool newLine, bool *newLineAd
return true;
}
-bool KateDocument::editUnWrapLine(int line, bool removeLine, int length)
+bool KTextEditor::DocumentPrivate::editUnWrapLine(int line, bool removeLine, int length)
{
// verbose debug
EDIT_DEBUG << "editUnWrapLine" << line << removeLine << length;
@@ -1280,7 +1280,7 @@ bool KateDocument::editUnWrapLine(int line, bool removeLine, int length)
return true;
}
-bool KateDocument::editInsertLine(int line, const QString &s)
+bool KTextEditor::DocumentPrivate::editInsertLine(int line, const QString &s)
{
// verbose debug
EDIT_DEBUG << "editInsertLine" << line << s;
@@ -1350,12 +1350,12 @@ bool KateDocument::editInsertLine(int line, const QString &s)
return true;
}
-bool KateDocument::editRemoveLine(int line)
+bool KTextEditor::DocumentPrivate::editRemoveLine(int line)
{
return editRemoveLines(line, line);
}
-bool KateDocument::editRemoveLines(int from, int to)
+bool KTextEditor::DocumentPrivate::editRemoveLines(int from, int to)
{
// verbose debug
EDIT_DEBUG << "editRemoveLines" << from << to;
@@ -1446,29 +1446,29 @@ bool KateDocument::editRemoveLines(int from, int to)
//END
//BEGIN KTextEditor::UndoInterface stuff
-uint KateDocument::undoCount() const
+uint KTextEditor::DocumentPrivate::undoCount() const
{
return m_undoManager->undoCount();
}
-uint KateDocument::redoCount() const
+uint KTextEditor::DocumentPrivate::redoCount() const
{
return m_undoManager->redoCount();
}
-void KateDocument::undo()
+void KTextEditor::DocumentPrivate::undo()
{
m_undoManager->undo();
}
-void KateDocument::redo()
+void KTextEditor::DocumentPrivate::redo()
{
m_undoManager->redo();
}
//END
//BEGIN KTextEditor::SearchInterface stuff
-QVector<KTextEditor::Range> KateDocument::searchText(
+QVector<KTextEditor::Range> KTextEditor::DocumentPrivate::searchText(
const KTextEditor::Range &range,
const QString &pattern,
const KTextEditor::Search::SearchOptions options)
@@ -1509,7 +1509,7 @@ QVector<KTextEditor::Range> KateDocument::searchText(
return result;
}
-KTextEditor::Search::SearchOptions KateDocument::supportedSearchOptions() const
+KTextEditor::Search::SearchOptions KTextEditor::DocumentPrivate::supportedSearchOptions() const
{
KTextEditor::Search::SearchOptions supported(KTextEditor::Search::Default);
supported |= KTextEditor::Search::Regex;
@@ -1523,7 +1523,7 @@ KTextEditor::Search::SearchOptions KateDocument::supportedSearchOptions() const
}
//END
-QWidget *KateDocument::dialogParent()
+QWidget *KTextEditor::DocumentPrivate::dialogParent()
{
QWidget *w = widget();
@@ -1539,18 +1539,18 @@ QWidget *KateDocument::dialogParent()
}
//BEGIN KTextEditor::HighlightingInterface stuff
-bool KateDocument::setMode(const QString &name)
+bool KTextEditor::DocumentPrivate::setMode(const QString &name)
{
updateFileType(name);
return true;
}
-QString KateDocument::mode() const
+QString KTextEditor::DocumentPrivate::mode() const
{
return m_fileType;
}
-QStringList KateDocument::modes() const
+QStringList KTextEditor::DocumentPrivate::modes() const
{
QStringList m;
@@ -1562,7 +1562,7 @@ QStringList KateDocument::modes() const
return m;
}
-bool KateDocument::setHighlightingMode(const QString &name)
+bool KTextEditor::DocumentPrivate::setHighlightingMode(const QString &name)
{
int mode = KateHlManager::self()->nameFind(name);
if (mode == -1) {
@@ -1572,12 +1572,12 @@ bool KateDocument::setHighlightingMode(const QString &name)
return true;
}
-QString KateDocument::highlightingMode() const
+QString KTextEditor::DocumentPrivate::highlightingMode() const
{
return highlight()->name();
}
-QStringList KateDocument::highlightingModes() const
+QStringList KTextEditor::DocumentPrivate::highlightingModes() const
{
QStringList hls;
@@ -1588,17 +1588,17 @@ QStringList KateDocument::highlightingModes() const
return hls;
}
-QString KateDocument::highlightingModeSection(int index) const
+QString KTextEditor::DocumentPrivate::highlightingModeSection(int index) const
{
return KateHlManager::self()->hlSection(index);
}
-QString KateDocument::modeSection(int index) const
+QString KTextEditor::DocumentPrivate::modeSection(int index) const
{
return KTextEditor::EditorPrivate::self()->modeManager()->list().at(index)->section;
}
-void KateDocument::bufferHlChanged()
+void KTextEditor::DocumentPrivate::bufferHlChanged()
{
// update all views
makeAttribs(false);
@@ -1609,24 +1609,24 @@ void KateDocument::bufferHlChanged()
emit highlightingModeChanged(this);
}
-void KateDocument::setDontChangeHlOnSave()
+void KTextEditor::DocumentPrivate::setDontChangeHlOnSave()
{
m_hlSetByUser = true;
}
-void KateDocument::bomSetByUser()
+void KTextEditor::DocumentPrivate::bomSetByUser()
{
m_bomSetByUser = true;
}
//END
//BEGIN KTextEditor::SessionConfigInterface and KTextEditor::ParameterizedSessionConfigInterface stuff
-void KateDocument::readSessionConfig(const KConfigGroup &kconfig)
+void KTextEditor::DocumentPrivate::readSessionConfig(const KConfigGroup &kconfig)
{
readParameterizedSessionConfig(kconfig, SkipNone);
}
-void KateDocument::readParameterizedSessionConfig(const KConfigGroup &kconfig,
+void KTextEditor::DocumentPrivate::readParameterizedSessionConfig(const KConfigGroup &kconfig,
unsigned long configParameters)
{
if (!(configParameters & KTextEditor::ParameterizedSessionConfigInterface::SkipEncoding)) {
@@ -1674,16 +1674,16 @@ void KateDocument::readParameterizedSessionConfig(const KConfigGroup &kconfig,
// Restore Bookmarks
const QList<int> marks = kconfig.readEntry("Bookmarks", QList<int>());
for (int i = 0; i < marks.count(); i++) {
- addMark(marks.at(i), KateDocument::markType01);
+ addMark(marks.at(i), KTextEditor::DocumentPrivate::markType01);
}
}
-void KateDocument::writeSessionConfig(KConfigGroup &kconfig)
+void KTextEditor::DocumentPrivate::writeSessionConfig(KConfigGroup &kconfig)
{
writeParameterizedSessionConfig(kconfig, SkipNone);
}
-void KateDocument::writeParameterizedSessionConfig(KConfigGroup &kconfig,
+void KTextEditor::DocumentPrivate::writeParameterizedSessionConfig(KConfigGroup &kconfig,
unsigned long configParameters)
{
if (this->url().isLocalFile()) {
@@ -1728,7 +1728,7 @@ void KateDocument::writeParameterizedSessionConfig(KConfigGroup &kconfig,
//END KTextEditor::SessionConfigInterface and KTextEditor::ParameterizedSessionConfigInterface stuff
-uint KateDocument::mark(int line)
+uint KTextEditor::DocumentPrivate::mark(int line)
{
KTextEditor::Mark *m = m_marks.value(line);
if (!m) {
@@ -1738,13 +1738,13 @@ uint KateDocument::mark(int line)
return m->type;
}
-void KateDocument::setMark(int line, uint markType)
+void KTextEditor::DocumentPrivate::setMark(int line, uint markType)
{
clearMark(line);
addMark(line, markType);
}
-void KateDocument::clearMark(int line)
+void KTextEditor::DocumentPrivate::clearMark(int line)
{
if (line < 0 || line > lastLine()) {
return;
@@ -1762,7 +1762,7 @@ void KateDocument::clearMark(int line)
repaintViews(true);
}
-void KateDocument::addMark(int line, uint markType)
+void KTextEditor::DocumentPrivate::addMark(int line, uint markType)
{
KTextEditor::Mark *mark;
@@ -1802,7 +1802,7 @@ void KateDocument::addMark(int line, uint markType)
repaintViews(true);
}
-void KateDocument::removeMark(int line, uint markType)
+void KTextEditor::DocumentPrivate::removeMark(int line, uint markType)
{
if (line < 0 || line > lastLine()) {
return;
@@ -1839,12 +1839,12 @@ void KateDocument::removeMark(int line, uint markType)
repaintViews(true);
}
-const QHash<int, KTextEditor::Mark *> &KateDocument::marks()
+const QHash<int, KTextEditor::Mark *> &KTextEditor::DocumentPrivate::marks()
{
return m_marks;
}
-void KateDocument::requestMarkTooltip(int line, QPoint position)
+void KTextEditor::DocumentPrivate::requestMarkTooltip(int line, QPoint position)
{
KTextEditor::Mark *mark = m_marks.value(line);
if (!mark) {
@@ -1855,7 +1855,7 @@ void KateDocument::requestMarkTooltip(int line, QPoint position)
emit markToolTipRequested(this, *mark, position, handled);
}
-bool KateDocument::handleMarkClick(int line)
+bool KTextEditor::DocumentPrivate::handleMarkClick(int line)
{
KTextEditor::Mark *mark = m_marks.value(line);
if (!mark) {
@@ -1868,7 +1868,7 @@ bool KateDocument::handleMarkClick(int line)
return handled;
}
-bool KateDocument::handleMarkContextMenu(int line, QPoint position)
+bool KTextEditor::DocumentPrivate::handleMarkContextMenu(int line, QPoint position)
{
KTextEditor::Mark *mark = m_marks.value(line);
if (!mark) {
@@ -1882,7 +1882,7 @@ bool KateDocument::handleMarkContextMenu(int line, QPoint position)
return handled;
}
-void KateDocument::clearMarks()
+void KTextEditor::DocumentPrivate::clearMarks()
{
while (!m_marks.isEmpty()) {
QHash<int, KTextEditor::Mark *>::iterator it = m_marks.begin();
@@ -1900,22 +1900,22 @@ void KateDocument::clearMarks()
repaintViews(true);
}
-void KateDocument::setMarkPixmap(MarkInterface::MarkTypes type, const QPixmap &pixmap)
+void KTextEditor::DocumentPrivate::setMarkPixmap(MarkInterface::MarkTypes type, const QPixmap &pixmap)
{
m_markPixmaps.insert(type, pixmap);
}
-void KateDocument::setMarkDescription(MarkInterface::MarkTypes type, const QString &description)
+void KTextEditor::DocumentPrivate::setMarkDescription(MarkInterface::MarkTypes type, const QString &description)
{
m_markDescriptions.insert(type, description);
}
-QPixmap KateDocument::markPixmap(MarkInterface::MarkTypes type) const
+QPixmap KTextEditor::DocumentPrivate::markPixmap(MarkInterface::MarkTypes type) const
{
return m_markPixmaps.value(type, QPixmap());
}
-QColor KateDocument::markColor(MarkInterface::MarkTypes type) const
+QColor KTextEditor::DocumentPrivate::markColor(MarkInterface::MarkTypes type) const
{
uint reserved = (0x1 << KTextEditor::MarkInterface::reservedMarkersCount()) - 1;
if ((uint)type >= (uint)markType01 && (uint)type <= reserved) {
@@ -1925,24 +1925,24 @@ QColor KateDocument::markColor(MarkInterface::MarkTypes type) const
}
}
-QString KateDocument::markDescription(MarkInterface::MarkTypes type) const
+QString KTextEditor::DocumentPrivate::markDescription(MarkInterface::MarkTypes type) const
{
return m_markDescriptions.value(type, QString());
}
-void KateDocument::setEditableMarks(uint markMask)
+void KTextEditor::DocumentPrivate::setEditableMarks(uint markMask)
{
m_editableMarks = markMask;
}
-uint KateDocument::editableMarks() const
+uint KTextEditor::DocumentPrivate::editableMarks() const
{
return m_editableMarks;
}
//END
//BEGIN KTextEditor::DocumentInfoInterface (### unfinished)
-QString KateDocument::mimeType()
+QString KTextEditor::DocumentPrivate::mimeType()
{
QMimeType mt;
@@ -1955,7 +1955,7 @@ QString KateDocument::mimeType()
return mt.name();
}
-QMimeType KateDocument::mimeTypeForContent()
+QMimeType KTextEditor::DocumentPrivate::mimeTypeForContent()
{
QByteArray buf(1024, '\0');
uint bufpos = 0;
@@ -1985,7 +1985,7 @@ QMimeType KateDocument::mimeTypeForContent()
//END KTextEditor::DocumentInfoInterface
//BEGIN: error
-void KateDocument::showAndSetOpeningErrorAccess()
+void KTextEditor::DocumentPrivate::showAndSetOpeningErrorAccess()
{
QPointer<KTextEditor::Message> message
= new KTextEditor::Message(i18n("The file %1 could not be loaded, as it was not possible to read from it.<br />Check if you have read access to this file.", this->url().toString()),
@@ -2012,7 +2012,7 @@ void KateDocument::showAndSetOpeningErrorAccess()
//END: error
//BEGIN KParts::ReadWrite stuff
-bool KateDocument::openFile()
+bool KTextEditor::DocumentPrivate::openFile()
{
/**
* we are about to invalidate all cursors/ranges/.. => m_buffer->openFile will do so
@@ -2146,7 +2146,7 @@ bool KateDocument::openFile()
return success;
}
-bool KateDocument::saveFile()
+bool KTextEditor::DocumentPrivate::saveFile()
{
QWidget *parentWidget(dialogParent());
@@ -2315,7 +2315,7 @@ bool KateDocument::saveFile()
return true;
}
-void KateDocument::readDirConfig()
+void KTextEditor::DocumentPrivate::readDirConfig()
{
int depth = config()->searchDirConfigDepth();
@@ -2358,7 +2358,7 @@ void KateDocument::readDirConfig()
}
}
-void KateDocument::activateDirWatch(const QString &useFileName)
+void KTextEditor::DocumentPrivate::activateDirWatch(const QString &useFileName)
{
QString fileToUse = useFileName;
if (fileToUse.isEmpty()) {
@@ -2386,7 +2386,7 @@ void KateDocument::activateDirWatch(const QString &useFileName)
}
}
-void KateDocument::deactivateDirWatch()
+void KTextEditor::DocumentPrivate::deactivateDirWatch()
{
if (!m_dirWatchFile.isEmpty()) {
KTextEditor::EditorPrivate::self()->dirWatch()->removeFile(m_dirWatchFile);
@@ -2395,14 +2395,14 @@ void KateDocument::deactivateDirWatch()
m_dirWatchFile.clear();
}
-bool KateDocument::openUrl(const QUrl &url)
+bool KTextEditor::DocumentPrivate::openUrl(const QUrl &url)
{
bool res = KTextEditor::Document::openUrl(url);
updateDocName();
return res;
}
-bool KateDocument::closeUrl()
+bool KTextEditor::DocumentPrivate::closeUrl()
{
//
// file mod on hd
@@ -2508,26 +2508,26 @@ bool KateDocument::closeUrl()
return true;
}
-bool KateDocument::isDataRecoveryAvailable() const
+bool KTextEditor::DocumentPrivate::isDataRecoveryAvailable() const
{
return m_swapfile && m_swapfile->shouldRecover();
}
-void KateDocument::recoverData()
+void KTextEditor::DocumentPrivate::recoverData()
{
if (isDataRecoveryAvailable()) {
m_swapfile->recover();
}
}
-void KateDocument::discardDataRecovery()
+void KTextEditor::DocumentPrivate::discardDataRecovery()
{
if (isDataRecoveryAvailable()) {
m_swapfile->discard();
}
}
-void KateDocument::setReadWrite(bool rw)
+void KTextEditor::DocumentPrivate::setReadWrite(bool rw)
{
if (isReadWrite() != rw) {
KParts::ReadWritePart::setReadWrite(rw);
@@ -2540,7 +2540,7 @@ void KateDocument::setReadWrite(bool rw)
}
}
-void KateDocument::setModified(bool m)
+void KTextEditor::DocumentPrivate::setModified(bool m)
{
if (isModified() != m) {
@@ -2559,7 +2559,7 @@ void KateDocument::setModified(bool m)
//BEGIN Kate specific stuff ;)
-void KateDocument::makeAttribs(bool needInvalidate)
+void KTextEditor::DocumentPrivate::makeAttribs(bool needInvalidate)
{
foreach (KTextEditor::ViewPrivate *view, m_views) {
view->renderer()->updateAttributes();
@@ -2576,12 +2576,12 @@ void KateDocument::makeAttribs(bool needInvalidate)
}
// the attributes of a hl have changed, update
-void KateDocument::internalHlChanged()
+void KTextEditor::DocumentPrivate::internalHlChanged()
{
makeAttribs();
}
-void KateDocument::addView(KTextEditor::View *view)
+void KTextEditor::DocumentPrivate::addView(KTextEditor::View *view)
{
if (!view) {
return;
@@ -2601,7 +2601,7 @@ void KateDocument::addView(KTextEditor::View *view)
setActiveView(view);
}
-void KateDocument::removeView(KTextEditor::View *view)
+void KTextEditor::DocumentPrivate::removeView(KTextEditor::View *view)
{
if (!view) {
return;
@@ -2615,7 +2615,7 @@ void KateDocument::removeView(KTextEditor::View *view)
m_textEditViews.removeAll(view);
}
-void KateDocument::setActiveView(KTextEditor::View *view)
+void KTextEditor::DocumentPrivate::setActiveView(KTextEditor::View *view)
{
if (m_activeView == view) {
return;
@@ -2624,13 +2624,13 @@ void KateDocument::setActiveView(KTextEditor::View *view)
m_activeView = static_cast<KTextEditor::ViewPrivate *>(view);
}
-bool KateDocument::ownedView(KTextEditor::ViewPrivate *view)
+bool KTextEditor::DocumentPrivate::ownedView(KTextEditor::ViewPrivate *view)
{
// do we own the given view?
return (m_views.contains(view));
}
-int KateDocument::toVirtualColumn(int line, int column) const
+int KTextEditor::DocumentPrivate::toVirtualColumn(int line, int column) const
{
Kate::TextLine textLine = m_buffer->plainLine(line);
@@ -2641,12 +2641,12 @@ int KateDocument::toVirtualColumn(int line, int column) const
}
}
-int KateDocument::toVirtualColumn(const KTextEditor::Cursor &cursor) const
+int KTextEditor::DocumentPrivate::toVirtualColumn(const KTextEditor::Cursor &cursor) const
{
return toVirtualColumn(cursor.line(), cursor.column());
}
-int KateDocument::fromVirtualColumn(int line, int column) const
+int KTextEditor::DocumentPrivate::fromVirtualColumn(int line, int column) const
{
Kate::TextLine textLine = m_buffer->plainLine(line);
@@ -2657,12 +2657,12 @@ int KateDocument::fromVirtualColumn(int line, int column) const
}
}
-int KateDocument::fromVirtualColumn(const KTextEditor::Cursor &cursor) const
+int KTextEditor::DocumentPrivate::fromVirtualColumn(const KTextEditor::Cursor &cursor) const
{
return fromVirtualColumn(cursor.line(), cursor.column());
}
-bool KateDocument::typeChars(KTextEditor::ViewPrivate *view, const QString &realChars)
+bool KTextEditor::DocumentPrivate::typeChars(KTextEditor::ViewPrivate *view, const QString &realChars)
{
Kate::TextLine textLine = m_buffer->plainLine(view->cursorPosition().line());
if (!textLine) {
@@ -2732,7 +2732,7 @@ bool KateDocument::typeChars(KTextEditor::ViewPrivate *view, const QString &real
return true;
}
-void KateDocument::newLine(KTextEditor::ViewPrivate *v)
+void KTextEditor::DocumentPrivate::newLine(KTextEditor::ViewPrivate *v)
{
editStart();
@@ -2770,7 +2770,7 @@ void KateDocument::newLine(KTextEditor::ViewPrivate *v)
m_indenter->userTypedChar(v, v->cursorPosition(), QLatin1Char('\n'));
}
-void KateDocument::transpose(const KTextEditor::Cursor &cursor)
+void KTextEditor::DocumentPrivate::transpose(const KTextEditor::Cursor &cursor)
{
Kate::TextLine textLine = m_buffer->plainLine(cursor.line());
@@ -2804,7 +2804,7 @@ void KateDocument::transpose(const KTextEditor::Cursor &cursor)
editEnd();
}
-void KateDocument::backspace(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &c)
+void KTextEditor::DocumentPrivate::backspace(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &c)
{
if (!view->config()->persistentSelection() && view->selection()) {
if (view->blockSelection() && view->selection() && toVirtualColumn(view->selectionRange().start()) == toVirtualColumn(view->selectionRange().end())) {
@@ -2877,7 +2877,7 @@ void KateDocument::backspace(KTextEditor::ViewPrivate *view, const KTextEditor::
}
}
-void KateDocument::del(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &c)
+void KTextEditor::DocumentPrivate::del(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &c)
{
if (!view->config()->persistentSelection() && view->selection()) {
if (view->blockSelection() && view->selection() && toVirtualColumn(view->selectionRange().start()) == toVirtualColumn(view->selectionRange().end())) {
@@ -2897,7 +2897,7 @@ void KateDocument::del(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor
}
}
-void KateDocument::paste(KTextEditor::ViewPrivate *view, const QString &text)
+void KTextEditor::DocumentPrivate::paste(KTextEditor::ViewPrivate *view, const QString &text)
{
static const QChar newLineChar(QLatin1Char('\n'));
QString s = text;
@@ -2968,7 +2968,7 @@ void KateDocument::paste(KTextEditor::ViewPrivate *view, const QString &text)
m_undoManager->undoSafePoint();
}
-void KateDocument::indent(KTextEditor::Range range, int change)
+void KTextEditor::DocumentPrivate::indent(KTextEditor::Range range, int change)
{
if (!isReadWrite()) {
return;
@@ -2979,12 +2979,12 @@ void KateDocument::indent(KTextEditor::Range range, int change)
editEnd();
}
-void KateDocument::align(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range)
+void KTextEditor::DocumentPrivate::align(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range)
{
m_indenter->indent(view, range);
}
-void KateDocument::insertTab(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &)
+void KTextEditor::DocumentPrivate::insertTab(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &)
{
if (!isReadWrite()) {
return;
@@ -3018,7 +3018,7 @@ void KateDocument::insertTab(KTextEditor::ViewPrivate *view, const KTextEditor::
Remove a given string at the beginning
of the current line.
*/
-bool KateDocument::removeStringFromBeginning(int line, const QString &str)
+bool KTextEditor::DocumentPrivate::removeStringFromBeginning(int line, const QString &str)
{
Kate::TextLine textline = m_buffer->plainLine(line);
@@ -3042,7 +3042,7 @@ bool KateDocument::removeStringFromBeginning(int line, const QString &str)
Remove a given string at the end
of the current line.
*/
-bool KateDocument::removeStringFromEnd(int line, const QString &str)
+bool KTextEditor::DocumentPrivate::removeStringFromEnd(int line, const QString &str)
{
Kate::TextLine textline = m_buffer->plainLine(line);
@@ -3067,7 +3067,7 @@ bool KateDocument::removeStringFromEnd(int line, const QString &str)
/*
Add to the current line a comment line mark at the beginning.
*/
-void KateDocument::addStartLineCommentToSingleLine(int line, int attrib)
+void KTextEditor::DocumentPrivate::addStartLineCommentToSingleLine(int line, int attrib)
{
QString commentLineMark = highlight()->getCommentSingleLineStart(attrib);
int pos = -1;
@@ -3089,7 +3089,7 @@ void KateDocument::addStartLineCommentToSingleLine(int line, int attrib)
Remove from the current line a comment line mark at
the beginning if there is one.
*/
-bool KateDocument::removeStartLineCommentFromSingleLine(int line, int attrib)
+bool KTextEditor::DocumentPrivate::removeStartLineCommentFromSingleLine(int line, int attrib)
{
const QString shortCommentMark = highlight()->getCommentSingleLineStart(attrib);
const QString longCommentMark = shortCommentMark + QLatin1Char(' ');
@@ -3109,7 +3109,7 @@ bool KateDocument::removeStartLineCommentFromSingleLine(int line, int attrib)
Add to the current line a start comment mark at the
beginning and a stop comment mark at the end.
*/
-void KateDocument::addStartStopCommentToSingleLine(int line, int attrib)
+void KTextEditor::DocumentPrivate::addStartStopCommentToSingleLine(int line, int attrib)
{
const QString startCommentMark = highlight()->getCommentStart(attrib) + QLatin1Char(' ');
const QString stopCommentMark = QLatin1Char(' ') + highlight()->getCommentEnd(attrib);
@@ -3132,7 +3132,7 @@ void KateDocument::addStartStopCommentToSingleLine(int line, int attrib)
Remove from the current line a start comment mark at
the beginning and a stop comment mark at the end.
*/
-bool KateDocument::removeStartStopCommentFromSingleLine(int line, int attrib)
+bool KTextEditor::DocumentPrivate::removeStartStopCommentFromSingleLine(int line, int attrib)
{
QString shortStartCommentMark = highlight()->getCommentStart(attrib);
QString longStartCommentMark = shortStartCommentMark + QLatin1Char(' ');
@@ -3163,7 +3163,7 @@ bool KateDocument::removeStartStopCommentFromSingleLine(int line, int attrib)
Add to the current selection a start comment mark at the beginning
and a stop comment mark at the end.
*/
-void KateDocument::addStartStopCommentToSelection(KTextEditor::ViewPrivate *view, int attrib)
+void KTextEditor::DocumentPrivate::addStartStopCommentToSelection(KTextEditor::ViewPrivate *view, int attrib)
{
const QString startComment = highlight()->getCommentStart(attrib);
const QString endComment = highlight()->getCommentEnd(attrib);
@@ -3194,7 +3194,7 @@ void KateDocument::addStartStopCommentToSelection(KTextEditor::ViewPrivate *view
/*
Add to the current selection a comment line mark at the beginning of each line.
*/
-void KateDocument::addStartLineCommentToSelection(KTextEditor::ViewPrivate *view, int attrib)
+void KTextEditor::DocumentPrivate::addStartLineCommentToSelection(KTextEditor::ViewPrivate *view, int attrib)
{
const QString commentLineMark = highlight()->getCommentSingleLineStart(attrib) + QLatin1Char(' ');
@@ -3218,7 +3218,7 @@ void KateDocument::addStartLineCommentToSelection(KTextEditor::ViewPrivate *view
// selection automatically updated (MovingRange)
}
-bool KateDocument::nextNonSpaceCharPos(int &line, int &col)
+bool KTextEditor::DocumentPrivate::nextNonSpaceCharPos(int &line, int &col)
{
for (; line < (int)m_buffer->count(); line++) {
Kate::TextLine textLine = m_buffer->plainLine(line);
@@ -3239,7 +3239,7 @@ bool KateDocument::nextNonSpaceCharPos(int &line, int &col)
return false;
}
-bool KateDocument::previousNonSpaceCharPos(int &line, int &col)
+bool KTextEditor::DocumentPrivate::previousNonSpaceCharPos(int &line, int &col)
{
while (true) {
Kate::TextLine textLine = m_buffer->plainLine(line);
@@ -3268,7 +3268,7 @@ bool KateDocument::previousNonSpaceCharPos(int &line, int &col)
Remove from the selection a start comment mark at
the beginning and a stop comment mark at the end.
*/
-bool KateDocument::removeStartStopCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib)
+bool KTextEditor::DocumentPrivate::removeStartStopCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib)
{
const QString startComment = highlight()->getCommentStart(attrib);
const QString endComment = highlight()->getCommentEnd(attrib);
@@ -3310,7 +3310,7 @@ bool KateDocument::removeStartStopCommentFromSelection(KTextEditor::ViewPrivate
return remove;
}
-bool KateDocument::removeStartStopCommentFromRegion(const KTextEditor::Cursor &start, const KTextEditor::Cursor &end, int attrib)
+bool KTextEditor::DocumentPrivate::removeStartStopCommentFromRegion(const KTextEditor::Cursor &start, const KTextEditor::Cursor &end, int attrib)
{
const QString startComment = highlight()->getCommentStart(attrib);
const QString endComment = highlight()->getCommentEnd(attrib);
@@ -3332,7 +3332,7 @@ bool KateDocument::removeStartStopCommentFromRegion(const KTextEditor::Cursor &s
Remove from the beginning of each line of the
selection a start comment line mark.
*/
-bool KateDocument::removeStartLineCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib)
+bool KTextEditor::DocumentPrivate::removeStartLineCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib)
{
const QString shortCommentMark = highlight()->getCommentSingleLineStart(attrib);
const QString longCommentMark = shortCommentMark + QLatin1Char(' ');
@@ -3366,7 +3366,7 @@ bool KateDocument::removeStartLineCommentFromSelection(KTextEditor::ViewPrivate
Comment or uncomment the selection or the current
line if there is no selection.
*/
-void KateDocument::comment(KTextEditor::ViewPrivate *v, uint line, uint column, int change)
+void KTextEditor::DocumentPrivate::comment(KTextEditor::ViewPrivate *v, uint line, uint column, int change)
{
// skip word wrap bug #105373
const bool skipWordWrap = wordWrap();
@@ -3448,8 +3448,8 @@ void KateDocument::comment(KTextEditor::ViewPrivate *v, uint line, uint column,
}
}
-void KateDocument::transform(KTextEditor::ViewPrivate *v, const KTextEditor::Cursor &c,
- KateDocument::TextTransform t)
+void KTextEditor::DocumentPrivate::transform(KTextEditor::ViewPrivate *v, const KTextEditor::Cursor &c,
+ KTextEditor::DocumentPrivate::TextTransform t)
{
if (v->selection()) {
editStart();
@@ -3554,7 +3554,7 @@ void KateDocument::transform(KTextEditor::ViewPrivate *v, const KTextEditor::Cur
}
-void KateDocument::joinLines(uint first, uint last)
+void KTextEditor::DocumentPrivate::joinLines(uint first, uint last)
{
// if ( first == last ) last += 1;
editStart();
@@ -3592,14 +3592,14 @@ void KateDocument::joinLines(uint first, uint last)
editEnd();
}
-void KateDocument::tagLines(int start, int end)
+void KTextEditor::DocumentPrivate::tagLines(int start, int end)
{
foreach (KTextEditor::ViewPrivate *view, m_views) {
view->tagLines(start, end, true);
}
}
-void KateDocument::repaintViews(bool paintOnlyDirty)
+void KTextEditor::DocumentPrivate::repaintViews(bool paintOnlyDirty)
{
foreach (KTextEditor::ViewPrivate *view, m_views) {
view->repaintText(paintOnlyDirty);
@@ -3613,7 +3613,7 @@ void KateDocument::repaintViews(bool paintOnlyDirty)
match it. Otherwise if the character to the right of the cursor is a
bracket, match it. Otherwise, don't match anything.
*/
-void KateDocument::newBracketMark(const KTextEditor::Cursor &cursor, KTextEditor::Range &bm, int maxLines)
+void KTextEditor::DocumentPrivate::newBracketMark(const KTextEditor::Cursor &cursor, KTextEditor::Range &bm, int maxLines)
{
// search from cursor for brackets
KTextEditor::Range range(cursor, cursor);
@@ -3630,7 +3630,7 @@ void KateDocument::newBracketMark(const KTextEditor::Cursor &cursor, KTextEditor
}
}
-bool KateDocument::findMatchingBracket(KTextEditor::Range &range, int maxLines)
+bool KTextEditor::DocumentPrivate::findMatchingBracket(KTextEditor::Range &range, int maxLines)
{
Kate::TextLine textLine = m_buffer->plainLine(range.start().line());
if (!textLine) {
@@ -3717,7 +3717,7 @@ inline static QString removeNewLines(const QString &str)
.replace(QLatin1Char('\n'), QLatin1Char(' '));
}
-void KateDocument::updateDocName()
+void KTextEditor::DocumentPrivate::updateDocName()
{
// if the name is set, and starts with FILENAME, it should not be changed!
if (! url().isEmpty()
@@ -3728,7 +3728,7 @@ void KateDocument::updateDocName()
int count = -1;
- foreach (KateDocument *doc, KTextEditor::EditorPrivate::self()->kateDocuments()) {
+ foreach (KTextEditor::DocumentPrivate *doc, KTextEditor::EditorPrivate::self()->kateDocuments()) {
if ((doc != this) && (doc->url().fileName() == url().fileName()))
if (doc->m_docNameNumber > count) {
count = doc->m_docNameNumber;
@@ -3757,7 +3757,7 @@ void KateDocument::updateDocName()
}
}
-void KateDocument::slotModifiedOnDisk(KTextEditor::View * /*v*/)
+void KTextEditor::DocumentPrivate::slotModifiedOnDisk(KTextEditor::View * /*v*/)
{
if (m_isasking < 0) {
m_isasking = 0;
@@ -3824,7 +3824,7 @@ void KateDocument::slotModifiedOnDisk(KTextEditor::View * /*v*/)
}
}
-void KateDocument::setModifiedOnDisk(ModifiedOnDiskReason reason)
+void KTextEditor::DocumentPrivate::setModifiedOnDisk(ModifiedOnDiskReason reason)
{
m_modOnHdReason = reason;
m_modOnHd = (reason != OnDiskUnmodified);
@@ -3838,12 +3838,12 @@ public:
KTextEditor::Mark mark;
};
-void KateDocument::setModifiedOnDiskWarning(bool on)
+void KTextEditor::DocumentPrivate::setModifiedOnDiskWarning(bool on)
{
m_fileChangedDialogsActivated = on;
}
-bool KateDocument::documentReload()
+bool KTextEditor::DocumentPrivate::documentReload()
{
if (!url().isEmpty()) {
if (m_modOnHd && m_fileChangedDialogsActivated) {
@@ -3896,7 +3896,7 @@ bool KateDocument::documentReload()
}
m_reloading = true;
- KateDocument::openUrl(url());
+ KTextEditor::DocumentPrivate::openUrl(url());
// reset some flags only valid for one reload!
m_userSetEncodingForNextReload = false;
@@ -3933,7 +3933,7 @@ bool KateDocument::documentReload()
return false;
}
-bool KateDocument::documentSave()
+bool KTextEditor::DocumentPrivate::documentSave()
{
if (!url().isValid() || !isReadWrite()) {
return documentSaveAs();
@@ -3942,7 +3942,7 @@ bool KateDocument::documentSave()
return save();
}
-bool KateDocument::documentSaveAs()
+bool KTextEditor::DocumentPrivate::documentSaveAs()
{
QWidget *parentWidget(dialogParent());
@@ -3958,7 +3958,7 @@ bool KateDocument::documentSaveAs()
return saveAs(res.URLs.first());
}
-bool KateDocument::documentSaveCopyAs()
+bool KTextEditor::DocumentPrivate::documentSaveCopyAs()
{
QWidget *parentWidget(dialogParent());
@@ -3993,48 +3993,48 @@ bool KateDocument::documentSaveCopyAs()
return job->exec();
}
-void KateDocument::setWordWrap(bool on)
+void KTextEditor::DocumentPrivate::setWordWrap(bool on)
{
config()->setWordWrap(on);
}
-bool KateDocument::wordWrap() const
+bool KTextEditor::DocumentPrivate::wordWrap() const
{
return config()->wordWrap();
}
-void KateDocument::setWordWrapAt(uint col)
+void KTextEditor::DocumentPrivate::setWordWrapAt(uint col)
{
config()->setWordWrapAt(col);
}
-unsigned int KateDocument::wordWrapAt() const
+unsigned int KTextEditor::DocumentPrivate::wordWrapAt() const
{
return config()->wordWrapAt();
}
-void KateDocument::setPageUpDownMovesCursor(bool on)
+void KTextEditor::DocumentPrivate::setPageUpDownMovesCursor(bool on)
{
config()->setPageUpDownMovesCursor(on);
}
-bool KateDocument::pageUpDownMovesCursor() const
+bool KTextEditor::DocumentPrivate::pageUpDownMovesCursor() const
{
return config()->pageUpDownMovesCursor();
}
//END
-bool KateDocument::setEncoding(const QString &e)
+bool KTextEditor::DocumentPrivate::setEncoding(const QString &e)
{
return m_config->setEncoding(e);
}
-const QString &KateDocument::encoding() const
+const QString &KTextEditor::DocumentPrivate::encoding() const
{
return m_config->encoding();
}
-void KateDocument::updateConfig()
+void KTextEditor::DocumentPrivate::updateConfig()
{
m_undoManager->updateConfig();
@@ -4065,12 +4065,12 @@ void KateDocument::updateConfig()
add interface for plugins/apps to set/get variables
add view stuff
*/
-QRegExp KateDocument::kvLine = QRegExp(QLatin1String("kate:(.*)"));
-QRegExp KateDocument::kvLineWildcard = QRegExp(QLatin1String("kate-wildcard\\((.*)\\):(.*)"));
-QRegExp KateDocument::kvLineMime = QRegExp(QLatin1String("kate-mimetype\\((.*)\\):(.*)"));
-QRegExp KateDocument::kvVar = QRegExp(QLatin1String("([\\w\\-]+)\\s+([^;]+)"));
+QRegExp KTextEditor::DocumentPrivate::kvLine = QRegExp(QLatin1String("kate:(.*)"));
+QRegExp KTextEditor::DocumentPrivate::kvLineWildcard = QRegExp(QLatin1String("kate-wildcard\\((.*)\\):(.*)"));
+QRegExp KTextEditor::DocumentPrivate::kvLineMime = QRegExp(QLatin1String("kate-mimetype\\((.*)\\):(.*)"));
+QRegExp KTextEditor::DocumentPrivate::kvVar = QRegExp(QLatin1String("([\\w\\-]+)\\s+([^;]+)"));
-void KateDocument::readVariables(bool onlyViewAndRenderer)
+void KTextEditor::DocumentPrivate::readVariables(bool onlyViewAndRenderer)
{
if (!onlyViewAndRenderer) {
m_config->configStart();
@@ -4102,7 +4102,7 @@ void KateDocument::readVariables(bool onlyViewAndRenderer)
}
}
-void KateDocument::readVariableLine(QString t, bool onlyViewAndRenderer)
+void KTextEditor::DocumentPrivate::readVariableLine(QString t, bool onlyViewAndRenderer)
{
// simple check first, no regex
// no kate inside, no vars, simple...
@@ -4289,7 +4289,7 @@ void KateDocument::readVariableLine(QString t, bool onlyViewAndRenderer)
}
}
-void KateDocument::setViewVariable(QString var, QString val)
+void KTextEditor::DocumentPrivate::setViewVariable(QString var, QString val)
{
KTextEditor::ViewPrivate *v;
bool state;
@@ -4343,7 +4343,7 @@ void KateDocument::setViewVariable(QString var, QString val)
}
}
-bool KateDocument::checkBoolValue(QString val, bool *result)
+bool KTextEditor::DocumentPrivate::checkBoolValue(QString val, bool *result)
{
val = val.trimmed().toLower();
QStringList l;
@@ -4361,26 +4361,26 @@ bool KateDocument::checkBoolValue(QString val, bool *result)
return false;
}
-bool KateDocument::checkIntValue(QString val, int *result)
+bool KTextEditor::DocumentPrivate::checkIntValue(QString val, int *result)
{
bool ret(false);
*result = val.toInt(&ret);
return ret;
}
-bool KateDocument::checkColorValue(QString val, QColor &c)
+bool KTextEditor::DocumentPrivate::checkColorValue(QString val, QColor &c)
{
c.setNamedColor(val);
return c.isValid();
}
// KTextEditor::variable
-QString KateDocument::variable(const QString &name) const
+QString KTextEditor::DocumentPrivate::variable(const QString &name) const
{
return m_storedVariables.value(name, QString());
}
-QString KateDocument::setVariable(const QString &name, const QString &value)
+QString KTextEditor::DocumentPrivate::setVariable(const QString &name, const QString &value)
{
QString s = QLatin1String("kate: ");
s.append(name);
@@ -4392,7 +4392,7 @@ QString KateDocument::setVariable(const QString &name, const QString &value)
//END
-void KateDocument::slotModOnHdDirty(const QString &path)
+void KTextEditor::DocumentPrivate::slotModOnHdDirty(const QString &path)
{
if ((path == m_dirWatchFile) && (!m_modOnHd || m_modOnHdReason != OnDiskModified)) {
// compare md5 with the one we have (if we have one)
@@ -4415,7 +4415,7 @@ void KateDocument::slotModOnHdDirty(const QString &path)
}
}
-void KateDocument::slotModOnHdCreated(const QString &path)
+void KTextEditor::DocumentPrivate::slotModOnHdCreated(const QString &path)
{
if ((path == m_dirWatchFile) && (!m_modOnHd || m_modOnHdReason != OnDiskCreated)) {
m_modOnHd = true;
@@ -4430,7 +4430,7 @@ void KateDocument::slotModOnHdCreated(const QString &path)
}
}
-void KateDocument::slotModOnHdDeleted(const QString &path)
+void KTextEditor::DocumentPrivate::slotModOnHdDeleted(const QString &path)
{
if ((path == m_dirWatchFile) && (!m_modOnHd || m_modOnHdReason != OnDiskDeleted)) {
m_modOnHd = true;
@@ -4445,12 +4445,12 @@ void KateDocument::slotModOnHdDeleted(const QString &path)
}
}
-const QByteArray &KateDocument::digest() const
+const QByteArray &KTextEditor::DocumentPrivate::digest() const
{
return m_buffer->digest();
}
-bool KateDocument::createDigest()
+bool KTextEditor::DocumentPrivate::createDigest()
{
QByteArray md5sum;
@@ -4470,7 +4470,7 @@ bool KateDocument::createDigest()
return !md5sum.isEmpty();
}
-QString KateDocument::reasonedMOHString() const
+QString KTextEditor::DocumentPrivate::reasonedMOHString() const
{
// squeeze path
QString str = KStringHandler::csqueeze(url().toString());
@@ -4491,7 +4491,7 @@ QString KateDocument::reasonedMOHString() const
return QString();
}
-void KateDocument::removeTrailingSpaces()
+void KTextEditor::DocumentPrivate::removeTrailingSpaces()
{
const int remove = config()->removeSpaces();
if (remove == 0) {
@@ -4540,7 +4540,7 @@ void KateDocument::removeTrailingSpaces()
}
}
-void KateDocument::updateFileType(const QString &newType, bool user)
+void KTextEditor::DocumentPrivate::updateFileType(const QString &newType, bool user)
{
if (user || !m_fileTypeSetByUser) {
if (!newType.isEmpty()) {
@@ -4594,7 +4594,7 @@ void KateDocument::updateFileType(const QString &newType, bool user)
emit modeChanged(this);
}
-void KateDocument::slotQueryClose_save(bool *handled, bool *abortClosing)
+void KTextEditor::DocumentPrivate::slotQueryClose_save(bool *handled, bool *abortClosing)
{
*handled = true;
*abortClosing = true;
@@ -4618,7 +4618,7 @@ void KateDocument::slotQueryClose_save(bool *handled, bool *abortClosing)
}
-bool KateDocument::checkOverwrite(QUrl u, QWidget *parent)
+bool KTextEditor::DocumentPrivate::checkOverwrite(QUrl u, QWidget *parent)
{
if (!u.isLocalFile()) {
return true;
@@ -4633,18 +4633,18 @@ bool KateDocument::checkOverwrite(QUrl u, QWidget *parent)
i18n("A file named \"%1\" already exists. "
"Are you sure you want to overwrite it?", info.fileName()),
i18n("Overwrite File?"), KStandardGuiItem::overwrite(),
- KStandardGuiItem::cancel(), QString(), KMessageBox::Notify | KMessageBox::Dangerous);
+ KStandardGuiItem::cancel(), QString(), KMessageBox::Notify); // FIXME KF 5 | ::KMessageBox::Dangerous
}
//BEGIN KTextEditor::ConfigInterface
// BEGIN ConfigInterface stff
-QStringList KateDocument::configKeys() const
+QStringList KTextEditor::DocumentPrivate::configKeys() const
{
return QStringList() << QLatin1String("tab-width") << QLatin1String("indent-width");
}
-QVariant KateDocument::configValue(const QString &key)
+QVariant KTextEditor::DocumentPrivate::configValue(const QString &key)
{
if (key == QLatin1String("backup-on-save-local")) {
return m_config->backupFlags() & KateDocumentConfig::LocalFiles;
@@ -4668,7 +4668,7 @@ QVariant KateDocument::configValue(const QString &key)
return QVariant();
}
-void KateDocument::setConfigValue(const QString &key, const QVariant &value)
+void KTextEditor::DocumentPrivate::setConfigValue(const QString &key, const QVariant &value)
{
if (value.type() == QVariant::String) {
if (key == QLatin1String("backup-on-save-suffix")) {
@@ -4712,12 +4712,12 @@ void KateDocument::setConfigValue(const QString &key, const QVariant &value)
//END KTextEditor::ConfigInterface
-KTextEditor::Cursor KateDocument::documentEnd() const
+KTextEditor::Cursor KTextEditor::DocumentPrivate::documentEnd() const
{
return KTextEditor::Cursor(lastLine(), lineLength(lastLine()));
}
-bool KateDocument::replaceText(const KTextEditor::Range &range, const QString &s, bool block)
+bool KTextEditor::DocumentPrivate::replaceText(const KTextEditor::Range &range, const QString &s, bool block)
{
// TODO more efficient?
editStart();
@@ -4727,33 +4727,33 @@ bool KateDocument::replaceText(const KTextEditor::Range &range, const QString &s
return changed;
}
-void KateDocument::ignoreModifiedOnDiskOnce()
+void KTextEditor::DocumentPrivate::ignoreModifiedOnDiskOnce()
{
m_isasking = -1;
}
-KateHighlighting *KateDocument::highlight() const
+KateHighlighting *KTextEditor::DocumentPrivate::highlight() const
{
return m_buffer->highlight();
}
-Kate::TextLine KateDocument::kateTextLine(uint i)
+Kate::TextLine KTextEditor::DocumentPrivate::kateTextLine(uint i)
{
m_buffer->ensureHighlighted(i);
return m_buffer->plainLine(i);
}
-Kate::TextLine KateDocument::plainKateTextLine(uint i)
+Kate::TextLine KTextEditor::DocumentPrivate::plainKateTextLine(uint i)
{
return m_buffer->plainLine(i);
}
-bool KateDocument::isEditRunning() const
+bool KTextEditor::DocumentPrivate::isEditRunning() const
{
return editIsRunning;
}
-void KateDocument::setUndoMergeAllEdits(bool merge)
+void KTextEditor::DocumentPrivate::setUndoMergeAllEdits(bool merge)
{
if (merge && m_undoMergeAllEdits) {
// Don't add another undo safe point: it will override our current one,
@@ -4766,42 +4766,42 @@ void KateDocument::setUndoMergeAllEdits(bool merge)
}
//BEGIN KTextEditor::MovingInterface
-KTextEditor::MovingCursor *KateDocument::newMovingCursor(const KTextEditor::Cursor &position, KTextEditor::MovingCursor::InsertBehavior insertBehavior)
+KTextEditor::MovingCursor *KTextEditor::DocumentPrivate::newMovingCursor(const KTextEditor::Cursor &position, KTextEditor::MovingCursor::InsertBehavior insertBehavior)
{
return new Kate::TextCursor(buffer(), position, insertBehavior);
}
-KTextEditor::MovingRange *KateDocument::newMovingRange(const KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior)
+KTextEditor::MovingRange *KTextEditor::DocumentPrivate::newMovingRange(const KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior)
{
return new Kate::TextRange(buffer(), range, insertBehaviors, emptyBehavior);
}
-qint64 KateDocument::revision() const
+qint64 KTextEditor::DocumentPrivate::revision() const
{
return m_buffer->history().revision();
}
-qint64 KateDocument::lastSavedRevision() const
+qint64 KTextEditor::DocumentPrivate::lastSavedRevision() const
{
return m_buffer->history().lastSavedRevision();
}
-void KateDocument::lockRevision(qint64 revision)
+void KTextEditor::DocumentPrivate::lockRevision(qint64 revision)
{
m_buffer->history().lockRevision(revision);
}
-void KateDocument::unlockRevision(qint64 revision)
+void KTextEditor::DocumentPrivate::unlockRevision(qint64 revision)
{
m_buffer->history().unlockRevision(revision);
}
-void KateDocument::transformCursor(int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision)
+void KTextEditor::DocumentPrivate::transformCursor(int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision)
{
m_buffer->history().transformCursor(line, column, insertBehavior, fromRevision, toRevision);
}
-void KateDocument::transformCursor(KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision)
+void KTextEditor::DocumentPrivate::transformCursor(KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision)
{
int line = cursor.line(), column = cursor.column();
m_buffer->history().transformCursor(line, column, insertBehavior, fromRevision, toRevision);
@@ -4809,7 +4809,7 @@ void KateDocument::transformCursor(KTextEditor::Cursor &cursor, KTextEditor::Mov
cursor.setColumn(column);
}
-void KateDocument::transformRange(KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision)
+void KTextEditor::DocumentPrivate::transformRange(KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision)
{
m_buffer->history().transformRange(range, insertBehaviors, emptyBehavior, fromRevision, toRevision);
}
@@ -4817,21 +4817,21 @@ void KateDocument::transformRange(KTextEditor::Range &range, KTextEditor::Moving
//END
//BEGIN KTextEditor::AnnotationInterface
-void KateDocument::setAnnotationModel(KTextEditor::AnnotationModel *model)
+void KTextEditor::DocumentPrivate::setAnnotationModel(KTextEditor::AnnotationModel *model)
{
KTextEditor::AnnotationModel *oldmodel = m_annotationModel;
m_annotationModel = model;
emit annotationModelChanged(oldmodel, m_annotationModel);
}
-KTextEditor::AnnotationModel *KateDocument::annotationModel() const
+KTextEditor::AnnotationModel *KTextEditor::DocumentPrivate::annotationModel() const
{
return m_annotationModel;
}
//END KTextEditor::AnnotationInterface
//TAKEN FROM kparts.h
-bool KateDocument::queryClose()
+bool KTextEditor::DocumentPrivate::queryClose()
{
if (!isReadWrite() || !isModified()) {
return true;
@@ -4872,7 +4872,7 @@ bool KateDocument::queryClose()
}
}
-void KateDocument::slotStarted(KIO::Job *job)
+void KTextEditor::DocumentPrivate::slotStarted(KIO::Job *job)
{
/**
* if we are idle before, we are now loading!
@@ -4913,7 +4913,7 @@ void KateDocument::slotStarted(KIO::Job *job)
}
}
-void KateDocument::slotCompleted()
+void KTextEditor::DocumentPrivate::slotCompleted()
{
/**
* if were loading, reset back to old read-write mode before loading
@@ -4938,7 +4938,7 @@ void KateDocument::slotCompleted()
m_reloading = false;
}
-void KateDocument::slotCanceled()
+void KTextEditor::DocumentPrivate::slotCanceled()
{
/**
* if were loading, reset back to old read-write mode before loading
@@ -4961,7 +4961,7 @@ void KateDocument::slotCanceled()
}
-void KateDocument::slotTriggerLoadingMessage()
+void KTextEditor::DocumentPrivate::slotTriggerLoadingMessage()
{
/**
* no longer loading?
@@ -4993,7 +4993,7 @@ void KateDocument::slotTriggerLoadingMessage()
postMessage(m_loadingMessage);
}
-void KateDocument::slotAbortLoading()
+void KTextEditor::DocumentPrivate::slotAbortLoading()
{
/**
* no job, no work
@@ -5010,14 +5010,14 @@ void KateDocument::slotAbortLoading()
m_loadingJob = 0;
}
-void KateDocument::slotUrlChanged(const QUrl &url)
+void KTextEditor::DocumentPrivate::slotUrlChanged(const QUrl &url)
{
Q_UNUSED(url);
updateDocName();
emit documentUrlChanged(this);
}
-bool KateDocument::save()
+bool KTextEditor::DocumentPrivate::save()
{
/**
* no double save/load
@@ -5042,7 +5042,7 @@ bool KateDocument::save()
return KTextEditor::Document::save();
}
-bool KateDocument::saveAs(const QUrl &url)
+bool KTextEditor::DocumentPrivate::saveAs(const QUrl &url)
{
/**
* abort on bad URL
@@ -5072,17 +5072,17 @@ bool KateDocument::saveAs(const QUrl &url)
return KTextEditor::Document::saveAs(url);
}
-QString KateDocument::defaultDictionary() const
+QString KTextEditor::DocumentPrivate::defaultDictionary() const
{
return m_defaultDictionary;
}
-QList<QPair<KTextEditor::MovingRange *, QString> > KateDocument::dictionaryRanges() const
+QList<QPair<KTextEditor::MovingRange *, QString> > KTextEditor::DocumentPrivate::dictionaryRanges() const
{
return m_dictionaryRanges;
}
-void KateDocument::clearDictionaryRanges()
+void KTextEditor::DocumentPrivate::clearDictionaryRanges()
{
for (QList<QPair<KTextEditor::MovingRange *, QString> >::iterator i = m_dictionaryRanges.begin();
i != m_dictionaryRanges.end(); ++i) {
@@ -5095,7 +5095,7 @@ void KateDocument::clearDictionaryRanges()
emit dictionaryRangesPresent(false);
}
-void KateDocument::setDictionary(const QString &newDictionary, const KTextEditor::Range &range)
+void KTextEditor::DocumentPrivate::setDictionary(const QString &newDictionary, const KTextEditor::Range &range)
{
KTextEditor::Range newDictionaryRange = range;
if (!newDictionaryRange.isValid() || newDictionaryRange.isEmpty()) {
@@ -5161,12 +5161,12 @@ void KateDocument::setDictionary(const QString &newDictionary, const KTextEditor
emit dictionaryRangesPresent(!m_dictionaryRanges.isEmpty());
}
-void KateDocument::revertToDefaultDictionary(const KTextEditor::Range &range)
+void KTextEditor::DocumentPrivate::revertToDefaultDictionary(const KTextEditor::Range &range)
{
setDictionary(QString(), range);
}
-void KateDocument::setDefaultDictionary(const QString &dict)
+void KTextEditor::DocumentPrivate::setDefaultDictionary(const QString &dict)
{
if (m_defaultDictionary == dict) {
return;
@@ -5181,7 +5181,7 @@ void KateDocument::setDefaultDictionary(const QString &dict)
emit defaultDictionaryChanged(this);
}
-void KateDocument::onTheFlySpellCheckingEnabled(bool enable)
+void KTextEditor::DocumentPrivate::onTheFlySpellCheckingEnabled(bool enable)
{
if (isOnTheFlySpellCheckingEnabled() == enable) {
return;
@@ -5200,12 +5200,12 @@ void KateDocument::onTheFlySpellCheckingEnabled(bool enable)
}
}
-bool KateDocument::isOnTheFlySpellCheckingEnabled() const
+bool KTextEditor::DocumentPrivate::isOnTheFlySpellCheckingEnabled() const
{
return m_onTheFlyChecker != 0;
}
-QString KateDocument::dictionaryForMisspelledRange(const KTextEditor::Range &range) const
+QString KTextEditor::DocumentPrivate::dictionaryForMisspelledRange(const KTextEditor::Range &range) const
{
if (!m_onTheFlyChecker) {
return QString();
@@ -5214,31 +5214,31 @@ QString KateDocument::dictionaryForMisspelledRange(const KTextEditor::Range &ran
}
}
-void KateDocument::clearMisspellingForWord(const QString &word)
+void KTextEditor::DocumentPrivate::clearMisspellingForWord(const QString &word)
{
if (m_onTheFlyChecker) {
m_onTheFlyChecker->clearMisspellingForWord(word);
}
}
-void KateDocument::refreshOnTheFlyCheck(const KTextEditor::Range &range)
+void KTextEditor::DocumentPrivate::refreshOnTheFlyCheck(const KTextEditor::Range &range)
{
if (m_onTheFlyChecker) {
m_onTheFlyChecker->refreshSpellCheck(range);
}
}
-void KateDocument::rangeInvalid(KTextEditor::MovingRange *movingRange)
+void KTextEditor::DocumentPrivate::rangeInvalid(KTextEditor::MovingRange *movingRange)
{
deleteDictionaryRange(movingRange);
}
-void KateDocument::rangeEmpty(KTextEditor::MovingRange *movingRange)
+void KTextEditor::DocumentPrivate::rangeEmpty(KTextEditor::MovingRange *movingRange)
{
deleteDictionaryRange(movingRange);
}
-void KateDocument::deleteDictionaryRange(KTextEditor::MovingRange *movingRange)
+void KTextEditor::DocumentPrivate::deleteDictionaryRange(KTextEditor::MovingRange *movingRange)
{
qCDebug(LOG_PART) << "deleting" << movingRange;
for (QList<QPair<KTextEditor::MovingRange *, QString> >::iterator i = m_dictionaryRanges.begin();
@@ -5253,7 +5253,7 @@ void KateDocument::deleteDictionaryRange(KTextEditor::MovingRange *movingRange)
}
}
-bool KateDocument::containsCharacterEncoding(const KTextEditor::Range &range)
+bool KTextEditor::DocumentPrivate::containsCharacterEncoding(const KTextEditor::Range &range)
{
KateHighlighting *highlighting = highlight();
Kate::TextLine textLine;
@@ -5279,7 +5279,7 @@ bool KateDocument::containsCharacterEncoding(const KTextEditor::Range &range)
return false;
}
-int KateDocument::computePositionWrtOffsets(const OffsetList &offsetList, int pos)
+int KTextEditor::DocumentPrivate::computePositionWrtOffsets(const OffsetList &offsetList, int pos)
{
int previousOffset = 0;
for (OffsetList::const_iterator i = offsetList.begin(); i != offsetList.end(); ++i) {
@@ -5291,8 +5291,8 @@ int KateDocument::computePositionWrtOffsets(const OffsetList &offsetList, int po
return pos + previousOffset;
}
-QString KateDocument::decodeCharacters(const KTextEditor::Range &range, KateDocument::OffsetList &decToEncOffsetList,
- KateDocument::OffsetList &encToDecOffsetList)
+QString KTextEditor::DocumentPrivate::decodeCharacters(const KTextEditor::Range &range, KTextEditor::DocumentPrivate::OffsetList &decToEncOffsetList,
+ KTextEditor::DocumentPrivate::OffsetList &encToDecOffsetList)
{
QString toReturn;
KTextEditor::Cursor previous = range.start();
@@ -5347,7 +5347,7 @@ QString KateDocument::decodeCharacters(const KTextEditor::Range &range, KateDocu
return toReturn;
}
-void KateDocument::replaceCharactersByEncoding(const KTextEditor::Range &range)
+void KTextEditor::DocumentPrivate::replaceCharactersByEncoding(const KTextEditor::Range &range)
{
KateHighlighting *highlighting = highlight();
Kate::TextLine textLine;
@@ -5379,7 +5379,7 @@ void KateDocument::replaceCharactersByEncoding(const KTextEditor::Range &range)
// KTextEditor::HighlightInterface
//
-KTextEditor::Attribute::Ptr KateDocument::defaultStyle(const KTextEditor::HighlightInterface::DefaultStyle ds) const
+KTextEditor::Attribute::Ptr KTextEditor::DocumentPrivate::defaultStyle(const KTextEditor::HighlightInterface::DefaultStyle ds) const
{
///TODO: move attributes to document, they are not view-dependant
KTextEditor::ViewPrivate *view = m_views.empty() ? nullptr : m_views.last();
@@ -5397,7 +5397,7 @@ KTextEditor::Attribute::Ptr KateDocument::defaultStyle(const KTextEditor::Highli
return style;
}
-QList< KTextEditor::HighlightInterface::AttributeBlock > KateDocument::lineAttributes(const unsigned int line)
+QList< KTextEditor::HighlightInterface::AttributeBlock > KTextEditor::DocumentPrivate::lineAttributes(const unsigned int line)
{
///TODO: move attributes to document, they are not view-dependant
@@ -5427,7 +5427,7 @@ QList< KTextEditor::HighlightInterface::AttributeBlock > KateDocument::lineAttri
return attribs;
}
-KTextEditor::Attribute::Ptr KateDocument::attributeAt(const KTextEditor::Cursor &position)
+KTextEditor::Attribute::Ptr KTextEditor::DocumentPrivate::attributeAt(const KTextEditor::Cursor &position)
{
KTextEditor::Attribute::Ptr attrib(new KTextEditor::Attribute());
@@ -5447,12 +5447,12 @@ KTextEditor::Attribute::Ptr KateDocument::attributeAt(const KTextEditor::Cursor
return attrib;
}
-QStringList KateDocument::embeddedHighlightingModes() const
+QStringList KTextEditor::DocumentPrivate::embeddedHighlightingModes() const
{
return highlight()->getEmbeddedHighlightingModes();
}
-QString KateDocument::highlightingModeAt(const KTextEditor::Cursor &position)
+QString KTextEditor::DocumentPrivate::highlightingModeAt(const KTextEditor::Cursor &position)
{
Kate::TextLine kateLine = kateTextLine(position.line());
@@ -5488,7 +5488,7 @@ QString KateDocument::highlightingModeAt(const KTextEditor::Cursor &position)
}
-Kate::SwapFile *KateDocument::swapFile()
+Kate::SwapFile *KTextEditor::DocumentPrivate::swapFile()
{
return m_swapfile;
}
@@ -5497,7 +5497,7 @@ Kate::SwapFile *KateDocument::swapFile()
* \return \c -1 if \c line or \c column invalid, otherwise one of
* standard style attribute number
*/
-int KateDocument::defStyleNum(int line, int column)
+int KTextEditor::DocumentPrivate::defStyleNum(int line, int column)
{
// Validate parameters to prevent out of range access
if (line < 0 || line >= lines() || column < 0) {
@@ -5541,14 +5541,14 @@ int KateDocument::defStyleNum(int line, int column)
return a->property(KateExtendedAttribute::AttributeDefaultStyleIndex).toInt();
}
-bool KateDocument::isComment(int line, int column)
+bool KTextEditor::DocumentPrivate::isComment(int line, int column)
{
const int defaultStyle = defStyleNum(line, column);
return defaultStyle == KTextEditor::HighlightInterface::dsComment;
}
//BEGIN KTextEditor::MessageInterface
-bool KateDocument::postMessage(KTextEditor::Message *message)
+bool KTextEditor::DocumentPrivate::postMessage(KTextEditor::Message *message)
{
// no message -> cancel
if (!message) {
@@ -5595,7 +5595,7 @@ bool KateDocument::postMessage(KTextEditor::Message *message)
return true;
}
-void KateDocument::messageDestroyed(KTextEditor::Message *message)
+void KTextEditor::DocumentPrivate::messageDestroyed(KTextEditor::Message *message)
{
// KTE:Message is already in destructor
Q_ASSERT(m_messageHash.contains(message));
diff --git a/src/document/katedocument.h b/src/document/katedocument.h
index 5308b00..34e595d 100644
--- a/src/document/katedocument.h
+++ b/src/document/katedocument.h
@@ -71,13 +71,14 @@ class KateDocumentConfig;
class KateHighlighting;
class KateUndoManager;
class KateOnTheFlyChecker;
+class KateDocumentTest;
class KateAutoIndent;
//
// Kate KTextEditor::Document class (and even KTextEditor::Editor ;)
//
-class KTEXTEDITOR_EXPORT KateDocument : public KTextEditor::Document,
+class KTEXTEDITOR_EXPORT KTextEditor::DocumentPrivate : public KTextEditor::Document,
public KTextEditor::SessionConfigInterface,
public KTextEditor::ParameterizedSessionConfigInterface,
public KTextEditor::SearchInterface,
@@ -106,13 +107,13 @@ class KTEXTEDITOR_EXPORT KateDocument : public KTextEditor::Document,
Q_INTERFACES(KTextEditor::RecoveryInterface)
Q_INTERFACES(KTextEditor::MessageInterface)
- friend class KateDocumentTest;
- friend class KateBuffer;
+ friend class ::KateDocumentTest;
+ friend class ::KateBuffer;
public:
- explicit KateDocument(bool bSingleViewMode = false, bool bReadOnly = false,
+ explicit DocumentPrivate(bool bSingleViewMode = false, bool bReadOnly = false,
QWidget *parentWidget = 0, QObject * = 0);
- ~KateDocument();
+ ~DocumentPrivate();
using ReadWritePart::closeUrl;
virtual bool closeUrl();
@@ -1150,7 +1151,7 @@ public Q_SLOTS:
Q_SIGNALS:
void dictionaryRangesPresent(bool yesNo);
- void defaultDictionaryChanged(KateDocument *document);
+ void defaultDictionaryChanged(KTextEditor::DocumentPrivate *document);
public:
bool containsCharacterEncoding(const KTextEditor::Range &range);
@@ -1164,8 +1165,8 @@ public:
* encoded to decoded.
**/
QString decodeCharacters(const KTextEditor::Range &range,
- KateDocument::OffsetList &decToEncOffsetList,
- KateDocument::OffsetList &encToDecOffsetList);
+ KTextEditor::DocumentPrivate::OffsetList &decToEncOffsetList,
+ KTextEditor::DocumentPrivate::OffsetList &encToDecOffsetList);
void replaceCharactersByEncoding(const KTextEditor::Range &range);
enum EncodedCharaterInsertionPolicy {EncodeAlways, EncodeWhenPresent, EncodeNever};
diff --git a/src/include/ktexteditor/document.h b/src/include/ktexteditor/document.h
index ca29f9d..421b16c 100644
--- a/src/include/ktexteditor/document.h
+++ b/src/include/ktexteditor/document.h
@@ -38,6 +38,7 @@ namespace KTextEditor
class View;
class MainWindow;
+class DocumentPrivate;
/**
* \brief A KParts derived class representing a text document.
@@ -121,16 +122,21 @@ class KTEXTEDITOR_EXPORT Document : public KParts::ReadWritePart
{
Q_OBJECT
-public:
+protected:
/**
* Constructor.
*
* Create a new document with \p parent.
+ *
+ * Pass it the internal implementation to store a d-pointer.
+ *
+ * \param impl d-pointer to use
* \param parent parent object
* \see Editor::createDocument()
*/
- Document(QObject *parent = 0);
+ Document (DocumentPrivate *impl, QObject *parent);
+public:
/**
* Virtual destructor.
*/
@@ -844,7 +850,7 @@ Q_SIGNALS:
void highlightingModeChanged(KTextEditor::Document *document);
private:
- class DocumentPrivate *const d;
+ DocumentPrivate *const d;
public:
/**
diff --git a/src/mode/katemodemanager.cpp b/src/mode/katemodemanager.cpp
index 57b78dc..122813a 100644
--- a/src/mode/katemodemanager.cpp
+++ b/src/mode/katemodemanager.cpp
@@ -190,7 +190,7 @@ void KateModeManager::save(const QList<KateFileType *> &v)
update();
}
-QString KateModeManager::fileType(KateDocument *doc, const QString &fileToReadFrom)
+QString KateModeManager::fileType(KTextEditor::DocumentPrivate *doc, const QString &fileToReadFrom)
{
qCDebug(LOG_PART);
if (!doc) {
diff --git a/src/mode/katemodemanager.h b/src/mode/katemodemanager.h
index 8e397a3..1836937 100644
--- a/src/mode/katemodemanager.h
+++ b/src/mode/katemodemanager.h
@@ -29,7 +29,7 @@
#include "katedialogs.h"
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateFileType
{
@@ -80,7 +80,7 @@ public:
* get the right fileType for the given document
* -1 if none found !
*/
- QString fileType(KateDocument *doc, const QString &fileToReadFrom);
+ QString fileType(KTextEditor::DocumentPrivate *doc, const QString &fileToReadFrom);
/**
* Don't store the pointer somewhere longer times, won't be valid after the next update()
diff --git a/src/mode/katemodemenu.cpp b/src/mode/katemodemenu.cpp
index 152b53d..6a3a247 100644
--- a/src/mode/katemodemenu.cpp
+++ b/src/mode/katemodemenu.cpp
@@ -64,12 +64,12 @@ KateModeMenu::~KateModeMenu()
void KateModeMenu::updateMenu(KTextEditor::Document *doc)
{
- m_doc = static_cast<KateDocument *>(doc);
+ m_doc = static_cast<KTextEditor::DocumentPrivate *>(doc);
}
void KateModeMenu::slotAboutToShow()
{
- KateDocument *doc = m_doc;
+ KTextEditor::DocumentPrivate *doc = m_doc;
int count = KTextEditor::EditorPrivate::self()->modeManager()->list().count();
for (int z = 0; z < count; z++) {
@@ -152,7 +152,7 @@ void KateModeMenu::slotAboutToShow()
void KateModeMenu::setType(QAction *action)
{
- KateDocument *doc = m_doc;
+ KTextEditor::DocumentPrivate *doc = m_doc;
if (doc) {
doc->updateFileType(action->data().toString(), true);
diff --git a/src/mode/katemodemenu.h b/src/mode/katemodemenu.h
index 22b854d..2335305 100644
--- a/src/mode/katemodemenu.h
+++ b/src/mode/katemodemenu.h
@@ -28,7 +28,7 @@
#include "katedialogs.h"
#include "katemodemanager.h"
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateModeMenu : public KActionMenu
{
@@ -48,7 +48,7 @@ public:
private:
void init();
- QPointer<KateDocument> m_doc;
+ QPointer<KTextEditor::DocumentPrivate> m_doc;
QStringList subMenusName;
QStringList names;
QList<QMenu *> subMenus;
diff --git a/src/printing/kateprinter.cpp b/src/printing/kateprinter.cpp
index f88c0c4..5b12797 100644
--- a/src/printing/kateprinter.cpp
+++ b/src/printing/kateprinter.cpp
@@ -55,7 +55,7 @@ public Q_SLOTS:
private:
KTextEditor::ViewPrivate *m_view;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
PrintPainter *m_painter;
};
diff --git a/src/printing/printpainter.h b/src/printing/printpainter.h
index 8b26626..e2ac76b 100644
--- a/src/printing/printpainter.h
+++ b/src/printing/printpainter.h
@@ -27,7 +27,7 @@
#include <QColor>
#include <QFont>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
class KateRenderer;
class QPrinter;
@@ -130,7 +130,7 @@ private:
private:
KTextEditor::ViewPrivate *m_view;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
QString m_colorScheme;
bool m_printGuide;
diff --git a/src/render/katelinelayout.cpp b/src/render/katelinelayout.cpp
index 9f74155..98b9c8a 100644
--- a/src/render/katelinelayout.cpp
+++ b/src/render/katelinelayout.cpp
@@ -115,7 +115,7 @@ void KateLineLayout::setShiftX(int shiftX)
m_shiftX = shiftX;
}
-KateDocument *KateLineLayout::doc() const
+KTextEditor::DocumentPrivate *KateLineLayout::doc() const
{
return m_renderer.doc();
}
diff --git a/src/render/katelinelayout.h b/src/render/katelinelayout.h
index 0104b55..278460a 100644
--- a/src/render/katelinelayout.h
+++ b/src/render/katelinelayout.h
@@ -29,7 +29,7 @@
#include <ktexteditor/cursor.h>
class QTextLayout;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateTextLayout;
class KateRenderer;
@@ -39,7 +39,7 @@ public:
KateLineLayout(KateRenderer &renderer);
~KateLineLayout();
- KateDocument *doc() const;
+ KTextEditor::DocumentPrivate *doc() const;
void debugOutput() const;
void clear();
diff --git a/src/render/katerenderer.cpp b/src/render/katerenderer.cpp
index 97bda83..3f58fd6 100644
--- a/src/render/katerenderer.cpp
+++ b/src/render/katerenderer.cpp
@@ -46,7 +46,7 @@ static const QChar spaceChar(QLatin1Char(' '));
static const QChar nbSpaceChar(0xa0); // non-breaking space
static const QRegularExpression nonPrintableSpacesRegExp(QLatin1String("[\\x{2000}-\\x{200F}\\x{2028}-\\x{202F}\\x{205F}-\\x{2064}\\x{206A}-\\x{206F}]"));
-KateRenderer::KateRenderer(KateDocument *doc, Kate::TextFolding &folding, KTextEditor::ViewPrivate *view)
+KateRenderer::KateRenderer(KTextEditor::DocumentPrivate *doc, Kate::TextFolding &folding, KTextEditor::ViewPrivate *view)
: m_doc(doc)
, m_folding(folding)
, m_view(view)
diff --git a/src/render/katerenderer.h b/src/render/katerenderer.h
index 0fc9e1f..731a6cb 100644
--- a/src/render/katerenderer.h
+++ b/src/render/katerenderer.h
@@ -32,7 +32,7 @@
#include <QList>
#include <QTextLine>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
class KateRendererConfig;
class KateRenderRange;
@@ -78,7 +78,7 @@ public:
* @param folding folding information
* @param view view which is output (0 for example for rendering to print)
*/
- explicit KateRenderer(KateDocument *doc, Kate::TextFolding &folding, KTextEditor::ViewPrivate *view = 0);
+ explicit KateRenderer(KTextEditor::DocumentPrivate *doc, Kate::TextFolding &folding, KTextEditor::ViewPrivate *view = 0);
/**
* Destructor
@@ -88,7 +88,7 @@ public:
/**
* Returns the document to which this renderer is bound
*/
- KateDocument *doc() const
+ KTextEditor::DocumentPrivate *doc() const
{
return m_doc;
}
@@ -376,7 +376,7 @@ private:
// update font height
void updateFontHeight();
- KateDocument *const m_doc;
+ KTextEditor::DocumentPrivate *const m_doc;
Kate::TextFolding &m_folding;
KTextEditor::ViewPrivate *const m_view;
diff --git a/src/script/data/libraries/documentcursor.js b/src/script/data/libraries/documentcursor.js
index ecd9d37..bbee41b 100644
--- a/src/script/data/libraries/documentcursor.js
+++ b/src/script/data/libraries/documentcursor.js
@@ -120,7 +120,7 @@ DocumentCursor.prototype.move = function(nChars, wrapAtEol) {
var c = new Cursor(this.line, this.column);
- // cache lineLength to minimize calls of KateDocument::lineLength(), as
+ // cache lineLength to minimize calls of KTextEditor::DocumentPrivate::lineLength(), as
// results in locating the correct block in the text buffer every time,
// which is relatively slow
var lineLength = this.document.lineLength(c.line);
diff --git a/src/script/katescriptdocument.cpp b/src/script/katescriptdocument.cpp
index c750252..73419d0 100644
--- a/src/script/katescriptdocument.cpp
+++ b/src/script/katescriptdocument.cpp
@@ -37,12 +37,12 @@ KateScriptDocument::KateScriptDocument(QObject *parent)
{
}
-void KateScriptDocument::setDocument(KateDocument *document)
+void KateScriptDocument::setDocument(KTextEditor::DocumentPrivate *document)
{
m_document = document;
}
-KateDocument *KateScriptDocument::document()
+KTextEditor::DocumentPrivate *KateScriptDocument::document()
{
return m_document;
}
diff --git a/src/script/katescriptdocument.h b/src/script/katescriptdocument.h
index 1a56828..57f7b8e 100644
--- a/src/script/katescriptdocument.h
+++ b/src/script/katescriptdocument.h
@@ -31,10 +31,10 @@
#include <ktexteditor/cursor.h>
#include <ktexteditor/range.h>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
/**
- * Thinish wrapping around KateDocument, exposing the methods we want exposed
+ * Thinish wrapping around KTextEditor::DocumentPrivate, exposing the methods we want exposed
* and adding some helper methods.
*
* We inherit from QScriptable to have more thight access to the scripting
@@ -50,8 +50,8 @@ class KTEXTEDITOR_EXPORT KateScriptDocument : public QObject, protected QScripta
public:
KateScriptDocument(QObject *parent = 0);
- void setDocument(KateDocument *document);
- KateDocument *document();
+ void setDocument(KTextEditor::DocumentPrivate *document);
+ KTextEditor::DocumentPrivate *document();
//BEGIN
Q_INVOKABLE QString fileName();
@@ -181,7 +181,7 @@ public:
private:
bool _isCode(int defaultStyle);
- KateDocument *m_document;
+ KTextEditor::DocumentPrivate *m_document;
};
#endif
diff --git a/src/search/katematch.cpp b/src/search/katematch.cpp
index f0c2c97..b3ae75f 100644
--- a/src/search/katematch.cpp
+++ b/src/search/katematch.cpp
@@ -24,7 +24,7 @@
#include "katedocument.h"
#include <ktexteditor/movingrange.h>
-KateMatch::KateMatch(KateDocument *document, KTextEditor::Search::SearchOptions options)
+KateMatch::KateMatch(KTextEditor::DocumentPrivate *document, KTextEditor::Search::SearchOptions options)
: m_document(document)
, m_options(options)
{
diff --git a/src/search/katematch.h b/src/search/katematch.h
index 8facf73..507b79e 100644
--- a/src/search/katematch.h
+++ b/src/search/katematch.h
@@ -24,12 +24,12 @@
#include <ktexteditor/searchinterface.h>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateMatch
{
public:
- KateMatch(KateDocument *document, KTextEditor::Search::SearchOptions options);
+ KateMatch(KTextEditor::DocumentPrivate *document, KTextEditor::Search::SearchOptions options);
KTextEditor::Range searchText(const KTextEditor::Range &range, const QString &pattern);
KTextEditor::Range replace(const QString &replacement, bool blockMode, int replacementCounter = 1);
bool isValid() const;
@@ -43,7 +43,7 @@ private:
QString buildReplacement(const QString &replacement, bool blockMode, int replacementCounter) const;
private:
- KateDocument *const m_document;
+ KTextEditor::DocumentPrivate *const m_document;
const KTextEditor::Search::SearchOptions m_options;
QVector<KTextEditor::Range> m_resultRanges;
};
diff --git a/src/search/katesearchbar.cpp b/src/search/katesearchbar.cpp
index fb9ff14..3e993df 100644
--- a/src/search/katesearchbar.cpp
+++ b/src/search/katesearchbar.cpp
@@ -831,7 +831,7 @@ int KateSearchBar::findAll(Range inputRange, const QString *replacement)
break;
}
KTextEditor::MovingCursor *workingStart =
- static_cast<KateDocument *>(m_view->document())->newMovingCursor(highlightRanges.last().end());
+ static_cast<KTextEditor::DocumentPrivate *>(m_view->document())->newMovingCursor(highlightRanges.last().end());
if (originalMatchEmpty) {
// Can happen for regex patterns like "^".
// If we don't advance here we will loop forever...
diff --git a/src/spellcheck/ontheflycheck.cpp b/src/spellcheck/ontheflycheck.cpp
index 455a77f..28c57cf 100644
--- a/src/spellcheck/ontheflycheck.cpp
+++ b/src/spellcheck/ontheflycheck.cpp
@@ -38,7 +38,7 @@
#define ON_THE_FLY_DEBUG qCDebug(LOG_PART)
-KateOnTheFlyChecker::KateOnTheFlyChecker(KateDocument *document)
+KateOnTheFlyChecker::KateOnTheFlyChecker(KTextEditor::DocumentPrivate *document)
: QObject(document),
m_document(document),
m_backgroundChecker(NULL),
@@ -59,8 +59,8 @@ KateOnTheFlyChecker::KateOnTheFlyChecker(KateDocument *document)
this, SLOT(addView(KTextEditor::Document*,KTextEditor::View*)));
connect(document, SIGNAL(highlightingModeChanged(KTextEditor::Document*)),
this, SLOT(updateConfig()));
- connect(&document->buffer(), SIGNAL(respellCheckBlock(KateDocument*,int,int)),
- this, SLOT(handleRespellCheckBlock(KateDocument*,int,int)));
+ connect(&document->buffer(), SIGNAL(respellCheckBlock(KTextEditor::DocumentPrivate*,int,int)),
+ this, SLOT(handleRespellCheckBlock(KTextEditor::DocumentPrivate*,int,int)));
// load the settings for the speller
updateConfig();
@@ -112,7 +112,7 @@ void KateOnTheFlyChecker::clearMisspellingForWord(const QString &word)
const KateOnTheFlyChecker::SpellCheckItem KateOnTheFlyChecker::invalidSpellCheckQueueItem =
SpellCheckItem(NULL, QString());
-void KateOnTheFlyChecker::handleRespellCheckBlock(KateDocument *kateDocument, int start, int end)
+void KateOnTheFlyChecker::handleRespellCheckBlock(KTextEditor::DocumentPrivate *kateDocument, int start, int end)
{
Q_ASSERT(kateDocument == m_document);
Q_UNUSED(kateDocument);
@@ -378,7 +378,7 @@ void KateOnTheFlyChecker::performSpellCheck()
deleteMovingRanges(highlightsList);
m_currentDecToEncOffsetList.clear();
- KateDocument::OffsetList encToDecOffsetList;
+ KTextEditor::DocumentPrivate::OffsetList encToDecOffsetList;
QString text = m_document->decodeCharacters(*spellCheckRange,
m_currentDecToEncOffsetList,
encToDecOffsetList);
@@ -534,7 +534,7 @@ KTextEditor::Range KateOnTheFlyChecker::findWordBoundaries(const KTextEditor::Cu
const QRegExp boundaryQuoteRegExp(QLatin1String("\\b\\w+'\\w*$")); // handle spell checking of QLatin1String("isn't"), QLatin1String("doesn't"), etc.
const QRegExp extendedBoundaryRegExp(QLatin1String("(\\W|$)"));
const QRegExp extendedBoundaryQuoteRegExp(QLatin1String("^\\w*'\\w+\\b")); // see above
- KateDocument::OffsetList decToEncOffsetList, encToDecOffsetList;
+ KTextEditor::DocumentPrivate::OffsetList decToEncOffsetList, encToDecOffsetList;
const int startLine = begin.line();
const int startColumn = begin.column();
KTextEditor::Cursor boundaryStart, boundaryEnd;
@@ -773,7 +773,7 @@ void KateOnTheFlyChecker::queueSpellCheckVisibleRange(KTextEditor::ViewPrivate *
}
}
-void KateOnTheFlyChecker::queueLineSpellCheck(KateDocument *kateDocument, int line)
+void KateOnTheFlyChecker::queueLineSpellCheck(KTextEditor::DocumentPrivate *kateDocument, int line)
{
const KTextEditor::Range range = KTextEditor::Range(line, 0, line, kateDocument->lineLength(line));
// clear all the highlights that are currently present in the range that
diff --git a/src/spellcheck/ontheflycheck.h b/src/spellcheck/ontheflycheck.h
index 03c1dd7..51d3631 100644
--- a/src/spellcheck/ontheflycheck.h
+++ b/src/spellcheck/ontheflycheck.h
@@ -53,7 +53,7 @@ class KateOnTheFlyChecker : public QObject, private KTextEditor::MovingRangeFeed
typedef QList<ModificationItem> ModificationList;
public:
- KateOnTheFlyChecker(KateDocument *document);
+ KateOnTheFlyChecker(KTextEditor::DocumentPrivate *document);
~KateOnTheFlyChecker();
QPair<KTextEditor::Range, QString> getMisspelledItem(const KTextEditor::Cursor &cursor) const;
@@ -71,7 +71,7 @@ public Q_SLOTS:
void updateInstalledMovingRanges(KTextEditor::ViewPrivate *view);
protected:
- KateDocument *const m_document;
+ KTextEditor::DocumentPrivate *const m_document;
Sonnet::Speller m_speller;
QList<SpellCheckItem> m_spellCheckQueue;
Sonnet::BackgroundChecker *m_backgroundChecker;
@@ -79,14 +79,14 @@ protected:
static const SpellCheckItem invalidSpellCheckQueueItem;
MisspelledList m_misspelledList;
ModificationList m_modificationList;
- KateDocument::OffsetList m_currentDecToEncOffsetList;
+ KTextEditor::DocumentPrivate::OffsetList m_currentDecToEncOffsetList;
QMap<KTextEditor::View *, KTextEditor::Range> m_displayRangeMap;
void freeDocument();
MovingRangeList installedMovingRanges(const KTextEditor::Range &range);
- void queueLineSpellCheck(KateDocument *document, int line);
+ void queueLineSpellCheck(KTextEditor::DocumentPrivate *document, int line);
/**
* 'range' must be on a single line
**/
@@ -133,7 +133,7 @@ protected Q_SLOTS:
void handleModifiedRanges();
void handleInsertedText(const KTextEditor::Range &range);
void handleRemovedText(const KTextEditor::Range &range);
- void handleRespellCheckBlock(KateDocument *document, int start, int end);
+ void handleRespellCheckBlock(KTextEditor::DocumentPrivate *document, int start, int end);
bool removeRangeFromModificationList(KTextEditor::MovingRange *range);
void clearModificationList();
};
diff --git a/src/spellcheck/spellcheck.cpp b/src/spellcheck/spellcheck.cpp
index 256e282..bbca232 100644
--- a/src/spellcheck/spellcheck.cpp
+++ b/src/spellcheck/spellcheck.cpp
@@ -90,7 +90,7 @@ bool lessThanRangeDictionaryPair(const QPair<KTextEditor::Range, QString> &s1,
}
}
-QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckLanguageRanges(KateDocument *doc,
+QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckLanguageRanges(KTextEditor::DocumentPrivate *doc,
const KTextEditor::Range &range)
{
QString defaultDict = doc->defaultDictionary();
@@ -127,7 +127,7 @@ QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckLang
return toReturn;
}
-QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckWrtHighlightingRanges(KateDocument *document,
+QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckWrtHighlightingRanges(KTextEditor::DocumentPrivate *document,
const KTextEditor::Range &range,
const QString &dictionary,
bool singleLine,
@@ -222,7 +222,7 @@ QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckWrtH
return toReturn;
}
-QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckRanges(KateDocument *doc,
+QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckRanges(KTextEditor::DocumentPrivate *doc,
const KTextEditor::Range &range,
bool singleLine)
{
@@ -235,15 +235,15 @@ QList<QPair<KTextEditor::Range, QString> > KateSpellCheckManager::spellCheckRang
return toReturn;
}
-void KateSpellCheckManager::replaceCharactersEncodedIfNecessary(const QString &newWord, KateDocument *doc,
+void KateSpellCheckManager::replaceCharactersEncodedIfNecessary(const QString &newWord, KTextEditor::DocumentPrivate *doc,
const KTextEditor::Range &replacementRange)
{
const QString replacedString = doc->text(replacementRange);
int attr = doc->kateTextLine(replacementRange.start().line())->attribute(replacementRange.start().column());
int p = doc->highlight()->getEncodedCharactersInsertionPolicy(attr);
- if ((p == KateDocument::EncodeAlways)
- || (p == KateDocument::EncodeWhenPresent && doc->containsCharacterEncoding(replacementRange))) {
+ if ((p == KTextEditor::DocumentPrivate::EncodeAlways)
+ || (p == KTextEditor::DocumentPrivate::EncodeWhenPresent && doc->containsCharacterEncoding(replacementRange))) {
doc->replaceText(replacementRange, newWord);
doc->replaceCharactersByEncoding(KTextEditor::Range(replacementRange.start(),
replacementRange.start() + KTextEditor::Cursor(0, newWord.length())));
@@ -252,7 +252,7 @@ void KateSpellCheckManager::replaceCharactersEncodedIfNecessary(const QString &n
}
}
-void KateSpellCheckManager::trimRange(KateDocument *doc, KTextEditor::Range &r)
+void KateSpellCheckManager::trimRange(KTextEditor::DocumentPrivate *doc, KTextEditor::Range &r)
{
if (r.isEmpty()) {
return;
diff --git a/src/spellcheck/spellcheck.h b/src/spellcheck/spellcheck.h
index 4b84763..df259be 100644
--- a/src/spellcheck/spellcheck.h
+++ b/src/spellcheck/spellcheck.h
@@ -30,7 +30,7 @@
#include <sonnet/backgroundchecker.h>
#include <sonnet/speller.h>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateSpellCheckManager : public QObject
{
@@ -53,19 +53,19 @@ public:
static QList<KTextEditor::Range> rangeDifference(const KTextEditor::Range &r1, const KTextEditor::Range &r2);
public:
- QList<QPair<KTextEditor::Range, QString> > spellCheckLanguageRanges(KateDocument *doc, const KTextEditor::Range &range);
+ QList<QPair<KTextEditor::Range, QString> > spellCheckLanguageRanges(KTextEditor::DocumentPrivate *doc, const KTextEditor::Range &range);
- QList<QPair<KTextEditor::Range, QString> > spellCheckWrtHighlightingRanges(KateDocument *doc, const KTextEditor::Range &range,
+ QList<QPair<KTextEditor::Range, QString> > spellCheckWrtHighlightingRanges(KTextEditor::DocumentPrivate *doc, const KTextEditor::Range &range,
const QString &dictionary = QString(),
bool singleLine = false,
bool returnSingleRange = false);
- QList<QPair<KTextEditor::Range, QString> > spellCheckRanges(KateDocument *doc, const KTextEditor::Range &range,
+ QList<QPair<KTextEditor::Range, QString> > spellCheckRanges(KTextEditor::DocumentPrivate *doc, const KTextEditor::Range &range,
bool singleLine = false);
- void replaceCharactersEncodedIfNecessary(const QString &newWord, KateDocument *doc, const KTextEditor::Range &replacementRange);
+ void replaceCharactersEncodedIfNecessary(const QString &newWord, KTextEditor::DocumentPrivate *doc, const KTextEditor::Range &replacementRange);
private:
- void trimRange(KateDocument *doc, KTextEditor::Range &r);
+ void trimRange(KTextEditor::DocumentPrivate *doc, KTextEditor::Range &r);
};
#endif
diff --git a/src/spellcheck/spellcheckdialog.cpp b/src/spellcheck/spellcheckdialog.cpp
index 5cfde39..a722ccb 100644
--- a/src/spellcheck/spellcheckdialog.cpp
+++ b/src/spellcheck/spellcheckdialog.cpp
@@ -190,7 +190,7 @@ void KateSpellCheckDialog::corrected(const QString &word, int pos, const QString
KTextEditor::Cursor replacementStartCursor = locatePosition(origPos);
KTextEditor::Range replacementRange = KTextEditor::Range(replacementStartCursor, length);
- KateDocument *doc = m_view->doc();
+ KTextEditor::DocumentPrivate *doc = m_view->doc();
KTextEditor::EditorPrivate::self()->spellCheckManager()->replaceCharactersEncodedIfNecessary(newWord, doc, replacementRange);
m_currentSpellCheckRange.setRange(KTextEditor::Range(replacementStartCursor, m_currentSpellCheckRange.end()));
@@ -265,7 +265,7 @@ void KateSpellCheckDialog::installNextSpellCheckRange()
m_spellLastPos = 0;
m_currentDecToEncOffsetList.clear();
- KateDocument::OffsetList encToDecOffsetList;
+ KTextEditor::DocumentPrivate::OffsetList encToDecOffsetList;
QString text = m_view->doc()->decodeCharacters(m_currentSpellCheckRange,
m_currentDecToEncOffsetList,
encToDecOffsetList);
diff --git a/src/spellcheck/spellingmenu.cpp b/src/spellcheck/spellingmenu.cpp
index a99dd56..51d933a 100644
--- a/src/spellcheck/spellingmenu.cpp
+++ b/src/spellcheck/spellingmenu.cpp
@@ -198,7 +198,7 @@ void KateSpellingMenu::populateSuggestionsMenu()
void KateSpellingMenu::replaceWordBySuggestion(const QString &suggestion)
{
- KateDocument *doc = m_view->doc();
+ KTextEditor::DocumentPrivate *doc = m_view->doc();
KTextEditor::EditorPrivate::self()->spellCheckManager()->replaceCharactersEncodedIfNecessary(suggestion, doc, *m_currentMisspelledRange);
}
diff --git a/src/src/document.cpp b/src/src/document.cpp
index 9e08cca..97139f8 100644
--- a/src/src/document.cpp
+++ b/src/src/document.cpp
@@ -19,48 +19,37 @@
*/
#include "document.h"
-#include "document.moc"
using namespace KTextEditor;
-class KTextEditor::DocumentPrivate
-{
-public:
- DocumentPrivate()
- : openingError(false) { }
- bool openingError;
- QString openingErrorMessage;
-};
-
-Document::Document(QObject *parent)
+Document::Document(DocumentPrivate *impl, QObject *parent)
: KParts::ReadWritePart(parent)
- , d(new DocumentPrivate())
+ , d (impl)
{
}
Document::~Document()
{
- delete d;
}
bool Document::openingError() const
{
- return d->openingError;
+ return false; // FIXME KF 5; d->openingError;
}
QString Document::openingErrorMessage() const
{
- return d->openingErrorMessage;
+ return QString (); //FIXME KF5 d->openingErrorMessage;
}
void Document::setOpeningError(bool errors)
{
- d->openingError = errors;
+ // FIXME KF 5; d->openingError = errors;
}
void Document::setOpeningErrorMessage(const QString &message)
{
- d->openingErrorMessage = message;
+ // FIXME KF 5; d->openingErrorMessage = message;
}
bool Document::cursorInText(const Cursor &cursor)
diff --git a/src/src/documentcursor.cpp b/src/src/documentcursor.cpp
index 08c0cbc..3a3ebc0 100644
--- a/src/src/documentcursor.cpp
+++ b/src/src/documentcursor.cpp
@@ -177,7 +177,7 @@ bool DocumentCursor::move(int chars, WrapBehavior wrapBehavior)
Cursor c(m_cursor);
- // cache lineLength to minimize calls of KateDocument::lineLength(), as
+ // cache lineLength to minimize calls of KTextEditor::DocumentPrivate::lineLength(), as
// results in locating the correct block in the text buffer every time,
// which is relatively slow
int lineLength = document()->lineLength(c.line());
diff --git a/src/swapfile/kateswapdiffcreator.cpp b/src/swapfile/kateswapdiffcreator.cpp
index 3b2703b..9fa0907 100644
--- a/src/swapfile/kateswapdiffcreator.cpp
+++ b/src/swapfile/kateswapdiffcreator.cpp
@@ -71,7 +71,7 @@ void SwapDiffCreator::viewDiff()
m_diffFile.resize(0);
// create a document with the recovered data
- KateDocument recoverDoc;
+ KTextEditor::DocumentPrivate recoverDoc;
recoverDoc.setText(m_swapFile->document()->text());
// store original text in a file as utf-8 and close it
diff --git a/src/swapfile/kateswapfile.cpp b/src/swapfile/kateswapfile.cpp
index f482af3..9b10d90 100644
--- a/src/swapfile/kateswapfile.cpp
+++ b/src/swapfile/kateswapfile.cpp
@@ -58,7 +58,7 @@ namespace Kate
QTimer *SwapFile::s_timer = 0;
-SwapFile::SwapFile(KateDocument *document)
+SwapFile::SwapFile(KTextEditor::DocumentPrivate *document)
: QObject(document)
, m_document(document)
, m_trackingEnabled(false)
@@ -136,7 +136,7 @@ void SwapFile::fileClosed()
updateFileName();
}
-KateDocument *SwapFile::document()
+KTextEditor::DocumentPrivate *SwapFile::document()
{
return m_document;
}
diff --git a/src/swapfile/kateswapfile.h b/src/swapfile/kateswapfile.h
index 410dcab..794b83b 100644
--- a/src/swapfile/kateswapfile.h
+++ b/src/swapfile/kateswapfile.h
@@ -49,14 +49,14 @@ class KTEXTEDITOR_EXPORT SwapFile : public QObject
Q_OBJECT
public:
- explicit SwapFile(KateDocument *document);
+ explicit SwapFile(KTextEditor::DocumentPrivate *document);
~SwapFile();
bool shouldRecover() const;
void fileClosed();
QString fileName();
- KateDocument *document();
+ KTextEditor::DocumentPrivate *document();
private:
void setTrackingEnabled(bool trackingEnabled);
@@ -65,7 +65,7 @@ private:
bool isValidSwapFile(QDataStream &stream, bool checkDigest) const;
private:
- KateDocument *m_document;
+ KTextEditor::DocumentPrivate *m_document;
bool m_trackingEnabled;
protected Q_SLOTS:
diff --git a/src/syntax/katehighlight.cpp b/src/syntax/katehighlight.cpp
index 848f863..05ea70a 100644
--- a/src/syntax/katehighlight.cpp
+++ b/src/syntax/katehighlight.cpp
@@ -1474,11 +1474,11 @@ void KateHighlighting::readSpellCheckingConfig()
int p;
if (policyLowerCase == QLatin1String("encodewhenpresent")) {
- p = KateDocument::EncodeWhenPresent;
+ p = KTextEditor::DocumentPrivate::EncodeWhenPresent;
} else if (policyLowerCase == QLatin1String("encodealways")) {
- p = KateDocument::EncodeAlways;
+ p = KTextEditor::DocumentPrivate::EncodeAlways;
} else {
- p = KateDocument::EncodeNever;
+ p = KTextEditor::DocumentPrivate::EncodeNever;
}
m_additionalData[buildIdentifier]->encodedCharactersInsertionPolicy = p;
diff --git a/src/syntax/katehighlightmenu.cpp b/src/syntax/katehighlightmenu.cpp
index ec68d2b..37ff429 100644
--- a/src/syntax/katehighlightmenu.cpp
+++ b/src/syntax/katehighlightmenu.cpp
@@ -58,7 +58,7 @@ void KateHighlightingMenu::init()
m_actionGroup = new QActionGroup(menu());
}
-void KateHighlightingMenu::updateMenu(KateDocument *doc)
+void KateHighlightingMenu::updateMenu(KTextEditor::DocumentPrivate *doc)
{
m_doc = doc;
}
diff --git a/src/syntax/katehighlightmenu.h b/src/syntax/katehighlightmenu.h
index 2588299..064419d 100644
--- a/src/syntax/katehighlightmenu.h
+++ b/src/syntax/katehighlightmenu.h
@@ -26,7 +26,7 @@
#include <KActionMenu>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateHighlightingMenu : public KActionMenu
{
@@ -41,12 +41,12 @@ public:
~KateHighlightingMenu();
- void updateMenu(KateDocument *doc);
+ void updateMenu(KTextEditor::DocumentPrivate *doc);
private:
void init();
- QPointer<KateDocument> m_doc;
+ QPointer<KTextEditor::DocumentPrivate> m_doc;
QStringList subMenusName;
QStringList names;
QList<QMenu *> subMenus;
diff --git a/src/syntax/katesyntaxmanager.cpp b/src/syntax/katesyntaxmanager.cpp
index 270bd7c..525bd09 100644
--- a/src/syntax/katesyntaxmanager.cpp
+++ b/src/syntax/katesyntaxmanager.cpp
@@ -172,7 +172,7 @@ void KateHlManager::getDefaults(const QString &schema, KateAttributeList &list,
KColorScheme schemeSelected(QPalette::Active, KColorScheme::Selection);
///NOTE: it's important to append in the order of the HighlightInterface::DefaultStyle
- /// enum, to make KateDocument::defaultStyle() work properly.
+ /// enum, to make KTextEditor::DocumentPrivate::defaultStyle() work properly.
{
// dsNormal
diff --git a/src/undo/katemodifiedundo.cpp b/src/undo/katemodifiedundo.cpp
index faefca4..78a58d4 100644
--- a/src/undo/katemodifiedundo.cpp
+++ b/src/undo/katemodifiedundo.cpp
@@ -26,7 +26,7 @@
#include <ktexteditor/cursor.h>
#include <ktexteditor/view.h>
-KateModifiedInsertText::KateModifiedInsertText(KateDocument *document, int line, int col, const QString &text)
+KateModifiedInsertText::KateModifiedInsertText(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text)
: KateEditInsertTextUndo(document, line, col, text)
{
setFlag(RedoLine1Modified);
@@ -39,7 +39,7 @@ KateModifiedInsertText::KateModifiedInsertText(KateDocument *document, int line,
}
}
-KateModifiedRemoveText::KateModifiedRemoveText(KateDocument *document, int line, int col, const QString &text)
+KateModifiedRemoveText::KateModifiedRemoveText(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text)
: KateEditRemoveTextUndo(document, line, col, text)
{
setFlag(RedoLine1Modified);
@@ -52,7 +52,7 @@ KateModifiedRemoveText::KateModifiedRemoveText(KateDocument *document, int line,
}
}
-KateModifiedWrapLine::KateModifiedWrapLine(KateDocument *document, int line, int col, int len, bool newLine)
+KateModifiedWrapLine::KateModifiedWrapLine(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool newLine)
: KateEditWrapLineUndo(document, line, col, len, newLine)
{
Kate::TextLine tl = document->plainKateTextLine(line);
@@ -76,7 +76,7 @@ KateModifiedWrapLine::KateModifiedWrapLine(KateDocument *document, int line, int
}
}
-KateModifiedUnWrapLine::KateModifiedUnWrapLine(KateDocument *document, int line, int col, int len, bool removeLine)
+KateModifiedUnWrapLine::KateModifiedUnWrapLine(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool removeLine)
: KateEditUnWrapLineUndo(document, line, col, len, removeLine)
{
Kate::TextLine tl = document->plainKateTextLine(line);
@@ -140,13 +140,13 @@ KateModifiedUnWrapLine::KateModifiedUnWrapLine(KateDocument *document, int line,
}
}
-KateModifiedInsertLine::KateModifiedInsertLine(KateDocument *document, int line, const QString &text)
+KateModifiedInsertLine::KateModifiedInsertLine(KTextEditor::DocumentPrivate *document, int line, const QString &text)
: KateEditInsertLineUndo(document, line, text)
{
setFlag(RedoLine1Modified);
}
-KateModifiedRemoveLine::KateModifiedRemoveLine(KateDocument *document, int line, const QString &text)
+KateModifiedRemoveLine::KateModifiedRemoveLine(KTextEditor::DocumentPrivate *document, int line, const QString &text)
: KateEditRemoveLineUndo(document, line, text)
{
Kate::TextLine tl = document->plainKateTextLine(line);
@@ -162,7 +162,7 @@ void KateModifiedInsertText::undo()
{
KateEditInsertTextUndo::undo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -174,7 +174,7 @@ void KateModifiedRemoveText::undo()
{
KateEditRemoveTextUndo::undo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -186,7 +186,7 @@ void KateModifiedWrapLine::undo()
{
KateEditWrapLineUndo::undo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -198,7 +198,7 @@ void KateModifiedUnWrapLine::undo()
{
KateEditUnWrapLineUndo::undo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -222,7 +222,7 @@ void KateModifiedRemoveLine::undo()
{
KateEditRemoveLineUndo::undo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -234,7 +234,7 @@ void KateModifiedRemoveText::redo()
{
KateEditRemoveTextUndo::redo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -246,7 +246,7 @@ void KateModifiedInsertText::redo()
{
KateEditInsertTextUndo::redo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -258,7 +258,7 @@ void KateModifiedUnWrapLine::redo()
{
KateEditUnWrapLineUndo::redo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -270,7 +270,7 @@ void KateModifiedWrapLine::redo()
{
KateEditWrapLineUndo::redo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
@@ -295,7 +295,7 @@ void KateModifiedInsertLine::redo()
{
KateEditInsertLineUndo::redo();
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
Kate::TextLine tl = doc->plainKateTextLine(line());
Q_ASSERT(tl);
diff --git a/src/undo/katemodifiedundo.h b/src/undo/katemodifiedundo.h
index db3edbc..cfbab17 100644
--- a/src/undo/katemodifiedundo.h
+++ b/src/undo/katemodifiedundo.h
@@ -26,7 +26,7 @@
class KateModifiedInsertText : public KateEditInsertTextUndo
{
public:
- KateModifiedInsertText(KateDocument *document, int line, int col, const QString &text);
+ KateModifiedInsertText(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text);
/**
* @copydoc KateUndo::undo()
@@ -45,7 +45,7 @@ public:
class KateModifiedRemoveText : public KateEditRemoveTextUndo
{
public:
- KateModifiedRemoveText(KateDocument *document, int line, int col, const QString &text);
+ KateModifiedRemoveText(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text);
/**
* @copydoc KateUndo::undo()
@@ -64,7 +64,7 @@ public:
class KateModifiedWrapLine : public KateEditWrapLineUndo
{
public:
- KateModifiedWrapLine(KateDocument *document, int line, int col, int len, bool newLine);
+ KateModifiedWrapLine(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool newLine);
/**
* @copydoc KateUndo::undo()
@@ -83,7 +83,7 @@ public:
class KateModifiedUnWrapLine : public KateEditUnWrapLineUndo
{
public:
- KateModifiedUnWrapLine(KateDocument *document, int line, int col, int len, bool removeLine);
+ KateModifiedUnWrapLine(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool removeLine);
/**
* @copydoc KateUndo::undo()
@@ -102,7 +102,7 @@ public:
class KateModifiedInsertLine : public KateEditInsertLineUndo
{
public:
- KateModifiedInsertLine(KateDocument *document, int line, const QString &text);
+ KateModifiedInsertLine(KTextEditor::DocumentPrivate *document, int line, const QString &text);
/**
* @copydoc KateUndo::undo()
@@ -120,7 +120,7 @@ public:
class KateModifiedRemoveLine : public KateEditRemoveLineUndo
{
public:
- KateModifiedRemoveLine(KateDocument *document, int line, const QString &text);
+ KateModifiedRemoveLine(KTextEditor::DocumentPrivate *document, int line, const QString &text);
/**
* @copydoc KateUndo::undo()
diff --git a/src/undo/kateundo.cpp b/src/undo/kateundo.cpp
index 77a2d42..a08efea 100644
--- a/src/undo/kateundo.cpp
+++ b/src/undo/kateundo.cpp
@@ -29,7 +29,7 @@
#include <ktexteditor/cursor.h>
#include <ktexteditor/view.h>
-KateUndo::KateUndo(KateDocument *document)
+KateUndo::KateUndo(KTextEditor::DocumentPrivate *document)
: m_document(document)
, m_lineModFlags(0x00)
{
@@ -39,7 +39,7 @@ KateUndo::~KateUndo()
{
}
-KateEditInsertTextUndo::KateEditInsertTextUndo(KateDocument *document, int line, int col, const QString &text)
+KateEditInsertTextUndo::KateEditInsertTextUndo(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text)
: KateUndo(document)
, m_line(line)
, m_col(col)
@@ -47,7 +47,7 @@ KateEditInsertTextUndo::KateEditInsertTextUndo(KateDocument *document, int line,
{
}
-KateEditRemoveTextUndo::KateEditRemoveTextUndo(KateDocument *document, int line, int col, const QString &text)
+KateEditRemoveTextUndo::KateEditRemoveTextUndo(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text)
: KateUndo(document)
, m_line(line)
, m_col(col)
@@ -55,7 +55,7 @@ KateEditRemoveTextUndo::KateEditRemoveTextUndo(KateDocument *document, int line,
{
}
-KateEditWrapLineUndo::KateEditWrapLineUndo(KateDocument *document, int line, int col, int len, bool newLine)
+KateEditWrapLineUndo::KateEditWrapLineUndo(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool newLine)
: KateUndo(document)
, m_line(line)
, m_col(col)
@@ -64,7 +64,7 @@ KateEditWrapLineUndo::KateEditWrapLineUndo(KateDocument *document, int line, int
{
}
-KateEditUnWrapLineUndo::KateEditUnWrapLineUndo(KateDocument *document, int line, int col, int len, bool removeLine)
+KateEditUnWrapLineUndo::KateEditUnWrapLineUndo(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool removeLine)
: KateUndo(document)
, m_line(line)
, m_col(col)
@@ -73,14 +73,14 @@ KateEditUnWrapLineUndo::KateEditUnWrapLineUndo(KateDocument *document, int line,
{
}
-KateEditInsertLineUndo::KateEditInsertLineUndo(KateDocument *document, int line, const QString &text)
+KateEditInsertLineUndo::KateEditInsertLineUndo(KTextEditor::DocumentPrivate *document, int line, const QString &text)
: KateUndo(document)
, m_line(line)
, m_text(text)
{
}
-KateEditRemoveLineUndo::KateEditRemoveLineUndo(KateDocument *document, int line, const QString &text)
+KateEditRemoveLineUndo::KateEditRemoveLineUndo(KTextEditor::DocumentPrivate *document, int line, const QString &text)
: KateUndo(document)
, m_line(line)
, m_text(text)
@@ -137,98 +137,98 @@ bool KateEditRemoveTextUndo::mergeWith(const KateUndo *undo)
void KateEditInsertTextUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editRemoveText(m_line, m_col, len());
}
void KateEditRemoveTextUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editInsertText(m_line, m_col, m_text);
}
void KateEditWrapLineUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editUnWrapLine(m_line, m_newLine, m_len);
}
void KateEditUnWrapLineUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editWrapLine(m_line, m_col, m_removeLine);
}
void KateEditInsertLineUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editRemoveLine(m_line);
}
void KateEditRemoveLineUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editInsertLine(m_line, m_text);
}
void KateEditMarkLineAutoWrappedUndo::undo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editMarkLineAutoWrapped(m_line, m_autowrapped);
}
void KateEditRemoveTextUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editRemoveText(m_line, m_col, len());
}
void KateEditInsertTextUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editInsertText(m_line, m_col, m_text);
}
void KateEditUnWrapLineUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editUnWrapLine(m_line, m_removeLine, m_len);
}
void KateEditWrapLineUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editWrapLine(m_line, m_col, m_newLine);
}
void KateEditRemoveLineUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editRemoveLine(m_line);
}
void KateEditInsertLineUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editInsertLine(m_line, m_text);
}
void KateEditMarkLineAutoWrappedUndo::redo()
{
- KateDocument *doc = document();
+ KTextEditor::DocumentPrivate *doc = document();
doc->editMarkLineAutoWrapped(m_line, m_autowrapped);
}
diff --git a/src/undo/kateundo.h b/src/undo/kateundo.h
index 9f46cd9..dcb5c1b 100644
--- a/src/undo/kateundo.h
+++ b/src/undo/kateundo.h
@@ -30,7 +30,7 @@
#include <QBitArray>
class KateUndoManager;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor
{
@@ -47,7 +47,7 @@ public:
* Constructor
* @param document the document the undo item belongs to
*/
- KateUndo(KateDocument *document);
+ KateUndo(KTextEditor::DocumentPrivate *document);
/**
* Destructor
@@ -106,7 +106,7 @@ protected:
* Return the document the undo item belongs to.
* @return the document the undo item belongs to
*/
- inline KateDocument *document()
+ inline KTextEditor::DocumentPrivate *document()
{
return m_document;
}
@@ -115,7 +115,7 @@ private:
/**
* the document the undo item belongs to
*/
- KateDocument *m_document;
+ KTextEditor::DocumentPrivate *m_document;
//
// Line modification system
@@ -163,7 +163,7 @@ private:
class KateEditInsertTextUndo : public KateUndo
{
public:
- KateEditInsertTextUndo(KateDocument *document, int line, int col, const QString &text);
+ KateEditInsertTextUndo(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text);
/**
* @copydoc KateUndo::isEmpty()
@@ -212,7 +212,7 @@ private:
class KateEditRemoveTextUndo : public KateUndo
{
public:
- KateEditRemoveTextUndo(KateDocument *document, int line, int col, const QString &text);
+ KateEditRemoveTextUndo(KTextEditor::DocumentPrivate *document, int line, int col, const QString &text);
/**
* @copydoc KateUndo::isEmpty()
@@ -261,7 +261,7 @@ private:
class KateEditMarkLineAutoWrappedUndo : public KateUndo
{
public:
- KateEditMarkLineAutoWrappedUndo(KateDocument *document, int line, bool autowrapped)
+ KateEditMarkLineAutoWrappedUndo(KTextEditor::DocumentPrivate *document, int line, bool autowrapped)
: KateUndo(document)
, m_line(line)
, m_autowrapped(autowrapped)
@@ -293,7 +293,7 @@ private:
class KateEditWrapLineUndo : public KateUndo
{
public:
- KateEditWrapLineUndo(KateDocument *document, int line, int col, int len, bool newLine);
+ KateEditWrapLineUndo(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool newLine);
/**
* @copydoc KateUndo::undo()
@@ -329,7 +329,7 @@ private:
class KateEditUnWrapLineUndo : public KateUndo
{
public:
- KateEditUnWrapLineUndo(KateDocument *document, int line, int col, int len, bool removeLine);
+ KateEditUnWrapLineUndo(KTextEditor::DocumentPrivate *document, int line, int col, int len, bool removeLine);
/**
* @copydoc KateUndo::undo()
@@ -365,7 +365,7 @@ private:
class KateEditInsertLineUndo : public KateUndo
{
public:
- KateEditInsertLineUndo(KateDocument *document, int line, const QString &text);
+ KateEditInsertLineUndo(KTextEditor::DocumentPrivate *document, int line, const QString &text);
/**
* @copydoc KateUndo::undo()
@@ -399,7 +399,7 @@ private:
class KateEditRemoveLineUndo : public KateUndo
{
public:
- KateEditRemoveLineUndo(KateDocument *document, int line, const QString &text);
+ KateEditRemoveLineUndo(KTextEditor::DocumentPrivate *document, int line, const QString &text);
/**
* @copydoc KateUndo::undo()
diff --git a/src/undo/kateundomanager.cpp b/src/undo/kateundomanager.cpp
index 19808ce..52e0060 100644
--- a/src/undo/kateundomanager.cpp
+++ b/src/undo/kateundomanager.cpp
@@ -27,7 +27,7 @@
#include <QBitArray>
-KateUndoManager::KateUndoManager(KateDocument *doc)
+KateUndoManager::KateUndoManager(KTextEditor::DocumentPrivate *doc)
: QObject(doc)
, m_document(doc)
, m_undoComplexMerge(false)
diff --git a/src/undo/kateundomanager.h b/src/undo/kateundomanager.h
index 92d8717..94a7600 100644
--- a/src/undo/kateundomanager.h
+++ b/src/undo/kateundomanager.h
@@ -26,7 +26,7 @@
#include <QList>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateUndo;
class KateUndoGroup;
@@ -54,7 +54,7 @@ public:
*
* @param doc the document the KateUndoManager will belong to
*/
- KateUndoManager(KateDocument *doc);
+ KateUndoManager(KTextEditor::DocumentPrivate *doc);
~KateUndoManager();
@@ -210,7 +210,7 @@ private:
KTextEditor::View *activeView();
private:
- KateDocument *m_document;
+ KTextEditor::DocumentPrivate *m_document;
bool m_undoComplexMerge;
bool m_isActive;
KateUndoGroup *m_editCurrentUndo;
diff --git a/src/utils/kateautoindent.cpp b/src/utils/kateautoindent.cpp
index 8793f6f..6732958 100644
--- a/src/utils/kateautoindent.cpp
+++ b/src/utils/kateautoindent.cpp
@@ -114,7 +114,7 @@ uint KateAutoIndent::modeNumber(const QString &name)
return 0;
}
-KateAutoIndent::KateAutoIndent(KateDocument *_doc)
+KateAutoIndent::KateAutoIndent(KTextEditor::DocumentPrivate *_doc)
: QObject(_doc), doc(_doc), m_script(0)
{
// don't call updateConfig() here, document might is not ready for that....
@@ -457,7 +457,7 @@ void KateAutoIndent::userTypedChar(KTextEditor::ViewPrivate *view, const KTextEd
//END KateAutoIndent
//BEGIN KateViewIndentAction
-KateViewIndentationAction::KateViewIndentationAction(KateDocument *_doc, const QString &text, QObject *parent)
+KateViewIndentationAction::KateViewIndentationAction(KTextEditor::DocumentPrivate *_doc, const QString &text, QObject *parent)
: KActionMenu(text, parent), doc(_doc)
{
connect(menu(), SIGNAL(aboutToShow()), this, SLOT(slotAboutToShow()));
diff --git a/src/utils/kateautoindent.h b/src/utils/kateautoindent.h
index 72c74fb..fab8159 100644
--- a/src/utils/kateautoindent.h
+++ b/src/utils/kateautoindent.h
@@ -28,7 +28,7 @@
#include <ktexteditor/cursor.h>
#include <KActionMenu>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateIndentScript;
class KateHighlighting;
@@ -98,7 +98,7 @@ public:
* Constructor, creates dummy indenter "None"
* \param doc parent document
*/
- explicit KateAutoIndent(KateDocument *doc);
+ explicit KateAutoIndent(KTextEditor::DocumentPrivate *doc);
/**
* Destructor
@@ -222,7 +222,7 @@ public Q_SLOTS:
* needed data
*/
private:
- KateDocument *doc; //!< the document the indenter works on
+ KTextEditor::DocumentPrivate *doc; //!< the document the indenter works on
int tabWidth; //!< The number of characters simulated for a tab
int indentWidth; //!< The number of characters used when tabs are replaced by spaces
bool useSpaces; //!< Should we use spaces or tabs to indent
@@ -240,10 +240,10 @@ class KateViewIndentationAction : public KActionMenu
Q_OBJECT
public:
- KateViewIndentationAction(KateDocument *_doc, const QString &text, QObject *parent);
+ KateViewIndentationAction(KTextEditor::DocumentPrivate *_doc, const QString &text, QObject *parent);
private:
- KateDocument *doc;
+ KTextEditor::DocumentPrivate *doc;
QActionGroup *actionGroup;
public Q_SLOTS:
diff --git a/src/utils/katecmds.cpp b/src/utils/katecmds.cpp
index b5a12df..07e32bc 100644
--- a/src/utils/katecmds.cpp
+++ b/src/utils/katecmds.cpp
@@ -341,7 +341,7 @@ bool KateCommands::CoreCommands::exec(KTextEditor::View *view,
return true;
} else if (cmd == QLatin1String("set-highlight")) {
if (v->doc()->setHighlightingMode(args.first())) {
- static_cast<KateDocument *>(v->doc())->setDontChangeHlOnSave();
+ static_cast<KTextEditor::DocumentPrivate *>(v->doc())->setDontChangeHlOnSave();
return true;
}
@@ -922,7 +922,7 @@ bool KateCommands::SedReplace::exec(class KTextEditor::View *view, const QString
}
KTextEditor::ViewPrivate *kateView = static_cast<KTextEditor::ViewPrivate *>(view);
- KateDocument *doc = kateView->doc();
+ KTextEditor::DocumentPrivate *doc = kateView->doc();
if (!doc) {
return false;
}
@@ -985,7 +985,7 @@ bool KateCommands::SedReplace::parse(const QString &sedReplaceString, QString &d
return true;
}
-KateCommands::SedReplace::InteractiveSedReplacer::InteractiveSedReplacer(KateDocument *doc, const QString &findPattern, const QString &replacePattern, bool caseSensitive, bool onlyOnePerLine, int startLine, int endLine)
+KateCommands::SedReplace::InteractiveSedReplacer::InteractiveSedReplacer(KTextEditor::DocumentPrivate *doc, const QString &findPattern, const QString &replacePattern, bool caseSensitive, bool onlyOnePerLine, int startLine, int endLine)
: m_findPattern(findPattern),
m_replacePattern(replacePattern),
m_onlyOnePerLine(onlyOnePerLine),
diff --git a/src/utils/katecmds.h b/src/utils/katecmds.h
index b6b9d0e..a6535f4 100644
--- a/src/utils/katecmds.h
+++ b/src/utils/katecmds.h
@@ -29,7 +29,7 @@
#include <QStringList>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KCompletion;
/**
@@ -311,7 +311,7 @@ public:
class InteractiveSedReplacer
{
public:
- InteractiveSedReplacer(KateDocument *doc, const QString &findPattern, const QString &replacePattern, bool caseSensitive, bool onlyOnePerLine, int startLine, int endLine);
+ InteractiveSedReplacer(KTextEditor::DocumentPrivate *doc, const QString &findPattern, const QString &replacePattern, bool caseSensitive, bool onlyOnePerLine, int startLine, int endLine);
/**
* Will return invalid Range if there are no further matches.
*/
@@ -327,7 +327,7 @@ public:
bool m_onlyOnePerLine;
int m_startLine;
int m_endLine;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KateRegExpSearch m_regExpSearch;
int m_numReplacementsDone;
diff --git a/src/utils/kateconfig.cpp b/src/utils/kateconfig.cpp
index 2f0aa21..be29baf 100644
--- a/src/utils/kateconfig.cpp
+++ b/src/utils/kateconfig.cpp
@@ -249,7 +249,7 @@ KateDocumentConfig::KateDocumentConfig(const KConfigGroup &cg)
readConfig(cg);
}
-KateDocumentConfig::KateDocumentConfig(KateDocument *doc)
+KateDocumentConfig::KateDocumentConfig(KTextEditor::DocumentPrivate *doc)
: m_tabHandling(tabSmart),
m_configFlags(0),
m_tabWidthSet(false),
@@ -2308,7 +2308,7 @@ void KateRendererConfig::setSchemaInternal(const QString &schema)
m_replaceHighlightColor = config.readEntry("Color Replace Highlight", QColor(Qt::green)); // tmp10);
m_replaceHighlightColorSet = true;
- // same std colors like in KateDocument::markColor
+ // same std colors like in KTextEditor::DocumentPrivate::markColor
QColor mark[7];
mark[0] = Qt::blue;
mark[1] = Qt::red;
diff --git a/src/utils/kateconfig.h b/src/utils/kateconfig.h
index d292b84..c4a1d19 100644
--- a/src/utils/kateconfig.h
+++ b/src/utils/kateconfig.h
@@ -34,7 +34,7 @@
class KConfigGroup;
namespace KTextEditor { class ViewPrivate; }
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateRenderer;
namespace KTextEditor {
@@ -162,7 +162,7 @@ public:
/**
* Construct a DocumentConfig
*/
- KateDocumentConfig(KateDocument *doc);
+ KateDocumentConfig(KTextEditor::DocumentPrivate *doc);
/**
* Cu DocumentConfig
@@ -396,7 +396,7 @@ private:
private:
static KateDocumentConfig *s_global;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
};
class KTEXTEDITOR_EXPORT KateViewConfig : public KateConfig
diff --git a/src/utils/katefactory.cpp b/src/utils/katefactory.cpp
index 3ecb4ab..3ffb527 100644
--- a/src/utils/katefactory.cpp
+++ b/src/utils/katefactory.cpp
@@ -74,7 +74,7 @@ public:
// should we be readonly?
bool bWantReadOnly = (classname == "KParts::ReadOnlyPart");
- KParts::ReadWritePart *part = new KateDocument (bWantSingleView, bWantReadOnly, parentWidget, parent);
+ KParts::ReadWritePart *part = new KTextEditor::DocumentPrivate (bWantSingleView, bWantReadOnly, parentWidget, parent);
part->setReadWrite(!bWantReadOnly);
return part;
diff --git a/src/utils/kateglobal.cpp b/src/utils/kateglobal.cpp
index 9b6ac3b..2d277f7 100644
--- a/src/utils/kateglobal.cpp
+++ b/src/utils/kateglobal.cpp
@@ -241,7 +241,7 @@ KTextEditor::EditorPrivate::~EditorPrivate()
KTextEditor::Document *KTextEditor::EditorPrivate::createDocument(QObject *parent)
{
- KateDocument *doc = new KateDocument(false, false, 0, parent);
+ KTextEditor::DocumentPrivate *doc = new KTextEditor::DocumentPrivate(false, false, 0, parent);
emit documentCreated(this, doc);
@@ -484,13 +484,13 @@ KTextEditor::EditorPrivate *KTextEditor::EditorPrivate::self()
return staticInstance.data();
}
-void KTextEditor::EditorPrivate::registerDocument(KateDocument *doc)
+void KTextEditor::EditorPrivate::registerDocument(KTextEditor::DocumentPrivate *doc)
{
m_documents.append(doc);
m_docs.append(doc);
}
-void KTextEditor::EditorPrivate::deregisterDocument(KateDocument *doc)
+void KTextEditor::EditorPrivate::deregisterDocument(KTextEditor::DocumentPrivate *doc)
{
m_docs.removeAll(doc);
m_documents.removeAll(doc);
diff --git a/src/utils/kateglobal.h b/src/utils/kateglobal.h
index a1d54b9..a8ccee2 100644
--- a/src/utils/kateglobal.h
+++ b/src/utils/kateglobal.h
@@ -43,7 +43,7 @@ class KateGlobalConfig;
class KateDocumentConfig;
class KateViewConfig;
class KateRendererConfig;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
class KateScriptManager;
class KDirWatch;
@@ -231,13 +231,13 @@ public:
* this allows us to loop over all docs for example on config changes
* @param doc document to register
*/
- void registerDocument(KateDocument *doc);
+ void registerDocument(KTextEditor::DocumentPrivate *doc);
/**
* unregister document at the factory
* @param doc document to register
*/
- void deregisterDocument(KateDocument *doc);
+ void deregisterDocument(KTextEditor::DocumentPrivate *doc);
/**
* register view at the factory
@@ -256,7 +256,7 @@ public:
* return a list of all registered docs
* @return all known documents
*/
- QList<KateDocument *> &kateDocuments()
+ QList<KTextEditor::DocumentPrivate *> &kateDocuments()
{
return m_documents;
}
@@ -455,7 +455,7 @@ private:
/**
* registered docs
*/
- QList<KateDocument *> m_documents;
+ QList<KTextEditor::DocumentPrivate *> m_documents;
/**
* registered views
diff --git a/src/utils/katetemplatehandler.cpp b/src/utils/katetemplatehandler.cpp
index f7ff055..6e7fec2 100644
--- a/src/utils/katetemplatehandler.cpp
+++ b/src/utils/katetemplatehandler.cpp
@@ -240,7 +240,7 @@ void KateTemplateHandler::jumpToFinalCursorPosition()
}
}
-KateDocument *KateTemplateHandler::doc()
+KTextEditor::DocumentPrivate *KateTemplateHandler::doc()
{
return m_view->doc();
}
diff --git a/src/utils/katetemplatehandler.h b/src/utils/katetemplatehandler.h
index d06c192..692099e 100644
--- a/src/utils/katetemplatehandler.h
+++ b/src/utils/katetemplatehandler.h
@@ -30,7 +30,7 @@
#include <QList>
#include <QRegExp>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
@@ -65,7 +65,7 @@ class MovingRange;
* exists in the template,the cursor will be placed there. Else the cursor will
* be placed at the end of the template.
*
- * \see KateDocument::insertTemplateTextImplementation(), KTextEditor::TemplateInterface
+ * \see KTextEditor::DocumentPrivate::insertTemplateTextImplementation(), KTextEditor::TemplateInterface
*
* \author Milian Wolff <mail@milianw.de>
*/
@@ -198,7 +198,7 @@ private:
*/
void jumpToFinalCursorPosition();
- KateDocument *doc();
+ KTextEditor::DocumentPrivate *doc();
private Q_SLOTS:
/**
diff --git a/src/variableeditor/variablelineedit.cpp b/src/variableeditor/variablelineedit.cpp
index eb0d4ad..6a1e9da 100644
--- a/src/variableeditor/variablelineedit.cpp
+++ b/src/variableeditor/variablelineedit.cpp
@@ -118,7 +118,7 @@ void VariableLineEdit::addKateItems(VariableListView *listview)
// If a current active doc is available
KTextEditor::ViewPrivate *activeView = 0;
- KateDocument *activeDoc = 0;
+ KTextEditor::DocumentPrivate *activeDoc = 0;
KateDocumentConfig *docConfig = KateDocumentConfig::global();
KateViewConfig *viewConfig = KateViewConfig::global();
diff --git a/src/view/katetextanimation.h b/src/view/katetextanimation.h
index f6f01c3..45b2ba0 100644
--- a/src/view/katetextanimation.h
+++ b/src/view/katetextanimation.h
@@ -28,7 +28,7 @@
#include <ktexteditor/range.h>
#include <ktexteditor/attribute.h>
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateViewInternal;
class QTimeLine;
class QPainter;
@@ -61,7 +61,7 @@ private:
QString m_text;
KTextEditor::Attribute::Ptr m_attribute;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KateViewInternal *m_view;
QTimeLine *m_timeLine;
qreal m_value;
diff --git a/src/view/kateview.cpp b/src/view/kateview.cpp
index fd9d17d..f3f215e 100644
--- a/src/view/kateview.cpp
+++ b/src/view/kateview.cpp
@@ -101,7 +101,7 @@ void KTextEditor::ViewPrivate::blockFix(KTextEditor::Range &range)
}
}
-KTextEditor::ViewPrivate::ViewPrivate(KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow)
+KTextEditor::ViewPrivate::ViewPrivate(KTextEditor::DocumentPrivate *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow)
: KTextEditor::View (this, parent)
, m_completionWidget(0)
, m_annotationModel(0)
@@ -2544,7 +2544,7 @@ void KTextEditor::ViewPrivate::toggleComment()
void KTextEditor::ViewPrivate::uppercase()
{
- m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Uppercase);
+ m_doc->transform(this, m_viewInternal->m_cursor, KTextEditor::DocumentPrivate::Uppercase);
}
void KTextEditor::ViewPrivate::killLine()
@@ -2562,14 +2562,14 @@ void KTextEditor::ViewPrivate::killLine()
void KTextEditor::ViewPrivate::lowercase()
{
- m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Lowercase);
+ m_doc->transform(this, m_viewInternal->m_cursor, KTextEditor::DocumentPrivate::Lowercase);
}
void KTextEditor::ViewPrivate::capitalize()
{
m_doc->editStart();
- m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Lowercase);
- m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Capitalize);
+ m_doc->transform(this, m_viewInternal->m_cursor, KTextEditor::DocumentPrivate::Lowercase);
+ m_doc->transform(this, m_viewInternal->m_cursor, KTextEditor::DocumentPrivate::Capitalize);
m_doc->editEnd();
}
diff --git a/src/view/kateview.h b/src/view/kateview.h
index f9a295c..a6b2072 100644
--- a/src/view/kateview.h
+++ b/src/view/kateview.h
@@ -48,7 +48,7 @@ class AnnotationModel;
class Message;
}
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateBookmarks;
class KateCommandLineBar;
class KateViewConfig;
@@ -100,7 +100,7 @@ class KTEXTEDITOR_EXPORT ViewPrivate : public KTextEditor::View,
friend class ::KateViModeBase;
public:
- ViewPrivate (KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow = nullptr);
+ ViewPrivate (KTextEditor::DocumentPrivate *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow = nullptr);
~ViewPrivate ();
/**
@@ -563,11 +563,11 @@ public:
* accessor to katedocument pointer
* @return pointer to document
*/
- KateDocument *doc()
+ KTextEditor::DocumentPrivate *doc()
{
return m_doc;
}
- const KateDocument *doc() const
+ const KTextEditor::DocumentPrivate *doc() const
{
return m_doc;
}
@@ -655,7 +655,7 @@ private:
bool m_hasWrap;
- KateDocument *const m_doc;
+ KTextEditor::DocumentPrivate *const m_doc;
Kate::TextFolding m_textFolding;
KateViewConfig *const m_config;
KateRenderer *const m_renderer;
diff --git a/src/view/kateviewhelpers.cpp b/src/view/kateviewhelpers.cpp
index ddcaf5f..c54052b 100644
--- a/src/view/kateviewhelpers.cpp
+++ b/src/view/kateviewhelpers.cpp
@@ -2185,7 +2185,7 @@ void KateViewEncodingAction::Private::_k_subActionTriggered(QAction *action)
}
}
-KateViewEncodingAction::KateViewEncodingAction(KateDocument *_doc, KTextEditor::ViewPrivate *_view, const QString &text, QObject *parent)
+KateViewEncodingAction::KateViewEncodingAction(KTextEditor::DocumentPrivate *_doc, KTextEditor::ViewPrivate *_view, const QString &text, QObject *parent)
: KSelectAction(text, parent), doc(_doc), view(_view), d(new Private(this))
{
d->init();
diff --git a/src/view/kateviewhelpers.h b/src/view/kateviewhelpers.h
index 129cf64..aff4b7f 100644
--- a/src/view/kateviewhelpers.h
+++ b/src/view/kateviewhelpers.h
@@ -38,7 +38,7 @@
#include <ktexteditor_export.h>
#include "katetextline.h"
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
class KateViewInternal;
@@ -149,7 +149,7 @@ private:
bool m_leftMouseDown;
KTextEditor::ViewPrivate *m_view;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
class KateViewInternal *m_viewInternal;
QHash<int, QColor> m_lines;
@@ -258,7 +258,7 @@ private:
int annotationLineWidth(int line);
KTextEditor::ViewPrivate *m_view;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KateViewInternal *m_viewInternal;
bool m_iconBorderOn: 1;
@@ -303,7 +303,7 @@ class KateViewEncodingAction: public KSelectAction
Q_PROPERTY(int codecMib READ currentCodecMib)
public:
- KateViewEncodingAction(KateDocument *_doc, KTextEditor::ViewPrivate *_view, const QString &text, QObject *parent);
+ KateViewEncodingAction(KTextEditor::DocumentPrivate *_doc, KTextEditor::ViewPrivate *_view, const QString &text, QObject *parent);
~KateViewEncodingAction();
@@ -326,7 +326,7 @@ Q_SIGNALS:
void triggered(QTextCodec *codec);
private:
- KateDocument *doc;
+ KTextEditor::DocumentPrivate *doc;
KTextEditor::ViewPrivate *view;
class Private
diff --git a/src/view/kateviewinternal.cpp b/src/view/kateviewinternal.cpp
index afb670c..b6d4f09 100644
--- a/src/view/kateviewinternal.cpp
+++ b/src/view/kateviewinternal.cpp
@@ -968,11 +968,11 @@ protected:
{
return m_vi->m_view;
}
- KateDocument *doc()
+ KTextEditor::DocumentPrivate *doc()
{
return view()->doc();
}
- const KateDocument *doc() const
+ const KTextEditor::DocumentPrivate *doc() const
{
return view()->doc();
}
@@ -3625,7 +3625,7 @@ void KateViewInternal::inputMethodEvent(QInputMethodEvent *e)
doc()->removeText(KTextEditor::Range(start, removeEnd));
}
if (!e->commitString().isEmpty()) {
- // if the input method event is text that should be inserted, call KateDocument::typeChars()
+ // if the input method event is text that should be inserted, call KTextEditor::DocumentPrivate::typeChars()
// with the text. that method will handle the input and take care of overwrite mode, etc.
doc()->typeChars(m_view, e->commitString());
}
diff --git a/src/view/kateviewinternal.h b/src/view/kateviewinternal.h
index 8463d8c..6d370ef 100644
--- a/src/view/kateviewinternal.h
+++ b/src/view/kateviewinternal.h
@@ -440,11 +440,11 @@ private:
void cursorMoved();
private:
- inline KateDocument *doc()
+ inline KTextEditor::DocumentPrivate *doc()
{
return m_view->doc();
}
- inline KateDocument *doc() const
+ inline KTextEditor::DocumentPrivate *doc() const
{
return m_view->doc();
}
diff --git a/src/vimode/kateviinputmodemanager.cpp b/src/vimode/kateviinputmodemanager.cpp
index 9aeb442..a3002fd 100644
--- a/src/vimode/kateviinputmodemanager.cpp
+++ b/src/vimode/kateviinputmodemanager.cpp
@@ -718,7 +718,7 @@ void KateViInputModeManager::PrintJumpList()
}
-void KateViInputModeManager::addMark(KateDocument *doc, const QChar &mark, const Cursor &pos,
+void KateViInputModeManager::addMark(KTextEditor::DocumentPrivate *doc, const QChar &mark, const Cursor &pos,
const bool moveoninsert, const bool showmark)
{
m_markSetInsideViInputModeManager = true;
diff --git a/src/vimode/kateviinputmodemanager.h b/src/vimode/kateviinputmodemanager.h
index 0f46840..a3c367d 100644
--- a/src/vimode/kateviinputmodemanager.h
+++ b/src/vimode/kateviinputmodemanager.h
@@ -32,7 +32,7 @@
class KConfigGroup;
namespace KTextEditor { class ViewPrivate; }
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateViewInternal;
class KateViModeBase;
class KateViNormalMode;
@@ -308,7 +308,7 @@ public:
* when inserting text at it
* @param showmark whether to highlight the mark's line
*/
- void addMark(KateDocument *doc, const QChar &mark, const KTextEditor::Cursor &pos,
+ void addMark(KTextEditor::DocumentPrivate *doc, const QChar &mark, const KTextEditor::Cursor &pos,
const bool moveoninsert = true, const bool showmark = true);
KTextEditor::Cursor getMarkPosition(const QChar &mark) const;
void syncViMarksAndBookmarks();
diff --git a/src/vimode/katevikeymapper.cpp b/src/vimode/katevikeymapper.cpp
index 798709e..e133796 100644
--- a/src/vimode/katevikeymapper.cpp
+++ b/src/vimode/katevikeymapper.cpp
@@ -26,7 +26,7 @@
#include <QTimer>
-KateViKeyMapper::KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *doc, KTextEditor::ViewPrivate *view)
+KateViKeyMapper::KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KTextEditor::DocumentPrivate *doc, KTextEditor::ViewPrivate *view)
: m_viInputModeManager(kateViInputModeManager),
m_doc(doc),
m_view(view)
diff --git a/src/vimode/katevikeymapper.h b/src/vimode/katevikeymapper.h
index 7a3e9a6..258146b 100644
--- a/src/vimode/katevikeymapper.h
+++ b/src/vimode/katevikeymapper.h
@@ -25,7 +25,7 @@
#include <ktexteditor_export.h>
class KateViInputModeManager;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
namespace KTextEditor { class ViewPrivate; }
class QTimer;
@@ -34,7 +34,7 @@ class KTEXTEDITOR_EXPORT KateViKeyMapper : public QObject
{
Q_OBJECT
public:
- KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *doc, KTextEditor::ViewPrivate *view);
+ KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KTextEditor::DocumentPrivate *doc, KTextEditor::ViewPrivate *view);
bool handleKeypress(QChar key);
void setMappingTimeout(int timeoutMS);
void setDoNotMapNextKeypress();
@@ -54,7 +54,7 @@ private:
bool m_doNotExpandFurtherMappings;
QTimer *m_mappingTimer;
KateViInputModeManager *m_viInputModeManager;
- KateDocument *m_doc;
+ KTextEditor::DocumentPrivate *m_doc;
KTextEditor::ViewPrivate *m_view;
int m_timeoutlen; // time to wait for the next keypress of a multi-key mapping (default: 1000 ms)
bool m_doNotMapNextKeypress;
diff --git a/src/vimode/katevimodebase.h b/src/vimode/katevimodebase.h
index 4027716..3176bf5 100644
--- a/src/vimode/katevimodebase.h
+++ b/src/vimode/katevimodebase.h
@@ -39,7 +39,7 @@ class QKeyEvent;
class QString;
class QRegExp;
class QTimer;
-class KateDocument;
+namespace KTextEditor { class DocumentPrivate; }
class KateViVisualMode;
class KateViNormalMode;
class KateViInputModeManager;
@@ -170,7 +170,7 @@ protected:
KTextEditor::Cursor getNextJump(KTextEditor::Cursor) const;
KTextEditor::Cursor getPrevJump(KTextEditor::Cursor) const;
- inline KateDocument *doc() const
+ inline KTextEditor::DocumentPrivate *doc() const
{
return m_view->doc();
};