aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-19 12:38:59 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-19 12:38:59 (GMT)
commite9a418bcfb198a78c04667d02e5aab9c4d16f59d (patch)
treefa9c4f43951f4a3e1fceee2c3c792f0aa5e72201
parent6c48751ad38e461befe40ae64575268a1d94ea46 (diff)
add same trick for KTextEditor::View, internally store pointer to ViewPrivate implementation to allow to have non-virtual funtions for extensions
-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.cpp2
-rw-r--r--autotests/src/completion_test.cpp8
-rw-r--r--autotests/src/completion_test.h4
-rw-r--r--autotests/src/katefoldingtest.cpp4
-rw-r--r--autotests/src/kateview_test.cpp14
-rw-r--r--autotests/src/messagetest.cpp18
-rw-r--r--autotests/src/movingrange_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/searchbar_test.cpp36
-rw-r--r--autotests/src/templatehandler_test.cpp2
-rw-r--r--autotests/src/testutils.cpp6
-rw-r--r--autotests/src/testutils.h8
-rw-r--r--autotests/src/undomanager_test.cpp6
-rw-r--r--autotests/src/vimode_test.cpp16
-rw-r--r--autotests/src/vimode_test.h6
-rw-r--r--src/buffer/katetextbuffer.cpp2
-rw-r--r--src/completion/katecompletionmodel.cpp2
-rw-r--r--src/completion/katecompletionmodel.h4
-rw-r--r--src/completion/katecompletionwidget.cpp6
-rw-r--r--src/completion/katecompletionwidget.h6
-rw-r--r--src/completion/katewordcompletion.cpp8
-rw-r--r--src/dialogs/katedialogs.cpp4
-rw-r--r--src/dialogs/katedialogs.h6
-rw-r--r--src/document/katedocument.cpp86
-rw-r--r--src/document/katedocument.h34
-rw-r--r--src/include/ktexteditor/view.h12
-rw-r--r--src/mode/katemodeconfigpage.cpp2
-rw-r--r--src/printing/kateprinter.cpp10
-rw-r--r--src/printing/kateprinter.h6
-rw-r--r--src/printing/printpainter.cpp2
-rw-r--r--src/printing/printpainter.h6
-rw-r--r--src/render/katerenderer.cpp2
-rw-r--r--src/render/katerenderer.h8
-rw-r--r--src/schema/kateschema.cpp6
-rw-r--r--src/schema/kateschema.h6
-rw-r--r--src/schema/kateschemaconfig.cpp2
-rw-r--r--src/script/katecommandlinescript.cpp8
-rw-r--r--src/script/kateindentscript.cpp2
-rw-r--r--src/script/kateindentscript.h2
-rw-r--r--src/script/katescript.cpp2
-rw-r--r--src/script/katescript.h4
-rw-r--r--src/script/katescriptaction.cpp4
-rw-r--r--src/script/katescriptaction.h10
-rw-r--r--src/script/katescriptconsole.cpp4
-rw-r--r--src/script/katescriptconsole.h8
-rw-r--r--src/script/katescriptdocument.cpp6
-rw-r--r--src/script/katescriptview.cpp4
-rw-r--r--src/script/katescriptview.h10
-rw-r--r--src/script/katetemplatescript.cpp2
-rw-r--r--src/script/katetemplatescript.h2
-rw-r--r--src/search/katesearchbar.cpp6
-rw-r--r--src/search/katesearchbar.h14
-rw-r--r--src/spellcheck/ontheflycheck.cpp34
-rw-r--r--src/spellcheck/ontheflycheck.h8
-rw-r--r--src/spellcheck/spellcheckdialog.cpp2
-rw-r--r--src/spellcheck/spellcheckdialog.h6
-rw-r--r--src/spellcheck/spellingmenu.cpp2
-rw-r--r--src/spellcheck/spellingmenu.h6
-rw-r--r--src/src/ktexteditor.cpp6
-rw-r--r--src/swapfile/kateswapfile.h2
-rw-r--r--src/utils/kateautoindent.cpp6
-rw-r--r--src/utils/kateautoindent.h8
-rw-r--r--src/utils/katebookmarks.cpp2
-rw-r--r--src/utils/katebookmarks.h6
-rw-r--r--src/utils/katecmds.cpp8
-rw-r--r--src/utils/kateconfig.cpp4
-rw-r--r--src/utils/kateconfig.h6
-rw-r--r--src/utils/kateglobal.cpp4
-rw-r--r--src/utils/kateglobal.h10
-rw-r--r--src/utils/katetemplatehandler.cpp4
-rw-r--r--src/utils/katetemplatehandler.h8
-rw-r--r--src/variableeditor/variablelineedit.cpp4
-rw-r--r--src/view/kateview.cpp514
-rw-r--r--src/view/kateview.h20
-rw-r--r--src/view/kateviewhelpers.cpp10
-rw-r--r--src/view/kateviewhelpers.h24
-rw-r--r--src/view/kateviewinternal.cpp8
-rw-r--r--src/view/kateviewinternal.h8
-rw-r--r--src/vimode/katevicommandrangeexpressionparser.cpp6
-rw-r--r--src/vimode/katevicommandrangeexpressionparser.h8
-rw-r--r--src/vimode/kateviemulatedcommandbar.cpp2
-rw-r--r--src/vimode/kateviemulatedcommandbar.h6
-rw-r--r--src/vimode/kateviglobal.cpp2
-rw-r--r--src/vimode/kateviglobal.h2
-rw-r--r--src/vimode/kateviinputmodemanager.cpp2
-rw-r--r--src/vimode/kateviinputmodemanager.h6
-rw-r--r--src/vimode/kateviinsertmode.cpp2
-rw-r--r--src/vimode/kateviinsertmode.h4
-rw-r--r--src/vimode/katevikeymapper.cpp2
-rw-r--r--src/vimode/katevikeymapper.h6
-rw-r--r--src/vimode/katevimodebase.cpp8
-rw-r--r--src/vimode/katevimodebase.h2
-rw-r--r--src/vimode/katevinormalmode.cpp2
-rw-r--r--src/vimode/katevinormalmode.h2
-rw-r--r--src/vimode/katevireplacemode.cpp2
-rw-r--r--src/vimode/katevireplacemode.h4
-rw-r--r--src/vimode/katevivisualmode.cpp2
-rw-r--r--src/vimode/katevivisualmode.h2
102 files changed, 629 insertions, 617 deletions
diff --git a/autotests/src/bug286887.cpp b/autotests/src/bug286887.cpp
index c8928c9..019572f 100644
--- a/autotests/src/bug286887.cpp
+++ b/autotests/src/bug286887.cpp
@@ -52,7 +52,7 @@ void BugTest::ctrlShiftLeft()
KateDocument doc(false, false);
// view must be visible...
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
diff --git a/autotests/src/bug313759.cpp b/autotests/src/bug313759.cpp
index 669f73b..ecdac31 100644
--- a/autotests/src/bug313759.cpp
+++ b/autotests/src/bug313759.cpp
@@ -55,7 +55,7 @@ void BugTest::tryCrash()
// set up document and view
KMainWindow *toplevel = new KMainWindow();
KateDocument *doc = new KateDocument(true, false, toplevel);
- KateView *view = static_cast<KateView *>(doc->createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc->createView(0));
bool outputWasCustomised = false;
TestScriptEnv *env = new TestScriptEnv(doc, outputWasCustomised);
const QUrl url = QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"bug313759.txt"));
diff --git a/autotests/src/bug313769.cpp b/autotests/src/bug313769.cpp
index ead5c0c..9ec6ce2 100644
--- a/autotests/src/bug313769.cpp
+++ b/autotests/src/bug313769.cpp
@@ -60,7 +60,7 @@ void BugTest::tryCrash()
doc.buffer().ensureHighlighted(doc.lines());
// view must be visible...
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(900, 800);
view->config()->setDynWordWrap(true);
diff --git a/autotests/src/bug317111.cpp b/autotests/src/bug317111.cpp
index 87a7d90..90f4e55 100644
--- a/autotests/src/bug317111.cpp
+++ b/autotests/src/bug317111.cpp
@@ -55,7 +55,7 @@ void BugTest::tryCrash()
// set up document and view
KMainWindow *toplevel = new KMainWindow();
KateDocument *doc = new KateDocument(true, false, toplevel);
- KateView *view = static_cast<KateView *>(doc->createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc->createView(0));
bool outputWasCustomised = false;
TestScriptEnv *env = new TestScriptEnv(doc, outputWasCustomised);
const QUrl url = QUrl::fromLocalFile(QLatin1String(TEST_DATA_DIR"bug317111.txt"));
diff --git a/autotests/src/completion_test.cpp b/autotests/src/completion_test.cpp
index 6810d8d..213e984 100644
--- a/autotests/src/completion_test.cpp
+++ b/autotests/src/completion_test.cpp
@@ -48,7 +48,7 @@ int countItems(KateCompletionModel *model)
return ret;
}
-static void verifyCompletionStarted(KateView *view)
+static void verifyCompletionStarted(KTextEditor::ViewPrivate *view)
{
const QDateTime startTime = QDateTime::currentDateTime();
while (startTime.msecsTo(QDateTime::currentDateTime()) < 1000) {
@@ -60,7 +60,7 @@ static void verifyCompletionStarted(KateView *view)
QVERIFY(view->completionWidget()->isCompletionActive());
}
-static void verifyCompletionAborted(KateView *view)
+static void verifyCompletionAborted(KTextEditor::ViewPrivate *view)
{
const QDateTime startTime = QDateTime::currentDateTime();
while (startTime.msecsTo(QDateTime::currentDateTime()) < 1000) {
@@ -72,7 +72,7 @@ static void verifyCompletionAborted(KateView *view)
QVERIFY(!view->completionWidget()->isCompletionActive());
}
-static void invokeCompletionBox(KateView *view)
+static void invokeCompletionBox(KTextEditor::ViewPrivate *view)
{
view->userInvokedCompletion();
verifyCompletionStarted(view);
@@ -93,7 +93,7 @@ void CompletionTest::init()
KTextEditor::View *v = m_doc->createView(0);
QApplication::setActiveWindow(v);
- m_view = static_cast<KateView *>(v);
+ m_view = static_cast<KTextEditor::ViewPrivate *>(v);
Q_ASSERT(m_view);
//view needs to be shown as completion won't work if the cursor is off screen
diff --git a/autotests/src/completion_test.h b/autotests/src/completion_test.h
index 8794a7c..124b763 100644
--- a/autotests/src/completion_test.h
+++ b/autotests/src/completion_test.h
@@ -26,7 +26,7 @@ namespace KTextEditor
{
class Document;
}
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class CompletionTest : public QObject
{
@@ -63,7 +63,7 @@ private Q_SLOTS:
private:
KTextEditor::Document *m_doc;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
};
#endif
diff --git a/autotests/src/katefoldingtest.cpp b/autotests/src/katefoldingtest.cpp
index 3fdc798..e87f69d 100644
--- a/autotests/src/katefoldingtest.cpp
+++ b/autotests/src/katefoldingtest.cpp
@@ -65,7 +65,7 @@ void KateFoldingTest::testCrash311866()
doc.setHighlightingMode("C++");
doc.buffer().ensureHighlighted(6);
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
view->setCursorPosition(Cursor(3, 0));
@@ -98,7 +98,7 @@ void KateFoldingTest::testBug295632()
doc.setText(text);
// view must be visible...
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
diff --git a/autotests/src/kateview_test.cpp b/autotests/src/kateview_test.cpp
index 92491d4..a9dccb2 100644
--- a/autotests/src/kateview_test.cpp
+++ b/autotests/src/kateview_test.cpp
@@ -69,8 +69,8 @@ void KateViewTest::testReloadMultipleViews()
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
QCOMPARE(doc.highlightingMode(), QString("C++"));
- KateView *view1 = new KateView(&doc, 0);
- KateView *view2 = new KateView(&doc, 0);
+ KTextEditor::ViewPrivate *view1 = new KTextEditor::ViewPrivate(&doc, 0);
+ KTextEditor::ViewPrivate *view2 = new KTextEditor::ViewPrivate(&doc, 0);
view1->show();
view2->show();
QCOMPARE(doc.views().count(), 2);
@@ -84,7 +84,7 @@ void KateViewTest::testLowerCaseBlockSelection()
KateDocument doc;
doc.setText("nY\nnYY\n");
- KateView *view1 = new KateView(&doc, 0);
+ KTextEditor::ViewPrivate *view1 = new KTextEditor::ViewPrivate(&doc, 0);
view1->setBlockSelection(true);
view1->setSelection(Range(0, 1, 1, 3));
view1->lowercase();
@@ -122,7 +122,7 @@ void KateViewTest::testFolding()
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
QCOMPARE(doc.highlightingMode(), QString("C++"));
- KateView *view = new KateView(&doc, 0);
+ KTextEditor::ViewPrivate *view = new KTextEditor::ViewPrivate(&doc, 0);
QAction *collapseAction = view->action("folding_toplevel");
QVERIFY(collapseAction);
QAction *expandAction = view->action("folding_expandtoplevel");
@@ -166,7 +166,7 @@ void KateViewTest::testBug287291()
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
QCOMPARE(doc.highlightingMode(), QString("C++"));
- KateView *view = new KateView(&doc, 0);
+ KTextEditor::ViewPrivate *view = new KTextEditor::ViewPrivate(&doc, 0);
QAction *collapseAction = view->action("folding_toplevel");
QVERIFY(collapseAction);
QAction *expandAction = view->action("folding_expandtoplevel");
@@ -232,7 +232,7 @@ void KateViewTest::testSelection()
KateDocument doc;
QVERIFY(doc.openUrl(QUrl::fromLocalFile(file.fileName())));
- KateView *view = new KateView(&doc, 0);
+ KTextEditor::ViewPrivate *view = new KTextEditor::ViewPrivate(&doc, 0);
view->resize(100, 100);
view->show();
@@ -301,7 +301,7 @@ void KateViewTest::testKillline()
<< "baz"
);
- KateView *view = new KateView(&doc, 0);
+ KTextEditor::ViewPrivate *view = new KTextEditor::ViewPrivate(&doc, 0);
view->setCursorPositionInternal(KTextEditor::Cursor(1, 2));
view->killLine();
diff --git a/autotests/src/messagetest.cpp b/autotests/src/messagetest.cpp
index 76158d1..5a5c403 100644
--- a/autotests/src/messagetest.cpp
+++ b/autotests/src/messagetest.cpp
@@ -45,7 +45,7 @@ void MessageTest::testPostMessage()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -73,7 +73,7 @@ void MessageTest::testAutoHide()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -105,7 +105,7 @@ void MessageTest::testAutoHideAfterUserInteraction()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -148,7 +148,7 @@ void MessageTest::testMessageQueue()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -205,7 +205,7 @@ void MessageTest::testPriority()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -282,8 +282,8 @@ void MessageTest::testCreateView()
QVERIFY(doc.postMessage(m1));
// now create views
- KateView *v1 = static_cast<KateView *>(doc.createView(0));
- KateView *v2 = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *v1 = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
+ KTextEditor::ViewPrivate *v2 = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
v1->show();
v2->show();
v1->resize(400, 300);
@@ -309,7 +309,7 @@ void MessageTest::testHideView()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -355,7 +355,7 @@ void MessageTest::testHideViewAfterUserInteraction()
{
KateDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->show();
view->resize(400, 300);
QVERIFY(QTest::qWaitForWindowExposed(view));
diff --git a/autotests/src/movingrange_test.cpp b/autotests/src/movingrange_test.cpp
index 993ec4e..e7cf1ae 100644
--- a/autotests/src/movingrange_test.cpp
+++ b/autotests/src/movingrange_test.cpp
@@ -296,7 +296,7 @@ void MovingRangeTest::testFeedbackCaret()
"xxxx..");
doc.setText(text);
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
// create range feedback
RangeFeedback rf;
@@ -412,7 +412,7 @@ void MovingRangeTest::testFeedbackMouse()
"xxxx..");
doc.setText(text);
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
view->setCursorPosition(Cursor(1, 6));
view->show();
view->resize(200, 100);
diff --git a/autotests/src/script_test_base.cpp b/autotests/src/script_test_base.cpp
index 29fbca0..ae301cc 100644
--- a/autotests/src/script_test_base.cpp
+++ b/autotests/src/script_test_base.cpp
@@ -59,7 +59,7 @@ void ScriptTestBase::initTestCase()
m_msgHandler = qInstallMessageHandler(noDebugMessageOutput);
m_toplevel = new QMainWindow();
m_document = new KateDocument(true, false, m_toplevel);
- m_view = static_cast<KateView *>(m_document->widget());
+ 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 a6b437e..79a98df 100644
--- a/autotests/src/script_test_base.h
+++ b/autotests/src/script_test_base.h
@@ -24,7 +24,7 @@
class TestScriptEnv;
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class QMainWindow;
class ScriptTestBase : public QObject
@@ -44,7 +44,7 @@ protected:
QMainWindow *m_toplevel;
bool m_outputWasCustomised;
QStringList m_commands;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
QString m_section; // dir name in testdata/
QString m_script_dir; // dir name in part/script/data/
diff --git a/autotests/src/searchbar_test.cpp b/autotests/src/searchbar_test.cpp
index 74cbc20..491d8cf 100644
--- a/autotests/src/searchbar_test.cpp
+++ b/autotests/src/searchbar_test.cpp
@@ -74,7 +74,7 @@ void SearchBarTest::testFindNextIncremental()
KateDocument doc;
doc.setText("a a a b b");
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
KateSearchBar bar(false, &view, &config);
@@ -107,7 +107,7 @@ void SearchBarTest::testFindNextIncremental()
void SearchBarTest::testSetMatchCaseIncremental()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a A a");
@@ -141,7 +141,7 @@ void SearchBarTest::testSetMatchCaseIncremental()
void SearchBarTest::testSetMatchCasePower()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a A a");
@@ -182,7 +182,7 @@ void SearchBarTest::testSetMatchCasePower()
void SearchBarTest::testSetSelectionOnlyPower()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -231,7 +231,7 @@ void SearchBarTest::testSetSearchPattern()
QFETCH(int, numMatches2);
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -255,7 +255,7 @@ void SearchBarTest::testSetSearchPattern()
void SearchBarTest::testSetSelectionOnly()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -291,7 +291,7 @@ void SearchBarTest::testFindAll()
QFETCH(int, numMatches4);
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -327,7 +327,7 @@ void SearchBarTest::testFindAll()
void SearchBarTest::testReplaceAll()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -382,7 +382,7 @@ void SearchBarTest::testFindSelectionForward()
QFETCH(Range, match);
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText(text);
@@ -419,7 +419,7 @@ void SearchBarTest::testRemoveWithSelectionForward()
QFETCH(Range, match);
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -453,7 +453,7 @@ void SearchBarTest::testRemoveInSelectionForward()
QFETCH(Range, match);
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("a a a");
@@ -498,7 +498,7 @@ void SearchBarTest::testReplaceWithDoubleSelecion()
QFETCH(Range, match);
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText(text);
@@ -517,7 +517,7 @@ void SearchBarTest::testReplaceWithDoubleSelecion()
void SearchBarTest::testReplaceDollar()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("aaa\nbbb\nccc\n\n\naaa\nbbb\nccc\nddd\n");
@@ -536,7 +536,7 @@ void SearchBarTest::testReplaceDollar()
void SearchBarTest::testSearchHistoryIncremental()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig *const config = view.config();
config->patternHistoryModel()->setStringList(QStringList());
@@ -556,7 +556,7 @@ void SearchBarTest::testSearchHistoryIncremental()
QCOMPARE(bar.m_incUi->pattern->findText("foo"), 1);
KateDocument doc2;
- KateView view2(&doc2, 0);
+ KTextEditor::ViewPrivate view2(&doc2, 0);
KateViewConfig *const config2 = view2.config();
KateSearchBar bar2(false, &view2, config2);
@@ -573,7 +573,7 @@ void SearchBarTest::testSearchHistoryIncremental()
void SearchBarTest::testSearchHistoryPower()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig *const config = view.config();
config->patternHistoryModel()->setStringList(QStringList());
@@ -601,7 +601,7 @@ void SearchBarTest::testSearchHistoryPower()
QCOMPARE(bar.m_powerUi->pattern->count(), 2);
KateDocument doc2;
- KateView view2(&doc2, 0);
+ KTextEditor::ViewPrivate view2(&doc2, 0);
KateViewConfig *const config2 = view2.config();
KateSearchBar bar2(true, &view2, config2);
@@ -613,7 +613,7 @@ void SearchBarTest::testSearchHistoryPower()
void SearchBarTest::testReplaceInBlockMode()
{
KateDocument doc;
- KateView view(&doc, 0);
+ KTextEditor::ViewPrivate view(&doc, 0);
KateViewConfig config(&view);
doc.setText("111\n111");
diff --git a/autotests/src/templatehandler_test.cpp b/autotests/src/templatehandler_test.cpp
index 26d4be3..ceda254 100644
--- a/autotests/src/templatehandler_test.cpp
+++ b/autotests/src/templatehandler_test.cpp
@@ -39,7 +39,7 @@ void TemplateHandlerTest::testUndo()
initialValues.insert("index", "i");
KateDocument doc(false, false, 0, this);
- KateView view(&doc, 0);
+ 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 5355a63..c197038 100644
--- a/autotests/src/testutils.cpp
+++ b/autotests/src/testutils.cpp
@@ -99,7 +99,7 @@ TestScriptEnv::TestScriptEnv(KateDocument *part, bool &cflag)
m_engine->globalObject().setProperty(QLatin1String("i18ncp"), m_engine->newFunction(Kate::Script::i18ncp));
m_engine->globalObject().setProperty(QLatin1String("i18np"), m_engine->newFunction(Kate::Script::i18np));
- KateView *view = qobject_cast<KateView *>(part->widget());
+ KTextEditor::ViewPrivate *view = qobject_cast<KTextEditor::ViewPrivate *>(part->widget());
m_viewObj = new KateViewObject(view);
QScriptValue sv = m_engine->newQObject(m_viewObj);
@@ -138,7 +138,7 @@ TestScriptEnv::~TestScriptEnv()
//BEGIN KateViewObject
-KateViewObject::KateViewObject(KateView *view)
+KateViewObject::KateViewObject(KTextEditor::ViewPrivate *view)
: KateScriptView()
{
setView(view);
@@ -241,7 +241,7 @@ KateDocumentObject::~KateDocumentObject()
//BEGIN OutputObject
-OutputObject::OutputObject(KateView *v, bool &cflag)
+OutputObject::OutputObject(KTextEditor::ViewPrivate *v, bool &cflag)
: view(v), cflag(cflag)
{
}
diff --git a/autotests/src/testutils.h b/autotests/src/testutils.h
index 2a60e52..00e80b0 100644
--- a/autotests/src/testutils.h
+++ b/autotests/src/testutils.h
@@ -28,7 +28,7 @@
#include <QtScript/QScriptable>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class RegressionTest;
class KCmdLineArgs;
class OutputObject;
@@ -73,7 +73,7 @@ class KateViewObject : public KateScriptView
public:
- explicit KateViewObject(KateView *view);
+ explicit KateViewObject(KTextEditor::ViewPrivate *view);
virtual ~KateViewObject();
// Edit functions
@@ -167,7 +167,7 @@ class OutputObject : public QObject, protected QScriptable
Q_OBJECT
public:
- OutputObject(KateView *v, bool &cflag);
+ OutputObject(KTextEditor::ViewPrivate *v, bool &cflag);
virtual ~OutputObject();
void output(bool cp, bool ln);
@@ -192,7 +192,7 @@ public:
Q_INVOKABLE void posLn();
private:
- KateView *view;
+ KTextEditor::ViewPrivate *view;
bool &cflag;
};
diff --git a/autotests/src/undomanager_test.cpp b/autotests/src/undomanager_test.cpp
index be19844..420fd05 100644
--- a/autotests/src/undomanager_test.cpp
+++ b/autotests/src/undomanager_test.cpp
@@ -140,7 +140,7 @@ void UndoManagerTest::testSafePoint()
void UndoManagerTest::testCursorPosition()
{
TestDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
doc.setText(QLatin1String("aaaa bbbb cccc\n"
"dddd ffff"));
@@ -165,7 +165,7 @@ void UndoManagerTest::testCursorPosition()
void UndoManagerTest::testSelectionUndo()
{
TestDocument doc;
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
doc.setText(QLatin1String("aaaa bbbb cccc\n"
"dddd eeee ffff"));
@@ -200,7 +200,7 @@ void UndoManagerTest::testUndoWordWrapBug301367()
TestDocument doc;
doc.setWordWrap(true);
doc.setWordWrapAt(20);
- KateView *view = static_cast<KateView *>(doc.createView(0));
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(doc.createView(0));
QString text = QString::fromLatin1("1234 1234 1234 1234\n"
"1234 1234 1234 1234");
diff --git a/autotests/src/vimode_test.cpp b/autotests/src/vimode_test.cpp
index 3cb73d0..0b4824d 100644
--- a/autotests/src/vimode_test.cpp
+++ b/autotests/src/vimode_test.cpp
@@ -105,7 +105,7 @@ void FailsIfSlotCalled::slot()
FakeCodeCompletionTestModel::FakeCodeCompletionTestModel(KTextEditor::View *parent)
: KTextEditor::CodeCompletionModel(parent),
- m_kateView(qobject_cast<KateView *>(parent)),
+ m_kateView(qobject_cast<KTextEditor::ViewPrivate *>(parent)),
m_kateDoc(parent->document()),
m_removeTailOnCompletion(false),
m_failTestOnInvocation(false),
@@ -296,7 +296,7 @@ void ViModeTest::init()
delete kate_document;
kate_document = new KateDocument(false, false, 0, NULL);
- kate_view = new KateView(kate_document, mainWindow);
+ kate_view = new KTextEditor::ViewPrivate(kate_document, mainWindow);
mainWindowLayout->addWidget(kate_view);
kate_view->config()->setViInputMode(true);
Q_ASSERT(kate_view->viInputMode());
@@ -684,7 +684,7 @@ void ViModeTest::VisualModeTests()
// end up in Visual Mode: this mimics what happens if we click on a Find result in
// KDevelop's "grepview" plugin.
delete kate_view;
- kate_view = new KateView(kate_document, mainWindow);
+ kate_view = new KTextEditor::ViewPrivate(kate_document, mainWindow);
mainWindowLayout->addWidget(kate_view);
kate_document->setText("foo bar");
kate_view->setSelection(Range(Cursor(0, 1), Cursor(0, 4)));
@@ -1808,7 +1808,7 @@ void ViModeTest::FakeCodeCompletionTests()
// Test that FakeCodeCompletionTestModel behaves similar to the code-completion in e.g. KDevelop.
const bool oldStealKeys = KateViewConfig::global()->viInputModeStealKeys();
KateViewConfig::global()->setViInputModeStealKeys(true); // For Ctrl-P, Ctrl-N etc
- ensureKateViewVisible(); // KateView needs to be visible for the completion widget.
+ ensureKateViewVisible(); // KTextEditor::ViewPrivate needs to be visible for the completion widget.
FakeCodeCompletionTestModel *fakeCodeCompletionModel = new FakeCodeCompletionTestModel(kate_view);
kate_view->registerCompletionModel(fakeCodeCompletionModel);
fakeCodeCompletionModel->setCompletions(QStringList() << "completionA" << "completionB" << "completionC");
@@ -2227,7 +2227,7 @@ void ViModeTest::CommandModeTests()
class VimStyleCommandBarTestsSetUpAndTearDown
{
public:
- VimStyleCommandBarTestsSetUpAndTearDown(KateView *kateView, QMainWindow *mainWindow)
+ VimStyleCommandBarTestsSetUpAndTearDown(KTextEditor::ViewPrivate *kateView, QMainWindow *mainWindow)
: m_kateView(kateView), m_mainWindow(mainWindow), m_windowKeepActive(mainWindow)
{
m_mainWindow->show();
@@ -2253,7 +2253,7 @@ public:
}
}
private:
- KateView *m_kateView;
+ KTextEditor::ViewPrivate *m_kateView;
QMainWindow *m_mainWindow;
WindowKeepActive m_windowKeepActive;
};
@@ -6016,7 +6016,7 @@ void ViModeTest::CompletionTests()
KateViewConfig::global()->setWordCompletionRemoveTail(false);
KateViewConfig::global()->setViInputModeStealKeys(true); // For Ctrl-P, Ctrl-N etc
- ensureKateViewVisible(); // KateView needs to be visible for the completion widget.
+ ensureKateViewVisible(); // KTextEditor::ViewPrivate needs to be visible for the completion widget.
VimCodeCompletionTestModel *testModel = new VimCodeCompletionTestModel(kate_view);
BeginTest("");
@@ -7229,7 +7229,7 @@ void ViModeTest::waitForCompletionWidgetToActivate()
waitForCompletionWidgetToActivate(kate_view);
}
-void ViModeTest::waitForCompletionWidgetToActivate(KateView *kate_view)
+void ViModeTest::waitForCompletionWidgetToActivate(KTextEditor::ViewPrivate *kate_view)
{
const QDateTime start = QDateTime::currentDateTime();
while (start.msecsTo(QDateTime::currentDateTime()) < 1000) {
diff --git a/autotests/src/vimode_test.h b/autotests/src/vimode_test.h
index 6210eff..9177e86 100644
--- a/autotests/src/vimode_test.h
+++ b/autotests/src/vimode_test.h
@@ -123,7 +123,7 @@ public:
private:
void failTest() const;
QStringList m_completions;
- KateView *m_kateView;
+ KTextEditor::ViewPrivate *m_kateView;
KTextEditor::Document *m_kateDoc;
bool m_removeTailOnCompletion;
bool m_failTestOnInvocation;
@@ -144,7 +144,7 @@ public:
ViModeTest();
~ViModeTest();
- static void waitForCompletionWidgetToActivate(KateView *kate_view);
+ static void waitForCompletionWidgetToActivate(KTextEditor::ViewPrivate *kate_view);
private Q_SLOTS:
void init();
@@ -187,7 +187,7 @@ private:
);
KateDocument *kate_document;
- KateView *kate_view;
+ KTextEditor::ViewPrivate *kate_view;
QMainWindow *mainWindow;
QVBoxLayout *mainWindowLayout;
KateViInputModeManager *vi_input_mode_manager;
diff --git a/src/buffer/katetextbuffer.cpp b/src/buffer/katetextbuffer.cpp
index 8d40d13..11d5d1b 100644
--- a/src/buffer/katetextbuffer.cpp
+++ b/src/buffer/katetextbuffer.cpp
@@ -878,7 +878,7 @@ void TextBuffer::notifyAboutRangeChange(KTextEditor::View *view, int startLine,
}
// notify view, it is really a kate view
- static_cast<KateView *>(curView)->notifyAboutRangeChange(startLine, endLine, rangeWithAttribute);
+ static_cast<KTextEditor::ViewPrivate *>(curView)->notifyAboutRangeChange(startLine, endLine, rangeWithAttribute);
}
}
diff --git a/src/completion/katecompletionmodel.cpp b/src/completion/katecompletionmodel.cpp
index 6eedd05..b26ca02 100644
--- a/src/completion/katecompletionmodel.cpp
+++ b/src/completion/katecompletionmodel.cpp
@@ -392,7 +392,7 @@ KateCompletionWidget *KateCompletionModel::widget() const
return static_cast<KateCompletionWidget *>(QObject::parent());
}
-KateView *KateCompletionModel::view() const
+KTextEditor::ViewPrivate *KateCompletionModel::view() const
{
return widget()->view();
}
diff --git a/src/completion/katecompletionmodel.h b/src/completion/katecompletionmodel.h
index 7fcbf84..95c9ff6 100644
--- a/src/completion/katecompletionmodel.h
+++ b/src/completion/katecompletionmodel.h
@@ -33,7 +33,7 @@
class KateCompletionWidget;
class KateArgumentHintModel;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class QWidget;
class QTextEdit;
class QTimer;
@@ -60,7 +60,7 @@ public:
void setCompletionModels(const QList<KTextEditor::CodeCompletionModel *> &models);
void removeCompletionModel(KTextEditor::CodeCompletionModel *model);
- KateView *view() const;
+ KTextEditor::ViewPrivate *view() const;
KateCompletionWidget *widget() const;
QString currentCompletion(KTextEditor::CodeCompletionModel *model) const;
diff --git a/src/completion/katecompletionwidget.cpp b/src/completion/katecompletionwidget.cpp
index 1d2db31..f413844 100644
--- a/src/completion/katecompletionwidget.cpp
+++ b/src/completion/katecompletionwidget.cpp
@@ -95,7 +95,7 @@ static bool _shouldStartCompletion(KTextEditor::CodeCompletionModel *model, KTex
CALLCI(return,, return, model, shouldStartCompletion(view, m_automaticInvocationLine, m_lastInsertionByUser, cursor));
}
-KateCompletionWidget::KateCompletionWidget(KateView *parent)
+KateCompletionWidget::KateCompletionWidget(KTextEditor::ViewPrivate *parent)
: QFrame(parent, Qt::ToolTip)
, m_presentationModel(new KateCompletionModel(this))
, m_entryList(new KateCompletionTree(this))
@@ -281,9 +281,9 @@ void KateCompletionWidget::rowsInserted(const QModelIndex &parent, int rowFrom,
}
}
-KateView *KateCompletionWidget::view() const
+KTextEditor::ViewPrivate *KateCompletionWidget::view() const
{
- return static_cast<KateView *>(const_cast<QObject *>(parent()));
+ return static_cast<KTextEditor::ViewPrivate *>(const_cast<QObject *>(parent()));
}
void KateCompletionWidget::argumentHintsChanged(bool hasContent)
diff --git a/src/completion/katecompletionwidget.h b/src/completion/katecompletionwidget.h
index ae072fb..46305ac 100644
--- a/src/completion/katecompletionwidget.h
+++ b/src/completion/katecompletionwidget.h
@@ -36,7 +36,7 @@ class QPushButton;
class QLabel;
class QTimer;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateCompletionModel;
class KateCompletionTree;
class KateArgumentHintTree;
@@ -58,10 +58,10 @@ class KTEXTEDITOR_EXPORT KateCompletionWidget : public QFrame
Q_OBJECT
public:
- explicit KateCompletionWidget(KateView *parent);
+ explicit KateCompletionWidget(KTextEditor::ViewPrivate *parent);
~KateCompletionWidget();
- KateView *view() const;
+ KTextEditor::ViewPrivate *view() const;
KateCompletionTree *treeView() const;
bool isCompletionActive() const;
diff --git a/src/completion/katewordcompletion.cpp b/src/completion/katewordcompletion.cpp
index ae1204b..f7c0f97 100644
--- a/src/completion/katewordcompletion.cpp
+++ b/src/completion/katewordcompletion.cpp
@@ -157,7 +157,7 @@ bool KateWordCompletionModel::shouldStartCompletion(KTextEditor::View *view, con
return false;
}
- KateView *v = qobject_cast<KateView *> (view);
+ KTextEditor::ViewPrivate *v = qobject_cast<KTextEditor::ViewPrivate *> (view);
if (view->document()->totalCharacters() > autoInvocationMaxFilesize) {
// Disable automatic invocation for files larger than 1MB (see benchmarks)
@@ -190,7 +190,7 @@ bool KateWordCompletionModel::shouldAbortCompletion(KTextEditor::View *view, con
{
if (m_automatic) {
- KateView *v = qobject_cast<KateView *> (view);
+ KTextEditor::ViewPrivate *v = qobject_cast<KTextEditor::ViewPrivate *> (view);
if (currentCompletion.length() < v->config()->wordCompletionMinimalWordLength()) {
return true;
}
@@ -213,7 +213,7 @@ void KateWordCompletionModel::completionInvoked(KTextEditor::View *view, const K
QStringList KateWordCompletionModel::allMatches(KTextEditor::View *view, const KTextEditor::Range &range) const
{
QSet<QString> result;
- const int minWordSize = qMax(2, qobject_cast<KateView *>(view)->config()->wordCompletionMinimalWordLength());
+ const int minWordSize = qMax(2, qobject_cast<KTextEditor::ViewPrivate *>(view)->config()->wordCompletionMinimalWordLength());
const int lines = view->document()->lines();
for (int line = 0; line < lines; line++) {
const QString &text = view->document()->line(line);
@@ -243,7 +243,7 @@ void KateWordCompletionModel::executeCompletionItem (KTextEditor::View *view
, const QModelIndex &index
) const
{
- KateView *v = qobject_cast<KateView *> (view);
+ KTextEditor::ViewPrivate *v = qobject_cast<KTextEditor::ViewPrivate *> (view);
if (v->config()->wordCompletionRemoveTail()) {
int tailStart = word.end().column();
const QString &line = view->document()->line(word.end().line());
diff --git a/src/dialogs/katedialogs.cpp b/src/dialogs/katedialogs.cpp
index bfb3abe..f542218 100644
--- a/src/dialogs/katedialogs.cpp
+++ b/src/dialogs/katedialogs.cpp
@@ -1365,7 +1365,7 @@ void KateGotoBar::keyPressEvent(QKeyEvent *event)
void KateGotoBar::gotoLine()
{
- KateView *kv = qobject_cast<KateView *>(m_view);
+ KTextEditor::ViewPrivate *kv = qobject_cast<KTextEditor::ViewPrivate *>(m_view);
if (kv && kv->selection() && !kv->config()->persistentSelection()) {
kv->clearSelection();
}
@@ -1377,7 +1377,7 @@ void KateGotoBar::gotoLine()
//END KateGotoBar
//BEGIN KateDictionaryBar
-KateDictionaryBar::KateDictionaryBar(KateView *view, QWidget *parent)
+KateDictionaryBar::KateDictionaryBar(KTextEditor::ViewPrivate *view, QWidget *parent)
: KateViewBarWidget(true, parent)
, m_view(view)
{
diff --git a/src/dialogs/katedialogs.h b/src/dialogs/katedialogs.h
index 58e4137..b336ca5 100644
--- a/src/dialogs/katedialogs.h
+++ b/src/dialogs/katedialogs.h
@@ -45,7 +45,7 @@
class ModeConfigPage;
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
namespace KIO
{
@@ -130,7 +130,7 @@ class KateDictionaryBar : public KateViewBarWidget
Q_OBJECT
public:
- explicit KateDictionaryBar(KateView *view, QWidget *parent = NULL);
+ explicit KateDictionaryBar(KTextEditor::ViewPrivate *view, QWidget *parent = NULL);
virtual ~KateDictionaryBar();
public Q_SLOTS:
@@ -140,7 +140,7 @@ protected Q_SLOTS:
void dictionaryChanged(const QString &dictionary);
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
Sonnet::DictionaryComboBox *m_dictionaryComboBox;
};
diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp
index c635f2e..f1b70a5 100644
--- a/src/document/katedocument.cpp
+++ b/src/document/katedocument.cpp
@@ -281,7 +281,7 @@ QWidget *KateDocument::widget()
KTextEditor::View *KateDocument::createView(QWidget *parent, KTextEditor::MainWindow *mainWindow)
{
- KateView *newView = new KateView(this, parent, mainWindow);
+ KTextEditor::ViewPrivate *newView = new KTextEditor::ViewPrivate(this, parent, mainWindow);
if (m_fileChangedDialogsActivated) {
connect(newView, SIGNAL(focusIn(KTextEditor::View*)), this, SLOT(slotModifiedOnDisk()));
}
@@ -533,7 +533,7 @@ bool KateDocument::clear()
return false;
}
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->clear();
view->tagAll();
view->update();
@@ -816,7 +816,7 @@ void KateDocument::editStart()
m_undoManager->editStart();
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->editStart();
}
@@ -852,7 +852,7 @@ void KateDocument::editEnd()
m_undoManager->editEnd();
// edit end for all views !!!!!!!!!
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->editEnd(m_buffer->editTagStart(), m_buffer->editTagEnd(), m_buffer->editTagFrom());
}
@@ -2056,7 +2056,7 @@ bool KateDocument::openFile()
bool success = m_buffer->openFile(localFilePath(), (m_reloading && m_userSetEncodingForNextReload));
// disable view updates
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->setUpdatesEnabled(false);
}
@@ -2071,7 +2071,7 @@ bool KateDocument::openFile()
//
// update views
//
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
// This is needed here because inserting the text moves the view's start position (it is a MovingCursor)
view->setCursorPosition(KTextEditor::Cursor());
view->setUpdatesEnabled(true);
@@ -2494,7 +2494,7 @@ bool KateDocument::closeUrl()
m_buffer->setHighlight(0);
// update all our views
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->clearSelection(); // fix bug #118588
view->clear();
}
@@ -2532,7 +2532,7 @@ void KateDocument::setReadWrite(bool rw)
if (isReadWrite() != rw) {
KParts::ReadWritePart::setReadWrite(rw);
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->slotUpdateUndo();
view->slotReadWriteChanged();
}
@@ -2546,7 +2546,7 @@ void KateDocument::setModified(bool m)
if (isModified() != m) {
KParts::ReadWritePart::setModified(m);
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->slotUpdateUndo();
}
@@ -2561,7 +2561,7 @@ void KateDocument::setModified(bool m)
void KateDocument::makeAttribs(bool needInvalidate)
{
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->renderer()->updateAttributes();
}
@@ -2569,7 +2569,7 @@ void KateDocument::makeAttribs(bool needInvalidate)
m_buffer->invalidateHighlighting();
}
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->tagAll();
view->updateView(true);
}
@@ -2587,7 +2587,7 @@ void KateDocument::addView(KTextEditor::View *view)
return;
}
- m_views.append(static_cast<KateView *>(view));
+ m_views.append(static_cast<KTextEditor::ViewPrivate *>(view));
m_textEditViews.append(view);
// apply the view & renderer vars from the file type
@@ -2611,7 +2611,7 @@ void KateDocument::removeView(KTextEditor::View *view)
setActiveView(0L);
}
- m_views.removeAll(static_cast<KateView *>(view));
+ m_views.removeAll(static_cast<KTextEditor::ViewPrivate *>(view));
m_textEditViews.removeAll(view);
}
@@ -2621,10 +2621,10 @@ void KateDocument::setActiveView(KTextEditor::View *view)
return;
}
- m_activeView = static_cast<KateView *>(view);
+ m_activeView = static_cast<KTextEditor::ViewPrivate *>(view);
}
-bool KateDocument::ownedView(KateView *view)
+bool KateDocument::ownedView(KTextEditor::ViewPrivate *view)
{
// do we own the given view?
return (m_views.contains(view));
@@ -2662,7 +2662,7 @@ int KateDocument::fromVirtualColumn(const KTextEditor::Cursor &cursor) const
return fromVirtualColumn(cursor.line(), cursor.column());
}
-bool KateDocument::typeChars(KateView *view, const QString &realChars)
+bool KateDocument::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(KateView *view, const QString &realChars)
return true;
}
-void KateDocument::newLine(KateView *v)
+void KateDocument::newLine(KTextEditor::ViewPrivate *v)
{
editStart();
@@ -2804,7 +2804,7 @@ void KateDocument::transpose(const KTextEditor::Cursor &cursor)
editEnd();
}
-void KateDocument::backspace(KateView *view, const KTextEditor::Cursor &c)
+void KateDocument::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(KateView *view, const KTextEditor::Cursor &c)
}
}
-void KateDocument::del(KateView *view, const KTextEditor::Cursor &c)
+void KateDocument::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(KateView *view, const KTextEditor::Cursor &c)
}
}
-void KateDocument::paste(KateView *view, const QString &text)
+void KateDocument::paste(KTextEditor::ViewPrivate *view, const QString &text)
{
static const QChar newLineChar(QLatin1Char('\n'));
QString s = text;
@@ -2979,12 +2979,12 @@ void KateDocument::indent(KTextEditor::Range range, int change)
editEnd();
}
-void KateDocument::align(KateView *view, const KTextEditor::Range &range)
+void KateDocument::align(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range)
{
m_indenter->indent(view, range);
}
-void KateDocument::insertTab(KateView *view, const KTextEditor::Cursor &)
+void KateDocument::insertTab(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &)
{
if (!isReadWrite()) {
return;
@@ -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(KateView *view, int attrib)
+void KateDocument::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(KateView *view, int attrib)
/*
Add to the current selection a comment line mark at the beginning of each line.
*/
-void KateDocument::addStartLineCommentToSelection(KateView *view, int attrib)
+void KateDocument::addStartLineCommentToSelection(KTextEditor::ViewPrivate *view, int attrib)
{
const QString commentLineMark = highlight()->getCommentSingleLineStart(attrib) + QLatin1Char(' ');
@@ -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(KateView *view, int attrib)
+bool KateDocument::removeStartStopCommentFromSelection(KTextEditor::ViewPrivate *view, 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(KateView *view, int attrib)
+bool KateDocument::removeStartLineCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib)
{
const QString shortCommentMark = highlight()->getCommentSingleLineStart(attrib);
const QString longCommentMark = shortCommentMark + QLatin1Char(' ');
@@ -3366,7 +3366,7 @@ bool KateDocument::removeStartLineCommentFromSelection(KateView *view, int attri
Comment or uncomment the selection or the current
line if there is no selection.
*/
-void KateDocument::comment(KateView *v, uint line, uint column, int change)
+void KateDocument::comment(KTextEditor::ViewPrivate *v, uint line, uint column, int change)
{
// skip word wrap bug #105373
const bool skipWordWrap = wordWrap();
@@ -3448,7 +3448,7 @@ void KateDocument::comment(KateView *v, uint line, uint column, int change)
}
}
-void KateDocument::transform(KateView *v, const KTextEditor::Cursor &c,
+void KateDocument::transform(KTextEditor::ViewPrivate *v, const KTextEditor::Cursor &c,
KateDocument::TextTransform t)
{
if (v->selection()) {
@@ -3594,14 +3594,14 @@ void KateDocument::joinLines(uint first, uint last)
void KateDocument::tagLines(int start, int end)
{
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->tagLines(start, end, true);
}
}
void KateDocument::repaintViews(bool paintOnlyDirty)
{
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->repaintText(paintOnlyDirty);
}
}
@@ -3891,7 +3891,7 @@ bool KateDocument::documentReload()
// save cursor positions for all views
QVector<KTextEditor::Cursor> cursorPositions;
cursorPositions.reserve(m_views.size());
- foreach (KateView *v, m_views) {
+ foreach (KTextEditor::ViewPrivate *v, m_views) {
cursorPositions.append(v->cursorPosition());
}
@@ -3902,7 +3902,7 @@ bool KateDocument::documentReload()
m_userSetEncodingForNextReload = false;
// restore cursor positions for all views
- QLinkedList<KateView *>::iterator it = m_views.begin();
+ QLinkedList<KTextEditor::ViewPrivate *>::iterator it = m_views.begin();
for (int i = 0; i < m_views.size(); ++i, ++it) {
setActiveView(*it);
(*it)->setCursorPositionInternal(cursorPositions.at(i), m_config->tabWidth(), false);
@@ -4046,7 +4046,7 @@ void KateDocument::updateConfig()
m_buffer->setTabWidth(config()->tabWidth());
// update all views, does tagAll and updateView...
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->updateDocumentConfig();
}
@@ -4077,7 +4077,7 @@ void KateDocument::readVariables(bool onlyViewAndRenderer)
}
// views!
- KateView *v;
+ KTextEditor::ViewPrivate *v;
foreach (v, m_views) {
v->config()->configStart();
v->renderer()->config()->configStart();
@@ -4291,7 +4291,7 @@ void KateDocument::readVariableLine(QString t, bool onlyViewAndRenderer)
void KateDocument::setViewVariable(QString var, QString val)
{
- KateView *v;
+ KTextEditor::ViewPrivate *v;
bool state;
int n;
QColor c;
@@ -4568,7 +4568,7 @@ void KateDocument::updateFileType(const QString &newType, bool user)
}
// views!
- KateView *v;
+ KTextEditor::ViewPrivate *v;
foreach (v, m_views) {
v->config()->configStart();
v->renderer()->config()->configStart();
@@ -5195,7 +5195,7 @@ void KateDocument::onTheFlySpellCheckingEnabled(bool enable)
m_onTheFlyChecker = 0;
}
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->reflectOnTheFlySpellCheckStatus(enable);
}
}
@@ -5382,7 +5382,7 @@ void KateDocument::replaceCharactersByEncoding(const KTextEditor::Range &range)
KTextEditor::Attribute::Ptr KateDocument::defaultStyle(const KTextEditor::HighlightInterface::DefaultStyle ds) const
{
///TODO: move attributes to document, they are not view-dependant
- KateView *view = m_views.empty() ? nullptr : m_views.last();
+ KTextEditor::ViewPrivate *view = m_views.empty() ? nullptr : m_views.last();
if (!view) {
qCWarning(LOG_PART) << "ATTENTION: cannot access defaultStyle() without any View (will be fixed eventually)";
return KTextEditor::Attribute::Ptr(0);
@@ -5403,7 +5403,7 @@ QList< KTextEditor::HighlightInterface::AttributeBlock > KateDocument::lineAttri
QList< KTextEditor::HighlightInterface::AttributeBlock > attribs;
- KateView *view = m_views.empty() ? nullptr : m_views.last();
+ KTextEditor::ViewPrivate *view = m_views.empty() ? nullptr : m_views.last();
if (!view) {
qCWarning(LOG_PART) << "ATTENTION: cannot access lineAttributes() without any View (will be fixed eventually)";
return attribs;
@@ -5431,7 +5431,7 @@ KTextEditor::Attribute::Ptr KateDocument::attributeAt(const KTextEditor::Cursor
{
KTextEditor::Attribute::Ptr attrib(new KTextEditor::Attribute());
- KateView *view = m_views.empty() ? nullptr : m_views.last();
+ KTextEditor::ViewPrivate *view = m_views.empty() ? nullptr : m_views.last();
if (!view) {
qCWarning(LOG_PART) << "ATTENTION: cannot access lineAttributes() without any View (will be fixed eventually)";
return attrib;
@@ -5526,7 +5526,7 @@ int KateDocument::defStyleNum(int line, int column)
}
QList<KTextEditor::Attribute::Ptr> attributes = highlight()->attributes(
- static_cast<KateView *>(activeView())
+ static_cast<KTextEditor::ViewPrivate *>(activeView())
->renderer()
->config()
->schema()
@@ -5581,10 +5581,10 @@ bool KateDocument::postMessage(KTextEditor::Message *message)
}
// post message to requested view, or to all views
- if (KateView *view = qobject_cast<KateView *>(message->view())) {
+ if (KTextEditor::ViewPrivate *view = qobject_cast<KTextEditor::ViewPrivate *>(message->view())) {
view->postMessage(message, m_messageHash[message]);
} else {
- foreach (KateView *view, m_views) {
+ foreach (KTextEditor::ViewPrivate *view, m_views) {
view->postMessage(message, m_messageHash[message]);
}
}
diff --git a/src/document/katedocument.h b/src/document/katedocument.h
index df9c905..5308b00 100644
--- a/src/document/katedocument.h
+++ b/src/document/katedocument.h
@@ -66,7 +66,7 @@ class SwapFile;
}
class KateBuffer;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateDocumentConfig;
class KateHighlighting;
class KateUndoManager;
@@ -160,7 +160,7 @@ public:
}
private:
- QLinkedList<KateView *> m_views;
+ QLinkedList<KTextEditor::ViewPrivate *> m_views;
QList<KTextEditor::View *> m_textEditViews;
KTextEditor::View *m_activeView;
@@ -692,7 +692,7 @@ public:
* Type chars in a view.
* Will filter out non-printable chars from the realChars array before inserting.
*/
- bool typeChars(KateView *type, const QString &realChars);
+ bool typeChars(KTextEditor::ViewPrivate *type, const QString &realChars);
/**
* gets the last line number (lines() - 1)
@@ -719,29 +719,29 @@ public:
* That's your job. Or, easier, just delete the view in the first place.
* It will remove itself. TODO: this could be converted to a private slot
* connected to the view's destroyed() signal. It is not currently called
- * anywhere except from the KateView destructor.
+ * anywhere except from the KTextEditor::ViewPrivate destructor.
*/
void removeView(KTextEditor::View *);
void setActiveView(KTextEditor::View *);
- bool ownedView(KateView *);
+ bool ownedView(KTextEditor::ViewPrivate *);
int toVirtualColumn(int line, int column) const;
int toVirtualColumn(const KTextEditor::Cursor &) const;
int fromVirtualColumn(int line, int column) const;
int fromVirtualColumn(const KTextEditor::Cursor &) const;
- void newLine(KateView *view); // Changes input
- void backspace(KateView *view, const KTextEditor::Cursor &);
- void del(KateView *view, const KTextEditor::Cursor &);
+ void newLine(KTextEditor::ViewPrivate *view); // Changes input
+ void backspace(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &);
+ void del(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &);
void transpose(const KTextEditor::Cursor &);
- void paste(KateView *view, const QString &text);
+ void paste(KTextEditor::ViewPrivate *view, const QString &text);
public:
void indent(KTextEditor::Range range, int change);
- void comment(KateView *view, uint line, uint column, int change);
- void align(KateView *view, const KTextEditor::Range &range);
- void insertTab(KateView *view, const KTextEditor::Cursor &);
+ void comment(KTextEditor::ViewPrivate *view, uint line, uint column, int change);
+ void align(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range);
+ void insertTab(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &);
enum TextTransform { Uppercase, Lowercase, Capitalize };
@@ -752,7 +752,7 @@ public:
lowercase the character right of the cursor is transformed, for capitalize
the word under the cursor is transformed.
*/
- void transform(KateView *view, const KTextEditor::Cursor &, TextTransform);
+ void transform(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &, TextTransform);
/**
Unwrap a range of lines.
*/
@@ -810,11 +810,11 @@ private:
* Add a comment marker as defined by the language providing the attribute
* @p attrib to each line in the selection.
*/
- void addStartStopCommentToSelection(KateView *view, int attrib = 0);
+ void addStartStopCommentToSelection(KTextEditor::ViewPrivate *view, int attrib = 0);
/**
* @see addStartStopCommentToSelection.
*/
- void addStartLineCommentToSelection(KateView *view, int attrib = 0);
+ void addStartLineCommentToSelection(KTextEditor::ViewPrivate *view, int attrib = 0);
/**
* Removes comment markers relevant to the language providing
@@ -822,11 +822,11 @@ private:
*
* @return whether the operation succeeded.
*/
- bool removeStartStopCommentFromSelection(KateView *view, int attrib = 0);
+ bool removeStartStopCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib = 0);
/**
* @see removeStartStopCommentFromSelection.
*/
- bool removeStartLineCommentFromSelection(KateView *view, int attrib = 0);
+ bool removeStartLineCommentFromSelection(KTextEditor::ViewPrivate *view, int attrib = 0);
public:
void newBracketMark(const KTextEditor::Cursor &start, KTextEditor::Range &bm, int maxLines = -1);
diff --git a/src/include/ktexteditor/view.h b/src/include/ktexteditor/view.h
index 83266a4..5d185c8 100644
--- a/src/include/ktexteditor/view.h
+++ b/src/include/ktexteditor/view.h
@@ -37,6 +37,7 @@ namespace KTextEditor
class Document;
class MainWindow;
+class ViewPrivate;
/**
* \brief A text widget with KXMLGUIClient that represents a Document.
@@ -151,16 +152,21 @@ class KTEXTEDITOR_EXPORT View : public QWidget, public KXMLGUIClient
{
Q_OBJECT
-public:
+protected:
/**
* Constructor.
*
* Create a view attached to the widget \p parent.
+ *
+ * Pass it the internal implementation to store a d-pointer.
+ *
+ * \param impl d-pointer to use
* \param parent parent widget
* \see Document::createView()
*/
- View(QWidget *parent);
+ View (ViewPrivate *impl, QWidget *parent);
+public:
/**
* Virtual destructor.
*/
@@ -607,7 +613,7 @@ public:
virtual void printPreview() = 0;
private:
- class ViewPrivate *const d;
+ ViewPrivate *const d;
};
}
diff --git a/src/mode/katemodeconfigpage.cpp b/src/mode/katemodeconfigpage.cpp
index 94aad28..ae7ff6a 100644
--- a/src/mode/katemodeconfigpage.cpp
+++ b/src/mode/katemodeconfigpage.cpp
@@ -153,7 +153,7 @@ void ModeConfigPage::update()
// get current filetype from active view via the host application
int currentIndex = 0;
- KateView *kv = qobject_cast<KateView *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView());
+ KTextEditor::ViewPrivate *kv = qobject_cast<KTextEditor::ViewPrivate *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView());
if (kv) {
const QString filetypeName = kv->doc()->fileType();
for (int i = 0; i < m_types.size(); ++i) {
diff --git a/src/printing/kateprinter.cpp b/src/printing/kateprinter.cpp
index 0a3f1d6..f88c0c4 100644
--- a/src/printing/kateprinter.cpp
+++ b/src/printing/kateprinter.cpp
@@ -45,7 +45,7 @@ class KatePrinterPrivate : public QObject
{
Q_OBJECT
public:
- KatePrinterPrivate(KateView *view);
+ KatePrinterPrivate(KTextEditor::ViewPrivate *view);
~KatePrinterPrivate();
bool print(QPrinter *printer);
@@ -54,12 +54,12 @@ public Q_SLOTS:
void paint(QPrinter *printer);
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateDocument *m_doc;
PrintPainter *m_painter;
};
-KatePrinterPrivate::KatePrinterPrivate(KateView *view)
+KatePrinterPrivate::KatePrinterPrivate(KTextEditor::ViewPrivate *view)
: QObject()
, m_view (view)
, m_doc(m_view->doc())
@@ -142,14 +142,14 @@ void KatePrinterPrivate::paint(QPrinter *printer)
//BEGIN KatePrinter
-bool KatePrinter::print(KateView *view)
+bool KatePrinter::print(KTextEditor::ViewPrivate *view)
{
QPrinter printer;
KatePrinterPrivate p(view);
return p.print(&printer);
}
-bool KatePrinter::printPreview(KateView *view)
+bool KatePrinter::printPreview(KTextEditor::ViewPrivate *view)
{
QPrinter printer;
KatePrinterPrivate p(view);
diff --git a/src/printing/kateprinter.h b/src/printing/kateprinter.h
index ecb00f5..6e08d25 100644
--- a/src/printing/kateprinter.h
+++ b/src/printing/kateprinter.h
@@ -23,12 +23,12 @@
#ifndef __KATE_PRINTER_H__
#define __KATE_PRINTER_H__
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
namespace KatePrinter
{
-bool print(KateView *doc);
-bool printPreview(KateView *doc);
+bool print(KTextEditor::ViewPrivate *doc);
+bool printPreview(KTextEditor::ViewPrivate *doc);
};
#endif
diff --git a/src/printing/printpainter.cpp b/src/printing/printpainter.cpp
index 08b7329..e776eac 100644
--- a/src/printing/printpainter.cpp
+++ b/src/printing/printpainter.cpp
@@ -83,7 +83,7 @@ public:
KTextEditor::Range selectionRange;
};
-PrintPainter::PrintPainter(KateView *view)
+PrintPainter::PrintPainter(KTextEditor::ViewPrivate *view)
: m_view (view)
, m_doc(m_view->doc())
, m_colorScheme()
diff --git a/src/printing/printpainter.h b/src/printing/printpainter.h
index 635f495..8b26626 100644
--- a/src/printing/printpainter.h
+++ b/src/printing/printpainter.h
@@ -28,7 +28,7 @@
#include <QFont>
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateRenderer;
class QPrinter;
class QPainter;
@@ -50,7 +50,7 @@ class PageLayout;
class PrintPainter
{
public:
- PrintPainter(KateView *view);
+ PrintPainter(KTextEditor::ViewPrivate *view);
~PrintPainter();
void paint(QPrinter *printer) const;
@@ -129,7 +129,7 @@ private:
void configure(const QPrinter *printer, PageLayout &layout) const;
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateDocument *m_doc;
QString m_colorScheme;
diff --git a/src/render/katerenderer.cpp b/src/render/katerenderer.cpp
index 4f91886..97bda83 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, KateView *view)
+KateRenderer::KateRenderer(KateDocument *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 34233ae..0fc9e1f 100644
--- a/src/render/katerenderer.h
+++ b/src/render/katerenderer.h
@@ -33,7 +33,7 @@
#include <QTextLine>
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateRendererConfig;
class KateRenderRange;
namespace Kate
@@ -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, KateView *view = 0);
+ explicit KateRenderer(KateDocument *doc, Kate::TextFolding &folding, KTextEditor::ViewPrivate *view = 0);
/**
* Destructor
@@ -105,7 +105,7 @@ public:
/**
* Returns the view to which this renderer is bound
*/
- KateView *view() const
+ KTextEditor::ViewPrivate *view() const
{
return m_view;
}
@@ -378,7 +378,7 @@ private:
KateDocument *const m_doc;
Kate::TextFolding &m_folding;
- KateView *const m_view;
+ KTextEditor::ViewPrivate *const m_view;
// cache of config values
int m_tabWidth;
diff --git a/src/schema/kateschema.cpp b/src/schema/kateschema.cpp
index a91b386..77ea5e7 100644
--- a/src/schema/kateschema.cpp
+++ b/src/schema/kateschema.cpp
@@ -86,14 +86,14 @@ void KateViewSchemaAction::init()
connect(menu(), SIGNAL(aboutToShow()), this, SLOT(slotAboutToShow()));
}
-void KateViewSchemaAction::updateMenu(KateView *view)
+void KateViewSchemaAction::updateMenu(KTextEditor::ViewPrivate *view)
{
m_view = view;
}
void KateViewSchemaAction::slotAboutToShow()
{
- KateView *view = m_view;
+ KTextEditor::ViewPrivate *view = m_view;
QList<KateSchema> schemas = KTextEditor::EditorPrivate::self()->schemaManager()->list();
@@ -135,7 +135,7 @@ void KateViewSchemaAction::setSchema()
}
QString mode = action->data().toString();
- KateView *view = m_view;
+ KTextEditor::ViewPrivate *view = m_view;
if (view) {
view->renderer()->config()->setSchema(mode);
diff --git a/src/schema/kateschema.h b/src/schema/kateschema.h
index 0fb4880..4a08143 100644
--- a/src/schema/kateschema.h
+++ b/src/schema/kateschema.h
@@ -28,7 +28,7 @@
#include <QStringList>
#include <QPointer>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class QActionGroup;
class KateSchema
@@ -89,12 +89,12 @@ public:
init();
}
- void updateMenu(KateView *view);
+ void updateMenu(KTextEditor::ViewPrivate *view);
private:
void init();
- QPointer<KateView> m_view;
+ QPointer<KTextEditor::ViewPrivate> m_view;
QStringList names;
QActionGroup *m_group;
int last;
diff --git a/src/schema/kateschemaconfig.cpp b/src/schema/kateschemaconfig.cpp
index 14cb8ca..0b399d9 100644
--- a/src/schema/kateschemaconfig.cpp
+++ b/src/schema/kateschemaconfig.cpp
@@ -624,7 +624,7 @@ KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab(KateSchemaConfigDefau
// get current highlighting from the host application
int hl = 0;
- KateView *kv = qobject_cast<KateView *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView());
+ KTextEditor::ViewPrivate *kv = qobject_cast<KTextEditor::ViewPrivate *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView());
if (kv) {
const QString hlName = kv->doc()->highlight()->name();
hl = KateHlManager::self()->nameFind(hlName);
diff --git a/src/script/katecommandlinescript.cpp b/src/script/katecommandlinescript.cpp
index 3da7d82..57f818e 100644
--- a/src/script/katecommandlinescript.cpp
+++ b/src/script/katecommandlinescript.cpp
@@ -127,12 +127,12 @@ bool KateCommandLineScript::exec(KTextEditor::View *view, const QString &cmd, QS
return false;
}
- if (setView(qobject_cast<KateView *>(view))) {
+ if (setView(qobject_cast<KTextEditor::ViewPrivate *>(view))) {
// setView fails if the script cannot be loaded
// balance edit stack in any case!
- qobject_cast<KateView *>(view)->doc()->pushEditState();
+ qobject_cast<KTextEditor::ViewPrivate *>(view)->doc()->pushEditState();
bool success = callFunction(_cmd, args, msg);
- qobject_cast<KateView *>(view)->doc()->popEditState();
+ qobject_cast<KTextEditor::ViewPrivate *>(view)->doc()->popEditState();
return success;
}
@@ -153,7 +153,7 @@ bool KateCommandLineScript::supportsRange(const QString &)
bool KateCommandLineScript::help(KTextEditor::View *view, const QString &cmd, QString &msg)
{
- if (!setView(qobject_cast<KateView *>(view))) {
+ if (!setView(qobject_cast<KTextEditor::ViewPrivate *>(view))) {
// setView fails, if the script cannot be loaded
return false;
}
diff --git a/src/script/kateindentscript.cpp b/src/script/kateindentscript.cpp
index 748c3c8..7b927ed 100644
--- a/src/script/kateindentscript.cpp
+++ b/src/script/kateindentscript.cpp
@@ -53,7 +53,7 @@ const QString &KateIndentScript::triggerCharacters()
return m_triggerCharacters;
}
-QPair<int, int> KateIndentScript::indent(KateView *view, const KTextEditor::Cursor &position,
+QPair<int, int> KateIndentScript::indent(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &position,
QChar typedCharacter, int indentWidth)
{
// if it hasn't loaded or we can't load, return
diff --git a/src/script/kateindentscript.h b/src/script/kateindentscript.h
index 47e50d6..3818049 100644
--- a/src/script/kateindentscript.h
+++ b/src/script/kateindentscript.h
@@ -119,7 +119,7 @@ public:
* Returns a pair where the first value is the indent amount, and the second
* value is the alignment.
*/
- QPair<int, int> indent(KateView *view, const KTextEditor::Cursor &position,
+ QPair<int, int> indent(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &position,
QChar typedCharacter, int indentWidth);
private:
diff --git a/src/script/katescript.cpp b/src/script/katescript.cpp
index 191911e..1d322e9 100644
--- a/src/script/katescript.cpp
+++ b/src/script/katescript.cpp
@@ -221,7 +221,7 @@ bool KateScript::hasException(const QScriptValue &object, const QString &file)
return false;
}
-bool KateScript::setView(KateView *view)
+bool KateScript::setView(KTextEditor::ViewPrivate *view)
{
if (!load()) {
return false;
diff --git a/src/script/katescript.h b/src/script/katescript.h
index 5521a99..93e7277 100644
--- a/src/script/katescript.h
+++ b/src/script/katescript.h
@@ -25,7 +25,7 @@
class QScriptEngine;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateScriptDocument;
class KateScriptView;
@@ -157,7 +157,7 @@ public:
* set view for this script for the execution
* will trigger load!
*/
- bool setView(KateView *view);
+ bool setView(KTextEditor::ViewPrivate *view);
/**
* Get a QScriptValue for a global item in the script given its name, or an
diff --git a/src/script/katescriptaction.cpp b/src/script/katescriptaction.cpp
index afe317e..26c35ff 100644
--- a/src/script/katescriptaction.cpp
+++ b/src/script/katescriptaction.cpp
@@ -30,7 +30,7 @@
#include <KActionCollection>
//BEGIN KateScriptAction
-KateScriptAction::KateScriptAction(const ScriptActionInfo &info, KateView *view)
+KateScriptAction::KateScriptAction(const ScriptActionInfo &info, KTextEditor::ViewPrivate *view)
: QAction(info.text(), view)
, m_view(view)
, m_command(info.command())
@@ -65,7 +65,7 @@ void KateScriptAction::exec()
//END KateScriptAction
//BEGIN KateScriptActionMenu
-KateScriptActionMenu::KateScriptActionMenu(KateView *view, const QString &text)
+KateScriptActionMenu::KateScriptActionMenu(KTextEditor::ViewPrivate *view, const QString &text)
: KActionMenu(QIcon::fromTheme(QLatin1String("code-context")), text, view)
, m_view(view)
{
diff --git a/src/script/katescriptaction.h b/src/script/katescriptaction.h
index 17f9bab..9122b8c 100644
--- a/src/script/katescriptaction.h
+++ b/src/script/katescriptaction.h
@@ -26,7 +26,7 @@
#include <QAction>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
/**
* KateScriptAction is an action that executes a commandline-script
@@ -37,14 +37,14 @@ class KateScriptAction : public QAction
Q_OBJECT
public:
- KateScriptAction(const ScriptActionInfo &info, KateView *view);
+ KateScriptAction(const ScriptActionInfo &info, KTextEditor::ViewPrivate *view);
virtual ~KateScriptAction();
public Q_SLOTS:
void exec();
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
QString m_command;
bool m_interactive;
};
@@ -59,7 +59,7 @@ class KateScriptActionMenu : public KActionMenu
Q_OBJECT
public:
- KateScriptActionMenu(KateView *view, const QString &text);
+ KateScriptActionMenu(KTextEditor::ViewPrivate *view, const QString &text);
~KateScriptActionMenu();
void cleanup();
@@ -68,7 +68,7 @@ public Q_SLOTS:
void repopulate();
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
QList<QMenu *> m_menus;
QList<QAction *> m_actions;
};
diff --git a/src/script/katescriptconsole.cpp b/src/script/katescriptconsole.cpp
index e54b7d3..1472131 100644
--- a/src/script/katescriptconsole.cpp
+++ b/src/script/katescriptconsole.cpp
@@ -32,7 +32,7 @@
//END Includes
//BEGIN KateScriptConsoleEngine
-KateScriptConsoleEngine::KateScriptConsoleEngine(KateView *view)
+KateScriptConsoleEngine::KateScriptConsoleEngine(KTextEditor::ViewPrivate *view)
: m_view(view)
{
m_utilsUrl = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("katepart/script/commands/utils.js"));
@@ -98,7 +98,7 @@ const QString KateScriptConsoleEngine::getFirstFunctionName(const QString &text,
//END KateScriptConsoleEngine
//BEGIN KateScriptConsole
-KateScriptConsole::KateScriptConsole(KateView *view, QWidget *parent)
+KateScriptConsole::KateScriptConsole(KTextEditor::ViewPrivate *view, QWidget *parent)
: KateViewBarWidget(true, parent)
, m_view(view)
{
diff --git a/src/script/katescriptconsole.h b/src/script/katescriptconsole.h
index e83c350..c0c22b2 100644
--- a/src/script/katescriptconsole.h
+++ b/src/script/katescriptconsole.h
@@ -37,7 +37,7 @@ class KateScriptConsoleEngine
{
public:
/** Constructor + Destructor */
- KateScriptConsoleEngine(KateView *view);
+ KateScriptConsoleEngine(KTextEditor::ViewPrivate *view);
virtual ~KateScriptConsoleEngine();
/**
@@ -52,7 +52,7 @@ private:
QString m_utilsUrl;
/** Just a Kate view :) */
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
private:
/**
@@ -70,7 +70,7 @@ class KateScriptConsole : public KateViewBarWidget
Q_OBJECT
public:
- KateScriptConsole(KateView *view, QWidget *parent = NULL);
+ KateScriptConsole(KTextEditor::ViewPrivate *view, QWidget *parent = NULL);
virtual ~KateScriptConsole();
protected:
@@ -83,7 +83,7 @@ private:
QTextEdit *m_edit;
QPushButton *m_execute;
QLabel *m_result;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateScriptConsoleEngine *m_engine;
public Q_SLOTS:
diff --git a/src/script/katescriptdocument.cpp b/src/script/katescriptdocument.cpp
index b0580ae..c750252 100644
--- a/src/script/katescriptdocument.cpp
+++ b/src/script/katescriptdocument.cpp
@@ -191,7 +191,7 @@ KTextEditor::Cursor KateScriptDocument::rfind(int line, int column, const QStrin
QScopedPointer<KTextEditor::MovingCursor> cursor(document()->newMovingCursor(KTextEditor::Cursor(line, column)));
const int start = cursor->line();
QList<KTextEditor::Attribute::Ptr> attributes =
- m_document->highlight()->attributes(static_cast<KateView *>(m_document->activeView())->renderer()->config()->schema());
+ m_document->highlight()->attributes(static_cast<KTextEditor::ViewPrivate *>(m_document->activeView())->renderer()->config()->schema());
do {
Kate::TextLine textLine = m_document->plainKateTextLine(cursor->line());
@@ -233,7 +233,7 @@ KTextEditor::Cursor KateScriptDocument::rfind(const KTextEditor::Cursor &cursor,
KTextEditor::Cursor KateScriptDocument::anchor(int line, int column, QChar character)
{
QList<KTextEditor::Attribute::Ptr> attributes =
- m_document->highlight()->attributes(static_cast<KateView *>(m_document->activeView())->renderer()->config()->schema());
+ m_document->highlight()->attributes(static_cast<KTextEditor::ViewPrivate *>(m_document->activeView())->renderer()->config()->schema());
int count = 1;
QChar lc;
QChar rc;
@@ -690,7 +690,7 @@ bool KateScriptDocument::isAttribute(const KTextEditor::Cursor &cursor, int attr
QString KateScriptDocument::attributeName(int line, int column)
{
- QList<KTextEditor::Attribute::Ptr> attributes = m_document->highlight()->attributes(static_cast<KateView *>(m_document->activeView())->renderer()->config()->schema());
+ QList<KTextEditor::Attribute::Ptr> attributes = m_document->highlight()->attributes(static_cast<KTextEditor::ViewPrivate *>(m_document->activeView())->renderer()->config()->schema());
KTextEditor::Attribute::Ptr a = attributes[document()->plainKateTextLine(line)->attribute(column)];
return a->property(KateExtendedAttribute::AttributeName).toString();
}
diff --git a/src/script/katescriptview.cpp b/src/script/katescriptview.cpp
index 5f04aa7..5e28e53 100644
--- a/src/script/katescriptview.cpp
+++ b/src/script/katescriptview.cpp
@@ -29,12 +29,12 @@ KateScriptView::KateScriptView(QObject *parent)
{
}
-void KateScriptView::setView(KateView *view)
+void KateScriptView::setView(KTextEditor::ViewPrivate *view)
{
m_view = view;
}
-KateView *KateScriptView::view()
+KTextEditor::ViewPrivate *KateScriptView::view()
{
return m_view;
}
diff --git a/src/script/katescriptview.h b/src/script/katescriptview.h
index 429b80d..5b8e611 100644
--- a/src/script/katescriptview.h
+++ b/src/script/katescriptview.h
@@ -28,10 +28,10 @@
#include <ktexteditor/cursor.h>
#include <ktexteditor/range.h>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
/**
- * Thinish wrapping around KateView, exposing the methods we want exposed
+ * Thinish wrapping around KTextEditor::ViewPrivate, exposing the methods we want exposed
* and adding some helper methods.
*
* We inherit from QScriptable to have more thight access to the scripting
@@ -47,8 +47,8 @@ class KTEXTEDITOR_EXPORT KateScriptView : public QObject, protected QScriptable
public:
KateScriptView(QObject *parent = 0);
- void setView(KateView *view);
- KateView *view();
+ void setView(KTextEditor::ViewPrivate *view);
+ KTextEditor::ViewPrivate *view();
Q_INVOKABLE KTextEditor::Cursor cursorPosition();
/**
@@ -73,7 +73,7 @@ public:
Q_INVOKABLE void align(const KTextEditor::Range &range);
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
};
#endif
diff --git a/src/script/katetemplatescript.cpp b/src/script/katetemplatescript.cpp
index 1b6e1f9..dd68556 100644
--- a/src/script/katetemplatescript.cpp
+++ b/src/script/katetemplatescript.cpp
@@ -30,7 +30,7 @@ KateTemplateScript::KateTemplateScript(const QString &script)
KateTemplateScript::~KateTemplateScript() {}
-QString KateTemplateScript::invoke(KateView *view, const QString &functionName, const QString &srcText)
+QString KateTemplateScript::invoke(KTextEditor::ViewPrivate *view, const QString &functionName, const QString &srcText)
{
if (!setView(view)) {
diff --git a/src/script/katetemplatescript.h b/src/script/katetemplatescript.h
index 3703bfe..da57405 100644
--- a/src/script/katetemplatescript.h
+++ b/src/script/katetemplatescript.h
@@ -30,7 +30,7 @@ public:
KateTemplateScript(const QString &script);
virtual ~KateTemplateScript();
- QString invoke(KateView *view, const QString &functionName, const QString &srcText/*, ....*/);
+ QString invoke(KTextEditor::ViewPrivate *view, const QString &functionName, const QString &srcText/*, ....*/);
};
#endif
diff --git a/src/search/katesearchbar.cpp b/src/search/katesearchbar.cpp
index 8ddb65b..fb9ff14 100644
--- a/src/search/katesearchbar.cpp
+++ b/src/search/katesearchbar.cpp
@@ -134,7 +134,7 @@ public:
} // anon namespace
-KateSearchBar::KateSearchBar(bool initAsPower, KateView *view, KateViewConfig *config)
+KateSearchBar::KateSearchBar(bool initAsPower, KTextEditor::ViewPrivate *view, KateViewConfig *config)
: KateViewBarWidget(true, view),
m_view(view),
m_config(config),
@@ -366,7 +366,7 @@ void KateSearchBar::indicateMatch(MatchResult matchResult)
lineEdit->setPalette(background);
}
-/*static*/ void KateSearchBar::selectRange(KateView *view, const KTextEditor::Range &range)
+/*static*/ void KateSearchBar::selectRange(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range)
{
view->setCursorPositionInternal(range.end());
view->setSelection(range);
@@ -1181,7 +1181,7 @@ void KateSearchBar::onPowerModeChanged(int /*index*/)
givePatternFeedback();
}
-/*static*/ void KateSearchBar::nextMatchForSelection(KateView *view, SearchDirection searchDirection)
+/*static*/ void KateSearchBar::nextMatchForSelection(KTextEditor::ViewPrivate *view, SearchDirection searchDirection)
{
const bool selected = view->selection();
if (selected) {
diff --git a/src/search/katesearchbar.h b/src/search/katesearchbar.h
index fe48132..5c3d681 100644
--- a/src/search/katesearchbar.h
+++ b/src/search/katesearchbar.h
@@ -28,7 +28,7 @@
#include <ktexteditor/attribute.h>
#include <ktexteditor/searchinterface.h>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateViewConfig;
class QVBoxLayout;
class QComboBox;
@@ -76,7 +76,7 @@ public:
};
public:
- explicit KateSearchBar(bool initAsPower, KateView *view, KateViewConfig *config);
+ explicit KateSearchBar(bool initAsPower, KTextEditor::ViewPrivate *view, KateViewConfig *config);
~KateSearchBar();
virtual void closed();
@@ -89,8 +89,8 @@ public:
bool selectionOnly() const;
bool matchCase() const;
- // Only used by KateView
- static void nextMatchForSelection(KateView *view, SearchDirection searchDirection);
+ // Only used by KTextEditor::ViewPrivate
+ static void nextMatchForSelection(KTextEditor::ViewPrivate *view, SearchDirection searchDirection);
public Q_SLOTS:
/**
@@ -117,7 +117,7 @@ public Q_SLOTS:
void replaceNext();
void replaceAll();
- // Also used by KateView
+ // Also used by KTextEditor::ViewPrivate
void enterPowerMode();
void enterIncrementalMode();
@@ -159,7 +159,7 @@ private:
void highlightMatch(const KTextEditor::Range &range);
void highlightReplacement(const KTextEditor::Range &range);
void indicateMatch(MatchResult matchResult);
- static void selectRange(KateView *view, const KTextEditor::Range &range);
+ static void selectRange(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range);
void selectRange2(const KTextEditor::Range &range);
QVector<QString> getCapturePatterns(const QString &pattern) const;
@@ -174,7 +174,7 @@ private:
void showInfoMessage(const QString &text);
private:
- KateView *const m_view;
+ KTextEditor::ViewPrivate *const m_view;
KateViewConfig *const m_config;
QList<KTextEditor::MovingRange *> m_hlRanges;
QPointer<KTextEditor::Message> m_infoMessage;
diff --git a/src/spellcheck/ontheflycheck.cpp b/src/spellcheck/ontheflycheck.cpp
index cfcace5..455a77f 100644
--- a/src/spellcheck/ontheflycheck.cpp
+++ b/src/spellcheck/ontheflycheck.cpp
@@ -147,7 +147,7 @@ void KateOnTheFlyChecker::textInserted(KTextEditor::Document *document, const KT
}
// for performance reasons we only want to schedule spellchecks for ranges that are visible
foreach (KTextEditor::View *i, m_document->views()) {
- KateView *view = static_cast<KateView *>(i);
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(i);
KTextEditor::Range visibleIntersection = documentIntersection.intersect(view->visibleRange());
if (visibleIntersection.isValid()) { // allow empty intersections
// we don't handle this directly as the highlighting information might not be up-to-date yet
@@ -237,7 +237,7 @@ void KateOnTheFlyChecker::textRemoved(KTextEditor::Document *document, const KTe
// for performance reasons we only want to schedule spellchecks for ranges that are visible
foreach (KTextEditor::View *i, m_document->views()) {
- KateView *view = static_cast<KateView *>(i);
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(i);
KTextEditor::Range visibleIntersection = documentIntersection.intersect(view->visibleRange());
if (visibleIntersection.isValid()) { // see above
// we don't handle this directly as the highlighting information might not be up-to-date yet
@@ -315,7 +315,7 @@ void KateOnTheFlyChecker::handleRemovedText(const KTextEditor::Range &range)
const QList<KTextEditor::View *> &viewList = m_document->views();
for (QList<KTextEditor::View *>::const_iterator i = viewList.begin(); i != viewList.end(); ++i) {
- KateView *view = static_cast<KateView *>(*i);
+ KTextEditor::ViewPrivate *view = static_cast<KTextEditor::ViewPrivate *>(*i);
const KTextEditor::Range visibleRange = view->visibleRange();
KTextEditor::Range intersection = visibleRange.intersect(rangeBelow);
if (intersection.isValid()) {
@@ -480,13 +480,13 @@ void KateOnTheFlyChecker::rangeInvalid(KTextEditor::MovingRange *range)
void KateOnTheFlyChecker::mouseEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
{
- KateView *kateView = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *kateView = static_cast<KTextEditor::ViewPrivate *>(view);
kateView->spellingMenu()->mouseEnteredMisspelledRange(range);
}
void KateOnTheFlyChecker::mouseExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
{
- KateView *kateView = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *kateView = static_cast<KTextEditor::ViewPrivate *>(view);
kateView->spellingMenu()->mouseExitedMisspelledRange(range);
}
@@ -496,13 +496,13 @@ void KateOnTheFlyChecker::mouseExitedRange(KTextEditor::MovingRange *range, KTex
**/
void KateOnTheFlyChecker::caretEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
{
- KateView *kateView = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *kateView = static_cast<KTextEditor::ViewPrivate *>(view);
kateView->spellingMenu()->caretEnteredMisspelledRange(range);
}
void KateOnTheFlyChecker::caretExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
{
- KateView *kateView = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *kateView = static_cast<KTextEditor::ViewPrivate *>(view);
kateView->spellingMenu()->caretExitedMisspelledRange(range);
}
@@ -513,7 +513,7 @@ void KateOnTheFlyChecker::deleteMovingRange(KTextEditor::MovingRange *range)
removeRangeFromEverything(range);
range->setFeedback(NULL);
foreach (KTextEditor::View *view, m_document->views()) {
- static_cast<KateView *>(view)->spellingMenu()->rangeDeleted(range);
+ static_cast<KTextEditor::ViewPrivate *>(view)->spellingMenu()->rangeDeleted(range);
}
delete(range);
}
@@ -670,8 +670,8 @@ void KateOnTheFlyChecker::addView(KTextEditor::Document *document, KTextEditor::
Q_UNUSED(document);
ON_THE_FLY_DEBUG;
connect(view, SIGNAL(destroyed(QObject*)), this, SLOT(viewDestroyed(QObject*)));
- connect(view, SIGNAL(displayRangeChanged(KateView*)), this, SLOT(restartViewRefreshTimer(KateView*)));
- updateInstalledMovingRanges(static_cast<KateView *>(view));
+ connect(view, SIGNAL(displayRangeChanged(KTextEditor::ViewPrivate*)), this, SLOT(restartViewRefreshTimer(KTextEditor::ViewPrivate*)));
+ updateInstalledMovingRanges(static_cast<KTextEditor::ViewPrivate *>(view));
}
void KateOnTheFlyChecker::viewDestroyed(QObject *obj)
@@ -687,7 +687,7 @@ void KateOnTheFlyChecker::removeView(KTextEditor::View *view)
m_displayRangeMap.remove(view);
}
-void KateOnTheFlyChecker::updateInstalledMovingRanges(KateView *view)
+void KateOnTheFlyChecker::updateInstalledMovingRanges(KTextEditor::ViewPrivate *view)
{
Q_ASSERT(m_document == view->document());
ON_THE_FLY_DEBUG;
@@ -702,7 +702,7 @@ void KateOnTheFlyChecker::updateInstalledMovingRanges(KateView *view)
if (!movingRange->overlaps(newDisplayRange)) {
bool stillVisible = false;
foreach (KTextEditor::View *it2, m_document->views()) {
- KateView *view2 = static_cast<KateView *>(it2);
+ KTextEditor::ViewPrivate *view2 = static_cast<KTextEditor::ViewPrivate *>(it2);
if (view != view2 && movingRange->overlaps(view2->visibleRange())) {
stillVisible = true;
break;
@@ -721,7 +721,7 @@ void KateOnTheFlyChecker::updateInstalledMovingRanges(KateView *view)
if (!oldDisplayRange.containsLine(line)) {
bool visible = false;
foreach (KTextEditor::View *it2, m_document->views()) {
- KateView *view2 = static_cast<KateView *>(it2);
+ KTextEditor::ViewPrivate *view2 = static_cast<KTextEditor::ViewPrivate *>(it2);
if (view != view2 && view2->visibleRange().containsLine(line)) {
visible = true;
break;
@@ -742,11 +742,11 @@ void KateOnTheFlyChecker::queueSpellCheckVisibleRange(const KTextEditor::Range &
{
const QList<KTextEditor::View *> &viewList = m_document->views();
for (QList<KTextEditor::View *>::const_iterator i = viewList.begin(); i != viewList.end(); ++i) {
- queueSpellCheckVisibleRange(static_cast<KateView *>(*i), range);
+ queueSpellCheckVisibleRange(static_cast<KTextEditor::ViewPrivate *>(*i), range);
}
}
-void KateOnTheFlyChecker::queueSpellCheckVisibleRange(KateView *view, const KTextEditor::Range &range)
+void KateOnTheFlyChecker::queueSpellCheckVisibleRange(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range)
{
Q_ASSERT(m_document == view->doc());
KTextEditor::Range visibleRange = view->visibleRange();
@@ -845,7 +845,7 @@ void KateOnTheFlyChecker::viewRefreshTimeout()
m_refreshView = NULL;
}
-void KateOnTheFlyChecker::restartViewRefreshTimer(KateView *view)
+void KateOnTheFlyChecker::restartViewRefreshTimer(KTextEditor::ViewPrivate *view)
{
if (m_refreshView && view != m_refreshView) { // a new view should be refreshed
updateInstalledMovingRanges(m_refreshView); // so refresh the old one first
@@ -858,7 +858,7 @@ void KateOnTheFlyChecker::deleteMovingRangeQuickly(KTextEditor::MovingRange *ran
{
range->setFeedback(NULL);
foreach (KTextEditor::View *view, m_document->views()) {
- static_cast<KateView *>(view)->spellingMenu()->rangeDeleted(range);
+ static_cast<KTextEditor::ViewPrivate *>(view)->spellingMenu()->rangeDeleted(range);
}
delete(range);
}
diff --git a/src/spellcheck/ontheflycheck.h b/src/spellcheck/ontheflycheck.h
index fdcad3a..03c1dd7 100644
--- a/src/spellcheck/ontheflycheck.h
+++ b/src/spellcheck/ontheflycheck.h
@@ -68,7 +68,7 @@ public Q_SLOTS:
void updateConfig();
void refreshSpellCheck(const KTextEditor::Range &range = KTextEditor::Range::invalid());
- void updateInstalledMovingRanges(KateView *view);
+ void updateInstalledMovingRanges(KTextEditor::ViewPrivate *view);
protected:
KateDocument *const m_document;
@@ -92,13 +92,13 @@ protected:
**/
void queueLineSpellCheck(const KTextEditor::Range &range, const QString &dictionary);
void queueSpellCheckVisibleRange(const KTextEditor::Range &range);
- void queueSpellCheckVisibleRange(KateView *view, const KTextEditor::Range &range);
+ void queueSpellCheckVisibleRange(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range);
void addToSpellCheckQueue(const KTextEditor::Range &range, const QString &dictionary);
void addToSpellCheckQueue(KTextEditor::MovingRange *range, const QString &dictionary);
QTimer *m_viewRefreshTimer;
- QPointer<KateView> m_refreshView;
+ QPointer<KTextEditor::ViewPrivate> m_refreshView;
virtual void removeRangeFromEverything(KTextEditor::MovingRange *range);
bool removeRangeFromCurrentSpellCheck(KTextEditor::MovingRange *range);
@@ -127,7 +127,7 @@ protected Q_SLOTS:
void addView(KTextEditor::Document *document, KTextEditor::View *view);
void removeView(KTextEditor::View *view);
- void restartViewRefreshTimer(KateView *view);
+ void restartViewRefreshTimer(KTextEditor::ViewPrivate *view);
void viewRefreshTimeout();
void handleModifiedRanges();
diff --git a/src/spellcheck/spellcheckdialog.cpp b/src/spellcheck/spellcheckdialog.cpp
index a8dd14f..5cfde39 100644
--- a/src/spellcheck/spellcheckdialog.cpp
+++ b/src/spellcheck/spellcheckdialog.cpp
@@ -40,7 +40,7 @@
#include <sonnet/backgroundchecker.h>
#include <sonnet/speller.h>
-KateSpellCheckDialog::KateSpellCheckDialog(KateView *view)
+KateSpellCheckDialog::KateSpellCheckDialog(KTextEditor::ViewPrivate *view)
: QObject(view)
, m_view(view)
, m_speller(NULL)
diff --git a/src/spellcheck/spellcheckdialog.h b/src/spellcheck/spellcheckdialog.h
index 09eccdd..832afcb 100644
--- a/src/spellcheck/spellcheckdialog.h
+++ b/src/spellcheck/spellcheckdialog.h
@@ -29,7 +29,7 @@
#include <QObject>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class QAction;
class KActionCollection;
@@ -53,7 +53,7 @@ class KateSpellCheckDialog : public QObject
Q_OBJECT
public:
- explicit KateSpellCheckDialog(KateView *);
+ explicit KateSpellCheckDialog(KTextEditor::ViewPrivate *);
~KateSpellCheckDialog();
void createActions(KActionCollection *);
@@ -92,7 +92,7 @@ private Q_SLOTS:
private:
KTextEditor::Cursor locatePosition(int pos);
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
QAction *m_spellcheckSelection;
Sonnet::Speller *m_speller;
diff --git a/src/spellcheck/spellingmenu.cpp b/src/spellcheck/spellingmenu.cpp
index 0957ebc..a99dd56 100644
--- a/src/spellcheck/spellingmenu.cpp
+++ b/src/spellcheck/spellingmenu.cpp
@@ -29,7 +29,7 @@
#include <KLocalizedString>
#include "katepartdebug.h"
-KateSpellingMenu::KateSpellingMenu(KateView *view)
+KateSpellingMenu::KateSpellingMenu(KTextEditor::ViewPrivate *view)
: QObject(view),
m_view(view),
m_spellingMenuAction(NULL),
diff --git a/src/spellcheck/spellingmenu.h b/src/spellcheck/spellingmenu.h
index 7cc8d99..1221169 100644
--- a/src/spellcheck/spellingmenu.h
+++ b/src/spellcheck/spellingmenu.h
@@ -31,7 +31,7 @@
#include <ktexteditor/range.h>
#include <ktexteditor/view.h>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateOnTheFlyChecker;
class KateSpellingMenu : public QObject
@@ -40,7 +40,7 @@ class KateSpellingMenu : public QObject
friend class KateOnTheFlyChecker;
public:
- KateSpellingMenu(KateView *view);
+ KateSpellingMenu(KTextEditor::ViewPrivate *view);
virtual ~KateSpellingMenu();
bool isEnabled() const;
@@ -59,7 +59,7 @@ public Q_SLOTS:
void setVisible(bool b);
protected:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KActionMenu *m_spellingMenuAction;
QAction *m_ignoreWordAction, *m_addToDictionaryAction;
QMenu *m_spellingMenu;
diff --git a/src/src/ktexteditor.cpp b/src/src/ktexteditor.cpp
index e72e4e2..8bf3631 100644
--- a/src/src/ktexteditor.cpp
+++ b/src/src/ktexteditor.cpp
@@ -91,9 +91,9 @@ ConfigPage::ConfigPage(QWidget *parent)
ConfigPage::~ConfigPage()
{}
-View::View(QWidget *parent)
- : QWidget(parent), KXMLGUIClient()
- , d(0)
+View::View (ViewPrivate *impl, QWidget *parent)
+ : QWidget (parent), KXMLGUIClient()
+ , d(impl)
{}
View::~View()
diff --git a/src/swapfile/kateswapfile.h b/src/swapfile/kateswapfile.h
index 5e4f31d..410dcab 100644
--- a/src/swapfile/kateswapfile.h
+++ b/src/swapfile/kateswapfile.h
@@ -34,7 +34,7 @@
#include <ktexteditor/messageinterface.h>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
namespace Kate
{
diff --git a/src/utils/kateautoindent.cpp b/src/utils/kateautoindent.cpp
index 46b3789..8793f6f 100644
--- a/src/utils/kateautoindent.cpp
+++ b/src/utils/kateautoindent.cpp
@@ -266,7 +266,7 @@ void KateAutoIndent::reloadScript()
setMode(currentMode);
}
-void KateAutoIndent::scriptIndent(KateView *view, const KTextEditor::Cursor &position, QChar typedChar)
+void KateAutoIndent::scriptIndent(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &position, QChar typedChar)
{
// start edit
doc->pushEditState();
@@ -406,7 +406,7 @@ bool KateAutoIndent::changeIndent(const KTextEditor::Range &range, int change)
return true;
}
-void KateAutoIndent::indent(KateView *view, const KTextEditor::Range &range)
+void KateAutoIndent::indent(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range)
{
// no script, do nothing...
if (!m_script) {
@@ -427,7 +427,7 @@ void KateAutoIndent::indent(KateView *view, const KTextEditor::Range &range)
doc->setUndoMergeAllEdits(false);
}
-void KateAutoIndent::userTypedChar(KateView *view, const KTextEditor::Cursor &position, QChar typedChar)
+void KateAutoIndent::userTypedChar(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &position, QChar typedChar)
{
// normal mode
if (m_mode == MODE_NORMAL) {
diff --git a/src/utils/kateautoindent.h b/src/utils/kateautoindent.h
index 8813358..72c74fb 100644
--- a/src/utils/kateautoindent.h
+++ b/src/utils/kateautoindent.h
@@ -148,7 +148,7 @@ private:
* \param position current cursor position, after the inserted char...
* \param typedChar the inserted char, indent will just give the script '\n'
*/
- void scriptIndent(KateView *view, const KTextEditor::Cursor &position, QChar typedChar);
+ void scriptIndent(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &position, QChar typedChar);
/**
* Return true if the required style for the script is provided by the highlighter.
@@ -204,7 +204,7 @@ public:
* \param view the view the user work at
* \param range the range of text to indent...
*/
- void indent(KateView *view, const KTextEditor::Range &range);
+ void indent(KTextEditor::ViewPrivate *view, const KTextEditor::Range &range);
/**
* The user typed some char, the indenter can react on this
@@ -213,7 +213,7 @@ public:
* \param position current cursor position, after the inserted char...
* \param typedChar the inserted char
*/
- void userTypedChar(KateView *view, const KTextEditor::Cursor &position, QChar typedChar);
+ void userTypedChar(KTextEditor::ViewPrivate *view, const KTextEditor::Cursor &position, QChar typedChar);
public Q_SLOTS:
void reloadScript();
@@ -233,7 +233,7 @@ private:
/**
* This action provides a list of available indenters and gets plugged
- * into the KateView's KActionCollection.
+ * into the KTextEditor::ViewPrivate's KActionCollection.
*/
class KateViewIndentationAction : public KActionMenu
{
diff --git a/src/utils/katebookmarks.cpp b/src/utils/katebookmarks.cpp
index e647f7a..21ebe23 100644
--- a/src/utils/katebookmarks.cpp
+++ b/src/utils/katebookmarks.cpp
@@ -41,7 +41,7 @@ namespace KTextEditor
class Document;
}
-KateBookmarks::KateBookmarks(KateView *view, Sorting sort)
+KateBookmarks::KateBookmarks(KTextEditor::ViewPrivate *view, Sorting sort)
: QObject(view)
, m_view(view)
, m_bookmarkClear(0)
diff --git a/src/utils/katebookmarks.h b/src/utils/katebookmarks.h
index fda3fa7..040fb31 100644
--- a/src/utils/katebookmarks.h
+++ b/src/utils/katebookmarks.h
@@ -23,7 +23,7 @@
#include <QObject>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KToggleAction;
class KActionCollection;
@@ -36,7 +36,7 @@ class KateBookmarks : public QObject
public:
enum Sorting { Position, Creation };
- explicit KateBookmarks(KateView *parent, Sorting sort = Position);
+ explicit KateBookmarks(KTextEditor::ViewPrivate *parent, Sorting sort = Position);
virtual ~KateBookmarks();
void createActions(KActionCollection *);
@@ -68,7 +68,7 @@ private Q_SLOTS:
void marksChanged();
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KToggleAction *m_bookmarkToggle;
QAction *m_bookmarkClear;
QAction *m_goNext;
diff --git a/src/utils/katecmds.cpp b/src/utils/katecmds.cpp
index 930ce39..b5a12df 100644
--- a/src/utils/katecmds.cpp
+++ b/src/utils/katecmds.cpp
@@ -231,7 +231,7 @@ bool KateCommands::CoreCommands::exec(KTextEditor::View *view,
{
#define KCC_ERR(s) { errorMsg=s; return false; }
// cast it hardcore, we know that it is really a kateview :)
- KateView *v = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *v = static_cast<KTextEditor::ViewPrivate *>(view);
if (! v) {
KCC_ERR(i18n("Could not access view"));
@@ -539,7 +539,7 @@ bool KateCommands::ViCommands::exec(KTextEditor::View *view,
{
Q_UNUSED(range)
// cast it hardcore, we know that it is really a kateview :)
- KateView *v = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *v = static_cast<KTextEditor::ViewPrivate *>(view);
if (!v) {
msg = i18n("Could not access view");
@@ -684,7 +684,7 @@ KCompletion *KateCommands::ViCommands::completionObject(KTextEditor::View *view,
{
Q_UNUSED(view)
- KateView *v = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *v = static_cast<KTextEditor::ViewPrivate *>(view);
if (v && (cmd == QLatin1String("nn") || cmd == QLatin1String("nnoremap"))) {
QStringList l = KTextEditor::EditorPrivate::self()->viInputModeGlobal()->getMappings(KateViGlobal::NormalModeMapping);
@@ -921,7 +921,7 @@ bool KateCommands::SedReplace::exec(class KTextEditor::View *view, const QString
return true;
}
- KateView *kateView = static_cast<KateView *>(view);
+ KTextEditor::ViewPrivate *kateView = static_cast<KTextEditor::ViewPrivate *>(view);
KateDocument *doc = kateView->doc();
if (!doc) {
return false;
diff --git a/src/utils/kateconfig.cpp b/src/utils/kateconfig.cpp
index d209948..2f0aa21 100644
--- a/src/utils/kateconfig.cpp
+++ b/src/utils/kateconfig.cpp
@@ -1257,7 +1257,7 @@ KateViewConfig::KateViewConfig()
readConfig(config);
}
-KateViewConfig::KateViewConfig(KateView *view)
+KateViewConfig::KateViewConfig(KTextEditor::ViewPrivate *view)
:
m_searchFlags(PowerModePlainText),
m_maxHistorySize(100),
@@ -2236,7 +2236,7 @@ void KateRendererConfig::reloadSchema()
{
if (isGlobal()) {
setSchemaInternal(m_schema);
- foreach (KateView *view, KTextEditor::EditorPrivate::self()->views()) {
+ foreach (KTextEditor::ViewPrivate *view, KTextEditor::EditorPrivate::self()->views()) {
view->renderer()->config()->reloadSchema();
}
}
diff --git a/src/utils/kateconfig.h b/src/utils/kateconfig.h
index b9610d7..d292b84 100644
--- a/src/utils/kateconfig.h
+++ b/src/utils/kateconfig.h
@@ -33,7 +33,7 @@
#include <QStringListModel>
class KConfigGroup;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateDocument;
class KateRenderer;
@@ -413,7 +413,7 @@ public:
/**
* Construct a DocumentConfig
*/
- explicit KateViewConfig(KateView *view);
+ explicit KateViewConfig(KTextEditor::ViewPrivate *view);
/**
* Cu DocumentConfig
@@ -618,7 +618,7 @@ private:
private:
static KateViewConfig *s_global;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
};
class KTEXTEDITOR_EXPORT KateRendererConfig : public KateConfig
diff --git a/src/utils/kateglobal.cpp b/src/utils/kateglobal.cpp
index 4f25775..9b6ac3b 100644
--- a/src/utils/kateglobal.cpp
+++ b/src/utils/kateglobal.cpp
@@ -496,12 +496,12 @@ void KTextEditor::EditorPrivate::deregisterDocument(KateDocument *doc)
m_documents.removeAll(doc);
}
-void KTextEditor::EditorPrivate::registerView(KateView *view)
+void KTextEditor::EditorPrivate::registerView(KTextEditor::ViewPrivate *view)
{
m_views.append(view);
}
-void KTextEditor::EditorPrivate::deregisterView(KateView *view)
+void KTextEditor::EditorPrivate::deregisterView(KTextEditor::ViewPrivate *view)
{
m_views.removeAll(view);
}
diff --git a/src/utils/kateglobal.h b/src/utils/kateglobal.h
index cb98b8a..a1d54b9 100644
--- a/src/utils/kateglobal.h
+++ b/src/utils/kateglobal.h
@@ -44,7 +44,7 @@ class KateDocumentConfig;
class KateViewConfig;
class KateRendererConfig;
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateScriptManager;
class KDirWatch;
class KateHlManager;
@@ -244,13 +244,13 @@ public:
* this allows us to loop over all views for example on config changes
* @param view view to register
*/
- void registerView(KateView *view);
+ void registerView(KTextEditor::ViewPrivate *view);
/**
* unregister view at the factory
* @param view view to unregister
*/
- void deregisterView(KateView *view);
+ void deregisterView(KTextEditor::ViewPrivate *view);
/**
* return a list of all registered docs
@@ -265,7 +265,7 @@ public:
* return a list of all registered views
* @return all known views
*/
- QList<KateView *> &views()
+ QList<KTextEditor::ViewPrivate *> &views()
{
return m_views;
}
@@ -460,7 +460,7 @@ private:
/**
* registered views
*/
- QList<KateView *> m_views;
+ QList<KTextEditor::ViewPrivate *> m_views;
/**
* global dirwatch object
diff --git a/src/utils/katetemplatehandler.cpp b/src/utils/katetemplatehandler.cpp
index 6d262f3..f7ff055 100644
--- a/src/utils/katetemplatehandler.cpp
+++ b/src/utils/katetemplatehandler.cpp
@@ -58,7 +58,7 @@ static bool customContains(const KTextEditor::Range &range, const Cursor &cursor
/* ####################################### */
-KateTemplateHandler::KateTemplateHandler(KateView *view,
+KateTemplateHandler::KateTemplateHandler(KTextEditor::ViewPrivate *view,
const Cursor &position,
const QString &templateString,
const QMap<QString, QString> &initialValues,
@@ -1022,7 +1022,7 @@ void KateTemplateHandler::syncMirroredRanges(MovingRange *range)
m_isMirroring = false;
}
-KateView *KateTemplateHandler::view()
+KTextEditor::ViewPrivate *KateTemplateHandler::view()
{
return m_view;
}
diff --git a/src/utils/katetemplatehandler.h b/src/utils/katetemplatehandler.h
index 2ee21e5..d06c192 100644
--- a/src/utils/katetemplatehandler.h
+++ b/src/utils/katetemplatehandler.h
@@ -32,7 +32,7 @@
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateUndoManager;
@@ -81,7 +81,7 @@ public:
* NOTE: The handler deletes itself when required, you do not need to
* keep track of it.
*/
- KateTemplateHandler(KateView *view,
+ KateTemplateHandler(KTextEditor::ViewPrivate *view,
const KTextEditor::Cursor &position,
const QString &templateString,
const QMap<QString, QString> &initialValues,
@@ -234,11 +234,11 @@ private Q_SLOTS:
void setEditWithUndo(const bool &enabled);
public:
- KateView *view();
+ KTextEditor::ViewPrivate *view();
private:
/// The document we operate on.
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
/// The undo manager associated with our document
KateUndoManager *const m_undoManager;
/// List of ranges with highlighting, marking the inserted variables in the template.
diff --git a/src/variableeditor/variablelineedit.cpp b/src/variableeditor/variablelineedit.cpp
index 836373a..eb0d4ad 100644
--- a/src/variableeditor/variablelineedit.cpp
+++ b/src/variableeditor/variablelineedit.cpp
@@ -117,14 +117,14 @@ void VariableLineEdit::addKateItems(VariableListView *listview)
VariableItem *item = 0;
// If a current active doc is available
- KateView *activeView = 0;
+ KTextEditor::ViewPrivate *activeView = 0;
KateDocument *activeDoc = 0;
KateDocumentConfig *docConfig = KateDocumentConfig::global();
KateViewConfig *viewConfig = KateViewConfig::global();
KateRendererConfig *rendererConfig = KateRendererConfig::global();
- if ((activeView = qobject_cast<KateView *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView()))) {
+ if ((activeView = qobject_cast<KTextEditor::ViewPrivate *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView()))) {
activeDoc = activeView->doc();
viewConfig = activeView->config();
docConfig = activeDoc->config();
diff --git a/src/view/kateview.cpp b/src/view/kateview.cpp
index 39fcd57..fd9d17d 100644
--- a/src/view/kateview.cpp
+++ b/src/view/kateview.cpp
@@ -92,7 +92,7 @@
//END includes
-void KateView::blockFix(KTextEditor::Range &range)
+void KTextEditor::ViewPrivate::blockFix(KTextEditor::Range &range)
{
if (range.start().column() > range.end().column()) {
int tmp = range.start().column();
@@ -101,8 +101,8 @@ void KateView::blockFix(KTextEditor::Range &range)
}
}
-KateView::KateView(KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow)
- : KTextEditor::View(parent)
+KTextEditor::ViewPrivate::ViewPrivate(KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow)
+ : KTextEditor::View (this, parent)
, m_completionWidget(0)
, m_annotationModel(0)
, m_hasWrap(false)
@@ -257,8 +257,8 @@ KateView::KateView(KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *
}
// user interaction (scrollling) starts notification auto-hide timer
- connect(this, SIGNAL(displayRangeChanged(KateView*)), m_topMessageWidget, SLOT(startAutoHideTimer()));
- connect(this, SIGNAL(displayRangeChanged(KateView*)), m_bottomMessageWidget, SLOT(startAutoHideTimer()));
+ connect(this, SIGNAL(displayRangeChanged(KTextEditor::ViewPrivate*)), m_topMessageWidget, SLOT(startAutoHideTimer()));
+ connect(this, SIGNAL(displayRangeChanged(KTextEditor::ViewPrivate*)), m_bottomMessageWidget, SLOT(startAutoHideTimer()));
// user interaction (cursor navigation) starts notification auto-hide timer
connect(this, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), m_topMessageWidget, SLOT(startAutoHideTimer()));
@@ -272,7 +272,7 @@ KateView::KateView(KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *
connect(m_doc, SIGNAL(aboutToReload(KTextEditor::Document*)), SLOT(clearHighlights()));
}
-KateView::~KateView()
+KTextEditor::ViewPrivate::~ViewPrivate()
{
// invalidate update signal
m_delayedUpdateTriggered = false;
@@ -299,7 +299,7 @@ KateView::~KateView()
KTextEditor::EditorPrivate::self()->deregisterView(this);
}
-void KateView::setupConnections()
+void KTextEditor::ViewPrivate::setupConnections()
{
connect(m_doc, SIGNAL(undoChanged()),
this, SLOT(slotUpdateUndo()));
@@ -314,7 +314,7 @@ void KateView::setupConnections()
m_viewInternal->m_leftBorder, SLOT(annotationModelChanged(KTextEditor::AnnotationModel*,KTextEditor::AnnotationModel*)));
}
-void KateView::setupActions()
+void KTextEditor::ViewPrivate::setupActions()
{
KActionCollection *ac = actionCollection();
QAction *a;
@@ -687,7 +687,7 @@ void KateView::setupActions()
connect(this, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(slotSelectionChanged()));
}
-void KateView::slotConfigDialog()
+void KTextEditor::ViewPrivate::slotConfigDialog()
{
KTextEditor::EditorPrivate::self()->configDialog(this);
@@ -696,7 +696,7 @@ void KateView::slotConfigDialog()
KTextEditor::EditorPrivate::self()->writeConfig(KSharedConfig::openConfig().data());
}
-void KateView::setupEditActions()
+void KTextEditor::ViewPrivate::setupEditActions()
{
//If you add an editing action to this
//function make sure to include the line
@@ -974,7 +974,7 @@ void KateView::setupEditActions()
}
}
-void KateView::setupCodeFolding()
+void KTextEditor::ViewPrivate::setupCodeFolding()
{
//FIXME: FOLDING
KActionCollection *ac = this->actionCollection();
@@ -1008,7 +1008,7 @@ void KateView::setupCodeFolding()
connect(a, SIGNAL(triggered(bool)), SLOT(slotExpandLocal()));
}
-void KateView::slotFoldToplevelNodes()
+void KTextEditor::ViewPrivate::slotFoldToplevelNodes()
{
// FIXME: more performant implementation
for (int line = 0; line < doc()->lines(); ++line) {
@@ -1018,17 +1018,17 @@ void KateView::slotFoldToplevelNodes()
}
}
-void KateView::slotCollapseLocal()
+void KTextEditor::ViewPrivate::slotCollapseLocal()
{
foldLine(cursorPosition().line());
}
-void KateView::slotExpandLocal()
+void KTextEditor::ViewPrivate::slotExpandLocal()
{
unfoldLine(cursorPosition().line());
}
-void KateView::slotCollapseLevel()
+void KTextEditor::ViewPrivate::slotCollapseLevel()
{
//FIXME: FOLDING
#if 0
@@ -1046,7 +1046,7 @@ void KateView::slotCollapseLevel()
#endif
}
-void KateView::slotExpandLevel()
+void KTextEditor::ViewPrivate::slotExpandLevel()
{
//FIXME: FOLDING
#if 0
@@ -1064,7 +1064,7 @@ void KateView::slotExpandLevel()
#endif
}
-void KateView::foldLine(int startLine)
+void KTextEditor::ViewPrivate::foldLine(int startLine)
{
// only for valid lines
if (startLine < 0) {
@@ -1081,7 +1081,7 @@ void KateView::foldLine(int startLine)
textFolding().newFoldingRange(doc()->buffer().computeFoldingRangeForStartLine(startLine), Kate::TextFolding::Folded);
}
-void KateView::unfoldLine(int startLine)
+void KTextEditor::ViewPrivate::unfoldLine(int startLine)
{
// only for valid lines
if (startLine < 0) {
@@ -1095,7 +1095,7 @@ void KateView::unfoldLine(int startLine)
}
}
-KTextEditor::View::EditMode KateView::viewEditMode() const
+KTextEditor::View::EditMode KTextEditor::ViewPrivate::viewEditMode() const
{
if (viInputMode()) {
return EditViMode;
@@ -1104,7 +1104,7 @@ KTextEditor::View::EditMode KateView::viewEditMode() const
return isOverwriteMode() ? EditOverwrite : EditInsert;
}
-QString KateView::viewMode() const
+QString KTextEditor::ViewPrivate::viewMode() const
{
/**
* normal two modes
@@ -1148,9 +1148,9 @@ QString KateView::viewMode() const
return currentMode;
}
-void KateView::slotGotFocus()
+void KTextEditor::ViewPrivate::slotGotFocus()
{
- //qCDebug(LOG_PART) << "KateView::slotGotFocus";
+ //qCDebug(LOG_PART) << "KTextEditor::ViewPrivate::slotGotFocus";
if (!viInputMode()) {
activateEditActions();
@@ -1158,9 +1158,9 @@ void KateView::slotGotFocus()
emit focusIn(this);
}
-void KateView::slotLostFocus()
+void KTextEditor::ViewPrivate::slotLostFocus()
{
- //qCDebug(LOG_PART) << "KateView::slotLostFocus";
+ //qCDebug(LOG_PART) << "KTextEditor::ViewPrivate::slotLostFocus";
if (!viInputMode()) {
deactivateEditActions();
@@ -1169,23 +1169,23 @@ void KateView::slotLostFocus()
emit focusOut(this);
}
-void KateView::setDynWrapIndicators(int mode)
+void KTextEditor::ViewPrivate::setDynWrapIndicators(int mode)
{
config()->setDynWordWrapIndicators(mode);
}
-bool KateView::isOverwriteMode() const
+bool KTextEditor::ViewPrivate::isOverwriteMode() const
{
return m_doc->config()->ovr();
}
-void KateView::reloadFile()
+void KTextEditor::ViewPrivate::reloadFile()
{
// bookmarks and cursor positions are temporarily saved by the document
m_doc->documentReload();
}
-void KateView::slotReadWriteChanged()
+void KTextEditor::ViewPrivate::slotReadWriteChanged()
{
if (m_toggleWriteLock) {
m_toggleWriteLock->setChecked(! m_doc->isReadWrite());
@@ -1232,12 +1232,12 @@ void KateView::slotReadWriteChanged()
emit viewEditModeChanged(this, viewEditMode());
}
-void KateView::slotClipboardHistoryChanged()
+void KTextEditor::ViewPrivate::slotClipboardHistoryChanged()
{
m_pasteMenu->setEnabled(m_doc->isReadWrite() && !KTextEditor::EditorPrivate::self()->clipboardHistory().isEmpty());
}
-void KateView::slotUpdateUndo()
+void KTextEditor::ViewPrivate::slotUpdateUndo()
{
if (m_doc->readOnly()) {
return;
@@ -1247,7 +1247,7 @@ void KateView::slotUpdateUndo()
m_editRedo->setEnabled(m_doc->isReadWrite() && m_doc->redoCount() > 0);
}
-bool KateView::setCursorPositionInternal(const KTextEditor::Cursor &position, uint tabwidth, bool calledExternally)
+bool KTextEditor::ViewPrivate::setCursorPositionInternal(const KTextEditor::Cursor &position, uint tabwidth, bool calledExternally)
{
Kate::TextLine l = m_doc->kateTextLine(position.line());
@@ -1277,7 +1277,7 @@ bool KateView::setCursorPositionInternal(const KTextEditor::Cursor &position, ui
return true;
}
-void KateView::toggleInsert()
+void KTextEditor::ViewPrivate::toggleInsert()
{
m_doc->config()->setOvr(!m_doc->config()->ovr());
m_toggleInsert->setChecked(isOverwriteMode());
@@ -1286,26 +1286,26 @@ void KateView::toggleInsert()
emit viewEditModeChanged(this, viewEditMode());
}
-void KateView::slotSaveCanceled(const QString &error)
+void KTextEditor::ViewPrivate::slotSaveCanceled(const QString &error)
{
if (!error.isEmpty()) { // happens when canceling a job
KMessageBox::error(this, error);
}
}
-void KateView::gotoLine()
+void KTextEditor::ViewPrivate::gotoLine()
{
gotoBar()->updateData();
bottomViewBar()->showBarWidget(gotoBar());
}
-void KateView::changeDictionary()
+void KTextEditor::ViewPrivate::changeDictionary()
{
dictionaryBar()->updateData();
bottomViewBar()->showBarWidget(dictionaryBar());
}
-void KateView::joinLines()
+void KTextEditor::ViewPrivate::joinLines()
{
int first = selectionRange().start().line();
int last = selectionRange().end().line();
@@ -1317,7 +1317,7 @@ void KateView::joinLines()
m_doc->joinLines(first, last);
}
-void KateView::readSessionConfig(const KConfigGroup &config)
+void KTextEditor::ViewPrivate::readSessionConfig(const KConfigGroup &config)
{
// cursor position
setCursorPositionInternal(KTextEditor::Cursor(config.readEntry("CursorLine", 0), config.readEntry("CursorColumn", 0)));
@@ -1330,7 +1330,7 @@ void KateView::readSessionConfig(const KConfigGroup &config)
getViInputModeManager()->readSessionConfig(config);
}
-void KateView::writeSessionConfig(KConfigGroup &config)
+void KTextEditor::ViewPrivate::writeSessionConfig(KConfigGroup &config)
{
// cursor position
config.writeEntry("CursorLine", m_viewInternal->m_cursor.line());
@@ -1345,12 +1345,12 @@ void KateView::writeSessionConfig(KConfigGroup &config)
getViInputModeManager()->writeSessionConfig(config);
}
-int KateView::getEol() const
+int KTextEditor::ViewPrivate::getEol() const
{
return m_doc->config()->eol();
}
-void KateView::setEol(int eol)
+void KTextEditor::ViewPrivate::setEol(int eol)
{
if (!doc()->isReadWrite()) {
return;
@@ -1366,7 +1366,7 @@ void KateView::setEol(int eol)
}
}
-void KateView::setAddBom(bool enabled)
+void KTextEditor::ViewPrivate::setAddBom(bool enabled)
{
if (!doc()->isReadWrite()) {
return;
@@ -1380,143 +1380,143 @@ void KateView::setAddBom(bool enabled)
m_doc->bomSetByUser();
}
-void KateView::setIconBorder(bool enable)
+void KTextEditor::ViewPrivate::setIconBorder(bool enable)
{
config()->setIconBar(enable);
}
-void KateView::toggleIconBorder()
+void KTextEditor::ViewPrivate::toggleIconBorder()
{
config()->setIconBar(!config()->iconBar());
}
-void KateView::setLineNumbersOn(bool enable)
+void KTextEditor::ViewPrivate::setLineNumbersOn(bool enable)
{
config()->setLineNumbers(enable);
}
-void KateView::toggleLineNumbersOn()
+void KTextEditor::ViewPrivate::toggleLineNumbersOn()
{
config()->setLineNumbers(!config()->lineNumbers());
}
-void KateView::setScrollBarMarks(bool enable)
+void KTextEditor::ViewPrivate::setScrollBarMarks(bool enable)
{
config()->setScrollBarMarks(enable);
}
-void KateView::toggleScrollBarMarks()
+void KTextEditor::ViewPrivate::toggleScrollBarMarks()
{
config()->setScrollBarMarks(!config()->scrollBarMarks());
}
-void KateView::setScrollBarMiniMap(bool enable)
+void KTextEditor::ViewPrivate::setScrollBarMiniMap(bool enable)
{
config()->setScrollBarMiniMap(enable);
}
-void KateView::toggleScrollBarMiniMap()
+void KTextEditor::ViewPrivate::toggleScrollBarMiniMap()
{
config()->setScrollBarMiniMap(!config()->scrollBarMiniMap());
}
-void KateView::setScrollBarMiniMapAll(bool enable)
+void KTextEditor::ViewPrivate::setScrollBarMiniMapAll(bool enable)
{
config()->setScrollBarMiniMapAll(enable);
}
-void KateView::toggleScrollBarMiniMapAll()
+void KTextEditor::ViewPrivate::toggleScrollBarMiniMapAll()
{
config()->setScrollBarMiniMapAll(!config()->scrollBarMiniMapAll());
}
-void KateView::setScrollBarMiniMapWidth(int width)
+void KTextEditor::ViewPrivate::setScrollBarMiniMapWidth(int width)
{
config()->setScrollBarMiniMapWidth(width);
}
-void KateView::toggleDynWordWrap()
+void KTextEditor::ViewPrivate::toggleDynWordWrap()
{
config()->setDynWordWrap(!config()->dynWordWrap());
}
-void KateView::toggleWWMarker()
+void KTextEditor::ViewPrivate::toggleWWMarker()
{
m_renderer->config()->setWordWrapMarker(!m_renderer->config()->wordWrapMarker());
}
-void KateView::toggleNPSpaces()
+void KTextEditor::ViewPrivate::toggleNPSpaces()
{
m_renderer->setShowNonPrintableSpaces(!m_renderer->showNonPrintableSpaces());
m_viewInternal->update(); // force redraw
}
-void KateView::setFoldingMarkersOn(bool enable)
+void KTextEditor::ViewPrivate::setFoldingMarkersOn(bool enable)
{
config()->setFoldingBar(enable);
}
-void KateView::toggleFoldingMarkers()
+void KTextEditor::ViewPrivate::toggleFoldingMarkers()
{
config()->setFoldingBar(!config()->foldingBar());
}
-bool KateView::iconBorder()
+bool KTextEditor::ViewPrivate::iconBorder()
{
return m_viewInternal->m_leftBorder->iconBorderOn();
}
-bool KateView::lineNumbersOn()
+bool KTextEditor::ViewPrivate::lineNumbersOn()
{
return m_viewInternal->m_leftBorder->lineNumbersOn();
}
-bool KateView::scrollBarMarks()
+bool KTextEditor::ViewPrivate::scrollBarMarks()
{
return m_viewInternal->m_lineScroll->showMarks();
}
-bool KateView::scrollBarMiniMap()
+bool KTextEditor::ViewPrivate::scrollBarMiniMap()
{
return m_viewInternal->m_lineScroll->showMiniMap();
}
-int KateView::dynWrapIndicators()
+int KTextEditor::ViewPrivate::dynWrapIndicators()
{
return m_viewInternal->m_leftBorder->dynWrapIndicators();
}
-bool KateView::foldingMarkersOn()
+bool KTextEditor::ViewPrivate::foldingMarkersOn()
{
return m_viewInternal->m_leftBorder->foldingMarkersOn();
}
-void KateView::toggleWriteLock()
+void KTextEditor::ViewPrivate::toggleWriteLock()
{
m_doc->setReadWrite(! m_doc->isReadWrite());
}
-void KateView::enableTextHints(int timeout)
+void KTextEditor::ViewPrivate::enableTextHints(int timeout)
{
m_viewInternal->enableTextHints(timeout);
}
-void KateView::disableTextHints()
+void KTextEditor::ViewPrivate::disableTextHints()
{
m_viewInternal->disableTextHints();
}
-bool KateView::viInputMode() const
+bool KTextEditor::ViewPrivate::viInputMode() const
{
return m_viewInternal->m_viInputMode;
}
-bool KateView::viInputModeStealKeys() const
+bool KTextEditor::ViewPrivate::viInputModeStealKeys() const
{
return m_viewInternal->m_viInputModeStealKeys;
}
-void KateView::toggleViInputMode()
+void KTextEditor::ViewPrivate::toggleViInputMode()
{
config()->setViInputMode(!config()->viInputMode());
@@ -1531,42 +1531,42 @@ void KateView::toggleViInputMode()
emit viewEditModeChanged(this, viewEditMode());
}
-void KateView::showViModeEmulatedCommandBar()
+void KTextEditor::ViewPrivate::showViModeEmulatedCommandBar()
{
bottomViewBar()->addBarWidget(viModeEmulatedCommandBar());
bottomViewBar()->showBarWidget(viModeEmulatedCommandBar());
}
-void KateView::updateViModeBarMode()
+void KTextEditor::ViewPrivate::updateViModeBarMode()
{
// view mode changed => status bar in container apps might change!
emit viewModeChanged(this);
emit viewEditModeChanged(this, viewEditMode());
}
-void KateView::updateViModeBarCmd()
+void KTextEditor::ViewPrivate::updateViModeBarCmd()
{
// view mode changed => status bar in container apps might change!
emit viewModeChanged(this);
emit viewEditModeChanged(this, viewEditMode());
}
-ViMode KateView::getCurrentViMode() const
+ViMode KTextEditor::ViewPrivate::getCurrentViMode() const
{
return m_viewInternal->getCurrentViMode();
}
-KateViInputModeManager *KateView::getViInputModeManager()
+KateViInputModeManager *KTextEditor::ViewPrivate::getViInputModeManager()
{
return m_viewInternal->getViInputModeManager();
}
-KateViInputModeManager *KateView::resetViInputModeManager()
+KateViInputModeManager *KTextEditor::ViewPrivate::resetViInputModeManager()
{
return m_viewInternal->resetViInputModeManager();
}
-void KateView::find()
+void KTextEditor::ViewPrivate::find()
{
if (viInputMode()) {
showViModeEmulatedCommandBar();
@@ -1581,7 +1581,7 @@ void KateView::find()
}
}
-void KateView::findSelectedForwards()
+void KTextEditor::ViewPrivate::findSelectedForwards()
{
if (viInputMode()) {
getViInputModeManager()->findNext();
@@ -1590,7 +1590,7 @@ void KateView::findSelectedForwards()
}
}
-void KateView::findSelectedBackwards()
+void KTextEditor::ViewPrivate::findSelectedBackwards()
{
if (viInputMode()) {
getViInputModeManager()->findPrevious();
@@ -1599,7 +1599,7 @@ void KateView::findSelectedBackwards()
}
}
-void KateView::replace()
+void KTextEditor::ViewPrivate::replace()
{
if (viInputMode()) {
showViModeEmulatedCommandBar();
@@ -1614,7 +1614,7 @@ void KateView::replace()
}
}
-void KateView::findNext()
+void KTextEditor::ViewPrivate::findNext()
{
if (viInputMode()) {
getViInputModeManager()->findNext();
@@ -1623,7 +1623,7 @@ void KateView::findNext()
}
}
-void KateView::findPrevious()
+void KTextEditor::ViewPrivate::findPrevious()
{
if (viInputMode()) {
getViInputModeManager()->findPrevious();
@@ -1632,7 +1632,7 @@ void KateView::findPrevious()
}
}
-void KateView::slotSelectionChanged()
+void KTextEditor::ViewPrivate::slotSelectionChanged()
{
m_copy->setEnabled(selection() || m_config->smartCopyCut());
m_deSelect->setEnabled(selection());
@@ -1650,7 +1650,7 @@ void KateView::slotSelectionChanged()
selectionChangedForHighlights ();
}
-void KateView::switchToCmdLine()
+void KTextEditor::ViewPrivate::switchToCmdLine()
{
if (viInputMode()) {
showViModeEmulatedCommandBar();
@@ -1667,7 +1667,7 @@ void KateView::switchToCmdLine()
}
}
-void KateView::switchToConsole()
+void KTextEditor::ViewPrivate::switchToConsole()
{
if (!m_console) {
m_console = new KateScriptConsole(this, bottomViewBar());
@@ -1677,12 +1677,12 @@ void KateView::switchToConsole()
m_console->setFocus();
}
-KateRenderer *KateView::renderer()
+KateRenderer *KTextEditor::ViewPrivate::renderer()
{
return m_renderer;
}
-void KateView::updateConfig()
+void KTextEditor::ViewPrivate::updateConfig()
{
if (m_startingUp) {
return;
@@ -1765,7 +1765,7 @@ void KateView::updateConfig()
emit configChanged();
}
-void KateView::updateDocumentConfig()
+void KTextEditor::ViewPrivate::updateDocumentConfig()
{
if (m_startingUp) {
return;
@@ -1792,7 +1792,7 @@ void KateView::updateDocumentConfig()
updateView(true);
}
-void KateView::updateRendererConfig()
+void KTextEditor::ViewPrivate::updateRendererConfig()
{
if (m_startingUp) {
return;
@@ -1823,7 +1823,7 @@ void KateView::updateRendererConfig()
emit configChanged();
}
-void KateView::updateFoldingConfig()
+void KTextEditor::ViewPrivate::updateFoldingConfig()
{
// folding bar
m_viewInternal->m_leftBorder->setFoldingMarkersOn(config()->foldingBar());
@@ -1844,7 +1844,7 @@ void KateView::updateFoldingConfig()
#endif
}
-void KateView::ensureCursorColumnValid()
+void KTextEditor::ViewPrivate::ensureCursorColumnValid()
{
KTextEditor::Cursor c = m_viewInternal->getCursor();
@@ -1859,54 +1859,54 @@ void KateView::ensureCursorColumnValid()
}
//BEGIN EDIT STUFF
-void KateView::editStart()
+void KTextEditor::ViewPrivate::editStart()
{
m_viewInternal->editStart();
}
-void KateView::editEnd(int editTagLineStart, int editTagLineEnd, bool tagFrom)
+void KTextEditor::ViewPrivate::editEnd(int editTagLineStart, int editTagLineEnd, bool tagFrom)
{
m_viewInternal->editEnd(editTagLineStart, editTagLineEnd, tagFrom);
}
-void KateView::editSetCursor(const KTextEditor::Cursor &cursor)
+void KTextEditor::ViewPrivate::editSetCursor(const KTextEditor::Cursor &cursor)
{
m_viewInternal->editSetCursor(cursor);
}
//END
//BEGIN TAG & CLEAR
-bool KateView::tagLine(const KTextEditor::Cursor &virtualCursor)
+bool KTextEditor::ViewPrivate::tagLine(const KTextEditor::Cursor &virtualCursor)
{
return m_viewInternal->tagLine(virtualCursor);
}
-bool KateView::tagRange(const KTextEditor::Range &range, bool realLines)
+bool KTextEditor::ViewPrivate::tagRange(const KTextEditor::Range &range, bool realLines)
{
return m_viewInternal->tagRange(range, realLines);
}
-bool KateView::tagLines(int start, int end, bool realLines)
+bool KTextEditor::ViewPrivate::tagLines(int start, int end, bool realLines)
{
return m_viewInternal->tagLines(start, end, realLines);
}
-bool KateView::tagLines(KTextEditor::Cursor start, KTextEditor::Cursor end, bool realCursors)
+bool KTextEditor::ViewPrivate::tagLines(KTextEditor::Cursor start, KTextEditor::Cursor end, bool realCursors)
{
return m_viewInternal->tagLines(start, end, realCursors);
}
-void KateView::tagAll()
+void KTextEditor::ViewPrivate::tagAll()
{
m_viewInternal->tagAll();
}
-void KateView::clear()
+void KTextEditor::ViewPrivate::clear()
{
m_viewInternal->clear();
}
-void KateView::repaintText(bool paintOnlyDirty)
+void KTextEditor::ViewPrivate::repaintText(bool paintOnlyDirty)
{
if (paintOnlyDirty) {
m_viewInternal->updateDirty();
@@ -1915,9 +1915,9 @@ void KateView::repaintText(bool paintOnlyDirty)
}
}
-void KateView::updateView(bool changed)
+void KTextEditor::ViewPrivate::updateView(bool changed)
{
- //qCDebug(LOG_PART) << "KateView::updateView";
+ //qCDebug(LOG_PART) << "KTextEditor::ViewPrivate::updateView";
m_viewInternal->updateView(changed);
m_viewInternal->m_leftBorder->update();
@@ -1925,7 +1925,7 @@ void KateView::updateView(bool changed)
//END
-void KateView::slotHlChanged()
+void KTextEditor::ViewPrivate::slotHlChanged()
{
KateHighlighting *hl = m_doc->highlight();
bool ok(!hl->getCommentStart(0).isEmpty() || !hl->getCommentSingleLineStart(0).isEmpty());
@@ -1946,19 +1946,19 @@ void KateView::slotHlChanged()
updateFoldingConfig();
}
-int KateView::virtualCursorColumn() const
+int KTextEditor::ViewPrivate::virtualCursorColumn() const
{
return m_doc->toVirtualColumn(m_viewInternal->getCursor());
}
-void KateView::notifyMousePositionChanged(const KTextEditor::Cursor &newPosition)
+void KTextEditor::ViewPrivate::notifyMousePositionChanged(const KTextEditor::Cursor &newPosition)
{
emit mousePositionChanged(this, newPosition);
}
//BEGIN KTextEditor::SelectionInterface stuff
-bool KateView::setSelection(const KTextEditor::Range &selection)
+bool KTextEditor::ViewPrivate::setSelection(const KTextEditor::Range &selection)
{
/**
* anything to do?
@@ -1994,12 +1994,12 @@ bool KateView::setSelection(const KTextEditor::Range &selection)
return true;
}
-bool KateView::clearSelection()
+bool KTextEditor::ViewPrivate::clearSelection()
{
return clearSelection(true);
}
-bool KateView::clearSelection(bool redraw, bool finishedChangingSelection)
+bool KTextEditor::ViewPrivate::clearSelection(bool redraw, bool finishedChangingSelection)
{
/**
* no selection, nothing to do...
@@ -2039,7 +2039,7 @@ bool KateView::clearSelection(bool redraw, bool finishedChangingSelection)
return true;
}
-bool KateView::selection() const
+bool KTextEditor::ViewPrivate::selection() const
{
if (!wrapCursor()) {
return m_selection != KTextEditor::Range::invalid();
@@ -2048,12 +2048,12 @@ bool KateView::selection() const
}
}
-QString KateView::selectionText() const
+QString KTextEditor::ViewPrivate::selectionText() const
{
return m_doc->text(m_selection, blockSelect);
}
-bool KateView::removeSelectedText()
+bool KTextEditor::ViewPrivate::removeSelectedText()
{
if (!selection()) {
return false;
@@ -2083,7 +2083,7 @@ bool KateView::removeSelectedText()
return true;
}
-bool KateView::selectAll()
+bool KTextEditor::ViewPrivate::selectAll()
{
setBlockSelection(false);
top();
@@ -2091,7 +2091,7 @@ bool KateView::selectAll()
return true;
}
-bool KateView::cursorSelected(const KTextEditor::Cursor &cursor)
+bool KTextEditor::ViewPrivate::cursorSelected(const KTextEditor::Cursor &cursor)
{
KTextEditor::Cursor ret = cursor;
if ((!blockSelect) && (ret.column() < 0)) {
@@ -2106,29 +2106,29 @@ bool KateView::cursorSelected(const KTextEditor::Cursor &cursor)
}
}
-bool KateView::lineSelected(int line)
+bool KTextEditor::ViewPrivate::lineSelected(int line)
{
return !blockSelect && m_selection.toRange().containsLine(line);
}
-bool KateView::lineEndSelected(const KTextEditor::Cursor &lineEndPos)
+bool KTextEditor::ViewPrivate::lineEndSelected(const KTextEditor::Cursor &lineEndPos)
{
return (!blockSelect)
&& (lineEndPos.line() > m_selection.start().line() || (lineEndPos.line() == m_selection.start().line() && (m_selection.start().column() < lineEndPos.column() || lineEndPos.column() == -1)))
&& (lineEndPos.line() < m_selection.end().line() || (lineEndPos.line() == m_selection.end().line() && (lineEndPos.column() <= m_selection.end().column() && lineEndPos.column() != -1)));
}
-bool KateView::lineHasSelected(int line)
+bool KTextEditor::ViewPrivate::lineHasSelected(int line)
{
return selection() && m_selection.toRange().containsLine(line);
}
-bool KateView::lineIsSelection(int line)
+bool KTextEditor::ViewPrivate::lineIsSelection(int line)
{
return (line == m_selection.start().line() && line == m_selection.end().line());
}
-void KateView::tagSelection(const KTextEditor::Range &oldSelection)
+void KTextEditor::ViewPrivate::tagSelection(const KTextEditor::Range &oldSelection)
{
if (selection()) {
if (oldSelection.start().line() == -1) {
@@ -2166,12 +2166,12 @@ void KateView::tagSelection(const KTextEditor::Range &oldSelection)
}
}
-void KateView::selectWord(const KTextEditor::Cursor &cursor)
+void KTextEditor::ViewPrivate::selectWord(const KTextEditor::Cursor &cursor)
{
setSelection(m_doc->wordRangeAt(cursor));
}
-void KateView::selectLine(const KTextEditor::Cursor &cursor)
+void KTextEditor::ViewPrivate::selectLine(const KTextEditor::Cursor &cursor)
{
int line = cursor.line();
if (line + 1 >= m_doc->lines()) {
@@ -2181,7 +2181,7 @@ void KateView::selectLine(const KTextEditor::Cursor &cursor)
}
}
-void KateView::cut()
+void KTextEditor::ViewPrivate::cut()
{
if (!selection() && !m_config->smartCopyCut()) {
return;
@@ -2194,7 +2194,7 @@ void KateView::cut()
removeSelectedText();
}
-void KateView::copy() const
+void KTextEditor::ViewPrivate::copy() const
{
QString text = selectionText();
@@ -2210,7 +2210,7 @@ void KateView::copy() const
KTextEditor::EditorPrivate::self()->copyToClipboard(text);
}
-void KateView::applyWordWrap()
+void KTextEditor::ViewPrivate::applyWordWrap()
{
if (selection()) {
m_doc->wrapText(selectionRange().start().line(), selectionRange().end().line());
@@ -2223,12 +2223,12 @@ void KateView::applyWordWrap()
//BEGIN KTextEditor::BlockSelectionInterface stuff
-bool KateView::blockSelection() const
+bool KTextEditor::ViewPrivate::blockSelection() const
{
return blockSelect;
}
-bool KateView::setBlockSelection(bool on)
+bool KTextEditor::ViewPrivate::setBlockSelection(bool on)
{
if (on != blockSelect) {
blockSelect = on;
@@ -2257,32 +2257,32 @@ bool KateView::setBlockSelection(bool on)
return true;
}
-bool KateView::toggleBlockSelection()
+bool KTextEditor::ViewPrivate::toggleBlockSelection()
{
m_toggleBlockSelection->setChecked(!blockSelect);
return setBlockSelection(!blockSelect);
}
-bool KateView::wrapCursor() const
+bool KTextEditor::ViewPrivate::wrapCursor() const
{
return !blockSelection();
}
//END
-void KateView::slotTextInserted(KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text)
+void KTextEditor::ViewPrivate::slotTextInserted(KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text)
{
emit textInserted(view, position, text);
}
-bool KateView::insertTemplateTextImplementation(const KTextEditor::Cursor &c,
+bool KTextEditor::ViewPrivate::insertTemplateTextImplementation(const KTextEditor::Cursor &c,
const QString &templateString,
const QMap<QString, QString> &initialValues)
{
return insertTemplateTextImplementation(c, templateString, initialValues, 0);
}
-bool KateView::insertTemplateTextImplementation(const KTextEditor::Cursor &c,
+bool KTextEditor::ViewPrivate::insertTemplateTextImplementation(const KTextEditor::Cursor &c,
const QString &templateString,
const QMap<QString, QString> &initialValues,
KTextEditor::TemplateScript *templateScript)
@@ -2313,97 +2313,97 @@ bool KateView::insertTemplateTextImplementation(const KTextEditor::Cursor &c,
return true;
}
-bool KateView::tagLines(KTextEditor::Range range, bool realRange)
+bool KTextEditor::ViewPrivate::tagLines(KTextEditor::Range range, bool realRange)
{
return tagLines(range.start(), range.end(), realRange);
}
-void KateView::deactivateEditActions()
+void KTextEditor::ViewPrivate::deactivateEditActions()
{
foreach (QAction *action, m_editActions) {
action->setEnabled(false);
}
}
-void KateView::activateEditActions()
+void KTextEditor::ViewPrivate::activateEditActions()
{
foreach (QAction *action, m_editActions) {
action->setEnabled(true);
}
}
-bool KateView::mouseTrackingEnabled() const
+bool KTextEditor::ViewPrivate::mouseTrackingEnabled() const
{
// FIXME support
return true;
}
-bool KateView::setMouseTrackingEnabled(bool)
+bool KTextEditor::ViewPrivate::setMouseTrackingEnabled(bool)
{
// FIXME support
return true;
}
-bool KateView::isCompletionActive() const
+bool KTextEditor::ViewPrivate::isCompletionActive() const
{
return completionWidget()->isCompletionActive();
}
-KateCompletionWidget *KateView::completionWidget() const
+KateCompletionWidget *KTextEditor::ViewPrivate::completionWidget() const
{
if (!m_completionWidget) {
- m_completionWidget = new KateCompletionWidget(const_cast<KateView *>(this));
+ m_completionWidget = new KateCompletionWidget(const_cast<KTextEditor::ViewPrivate *>(this));
}
return m_completionWidget;
}
-void KateView::startCompletion(const KTextEditor::Range &word, KTextEditor::CodeCompletionModel *model)
+void KTextEditor::ViewPrivate::startCompletion(const KTextEditor::Range &word, KTextEditor::CodeCompletionModel *model)
{
completionWidget()->startCompletion(word, model);
}
-void KateView::abortCompletion()
+void KTextEditor::ViewPrivate::abortCompletion()
{
completionWidget()->abortCompletion();
}
-void KateView::forceCompletion()
+void KTextEditor::ViewPrivate::forceCompletion()
{
completionWidget()->execute();
}
-void KateView::registerCompletionModel(KTextEditor::CodeCompletionModel *model)
+void KTextEditor::ViewPrivate::registerCompletionModel(KTextEditor::CodeCompletionModel *model)
{
completionWidget()->registerCompletionModel(model);
}
-void KateView::unregisterCompletionModel(KTextEditor::CodeCompletionModel *model)
+void KTextEditor::ViewPrivate::unregisterCompletionModel(KTextEditor::CodeCompletionModel *model)
{
completionWidget()->unregisterCompletionModel(model);
}
-bool KateView::isAutomaticInvocationEnabled() const
+bool KTextEditor::ViewPrivate::isAutomaticInvocationEnabled() const
{
return m_config->automaticCompletionInvocation();
}
-void KateView::setAutomaticInvocationEnabled(bool enabled)
+void KTextEditor::ViewPrivate::setAutomaticInvocationEnabled(bool enabled)
{
config()->setAutomaticCompletionInvocation(enabled);
}
-void KateView::sendCompletionExecuted(const KTextEditor::Cursor &position, KTextEditor::CodeCompletionModel *model, const QModelIndex &index)
+void KTextEditor::ViewPrivate::sendCompletionExecuted(const KTextEditor::Cursor &position, KTextEditor::CodeCompletionModel *model, const QModelIndex &index)
{
emit completionExecuted(this, position, model, index);
}
-void KateView::sendCompletionAborted()
+void KTextEditor::ViewPrivate::sendCompletionAborted()
{
emit completionAborted(this);
}
-void KateView::paste(const QString *textToPaste)
+void KTextEditor::ViewPrivate::paste(const QString *textToPaste)
{
const bool completionEnabled = isAutomaticInvocationEnabled();
if (completionEnabled) {
@@ -2417,52 +2417,52 @@ void KateView::paste(const QString *textToPaste)
}
}
-void KateView::setCaretStyle(KateRenderer::caretStyles style, bool repaint)
+void KTextEditor::ViewPrivate::setCaretStyle(KateRenderer::caretStyles style, bool repaint)
{
m_viewInternal->setCaretStyle(style, repaint);
}
-bool KateView::setCursorPosition(KTextEditor::Cursor position)
+bool KTextEditor::ViewPrivate::setCursorPosition(KTextEditor::Cursor position)
{
return setCursorPositionInternal(position, 1, true);
}
-KTextEditor::Cursor KateView::cursorPosition() const
+KTextEditor::Cursor KTextEditor::ViewPrivate::cursorPosition() const
{
return m_viewInternal->getCursor();
}
-KTextEditor::Cursor KateView::cursorPositionVirtual() const
+KTextEditor::Cursor KTextEditor::ViewPrivate::cursorPositionVirtual() const
{
return KTextEditor::Cursor(m_viewInternal->getCursor().line(), virtualCursorColumn());
}
-QPoint KateView::cursorToCoordinate(const KTextEditor::Cursor &cursor) const
+QPoint KTextEditor::ViewPrivate::cursorToCoordinate(const KTextEditor::Cursor &cursor) const
{
return m_viewInternal->cursorToCoordinate(cursor);
}
-KTextEditor::Cursor KateView::coordinatesToCursor(const QPoint &coords) const
+KTextEditor::Cursor KTextEditor::ViewPrivate::coordinatesToCursor(const QPoint &coords) const
{
return m_viewInternal->coordinatesToCursor(coords);
}
-QPoint KateView::cursorPositionCoordinates() const
+QPoint KTextEditor::ViewPrivate::cursorPositionCoordinates() const
{
return m_viewInternal->cursorCoordinates();
}
-bool KateView::setCursorPositionVisual(const KTextEditor::Cursor &position)
+bool KTextEditor::ViewPrivate::setCursorPositionVisual(const KTextEditor::Cursor &position)
{
return setCursorPositionInternal(position, m_doc->config()->tabWidth(), true);
}
-QString KateView::currentTextLine()
+QString KTextEditor::ViewPrivate::currentTextLine()
{
return m_doc->line(cursorPosition().line());
}
-QString KateView::searchPattern() const
+QString KTextEditor::ViewPrivate::searchPattern() const
{
if (hasSearchBar()) {
return m_searchBar->searchPattern();
@@ -2471,7 +2471,7 @@ QString KateView::searchPattern() const
}
}
-QString KateView::replacementPattern() const
+QString KTextEditor::ViewPrivate::replacementPattern() const
{
if (hasSearchBar()) {
return m_searchBar->replacementPattern();
@@ -2480,38 +2480,38 @@ QString KateView::replacementPattern() const
}
}
-void KateView::setSearchPattern(const QString &searchPattern)
+void KTextEditor::ViewPrivate::setSearchPattern(const QString &searchPattern)
{
searchBar()->setSearchPattern(searchPattern);
}
-void KateView::setReplacementPattern(const QString &replacementPattern)
+void KTextEditor::ViewPrivate::setReplacementPattern(const QString &replacementPattern)
{
searchBar()->setReplacementPattern(replacementPattern);
}
-void KateView::indent()
+void KTextEditor::ViewPrivate::indent()
{
KTextEditor::Cursor c(cursorPosition().line(), 0);
KTextEditor::Range r = selection() ? selectionRange() : KTextEditor::Range(c, c);
m_doc->indent(r, 1);
}
-void KateView::unIndent()
+void KTextEditor::ViewPrivate::unIndent()
{
KTextEditor::Cursor c(cursorPosition().line(), 0);
KTextEditor::Range r = selection() ? selectionRange() : KTextEditor::Range(c, c);
m_doc->indent(r, -1);
}
-void KateView::cleanIndent()
+void KTextEditor::ViewPrivate::cleanIndent()
{
KTextEditor::Cursor c(cursorPosition().line(), 0);
KTextEditor::Range r = selection() ? selectionRange() : KTextEditor::Range(c, c);
m_doc->indent(r, 0);
}
-void KateView::align()
+void KTextEditor::ViewPrivate::align()
{
// no selection: align current line; selection: use selection range
const int line = cursorPosition().line();
@@ -2523,31 +2523,31 @@ void KateView::align()
m_doc->align(this, alignRange);
}
-void KateView::comment()
+void KTextEditor::ViewPrivate::comment()
{
m_selection.setInsertBehaviors(Kate::TextRange::ExpandLeft | Kate::TextRange::ExpandRight);
m_doc->comment(this, cursorPosition().line(), cursorPosition().column(), 1);
m_selection.setInsertBehaviors(Kate::TextRange::ExpandRight);
}
-void KateView::uncomment()
+void KTextEditor::ViewPrivate::uncomment()
{
m_doc->comment(this, cursorPosition().line(), cursorPosition().column(), -1);
}
-void KateView::toggleComment()
+void KTextEditor::ViewPrivate::toggleComment()
{
m_selection.setInsertBehaviors(Kate::TextRange::ExpandLeft | Kate::TextRange::ExpandRight);
m_doc->comment(this, cursorPosition().line(), cursorPosition().column(), 0);
m_selection.setInsertBehaviors(Kate::TextRange::ExpandRight);
}
-void KateView::uppercase()
+void KTextEditor::ViewPrivate::uppercase()
{
m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Uppercase);
}
-void KateView::killLine()
+void KTextEditor::ViewPrivate::killLine()
{
if (m_selection.isEmpty()) {
m_doc->removeLine(cursorPosition().line());
@@ -2560,12 +2560,12 @@ void KateView::killLine()
}
}
-void KateView::lowercase()
+void KTextEditor::ViewPrivate::lowercase()
{
m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Lowercase);
}
-void KateView::capitalize()
+void KTextEditor::ViewPrivate::capitalize()
{
m_doc->editStart();
m_doc->transform(this, m_viewInternal->m_cursor, KateDocument::Lowercase);
@@ -2573,47 +2573,47 @@ void KateView::capitalize()
m_doc->editEnd();
}
-void KateView::keyReturn()
+void KTextEditor::ViewPrivate::keyReturn()
{
m_viewInternal->doReturn();
}
-void KateView::smartNewline()
+void KTextEditor::ViewPrivate::smartNewline()
{
m_viewInternal->doSmartNewline();
}
-void KateView::backspace()
+void KTextEditor::ViewPrivate::backspace()
{
m_viewInternal->doBackspace();
}
-void KateView::insertTab()
+void KTextEditor::ViewPrivate::insertTab()
{
m_viewInternal->doTabulator();
}
-void KateView::deleteWordLeft()
+void KTextEditor::ViewPrivate::deleteWordLeft()
{
m_viewInternal->doDeletePrevWord();
}
-void KateView::keyDelete()
+void KTextEditor::ViewPrivate::keyDelete()
{
m_viewInternal->doDelete();
}
-void KateView::deleteWordRight()
+void KTextEditor::ViewPrivate::deleteWordRight()
{
m_viewInternal->doDeleteNextWord();
}
-void KateView::transpose()
+void KTextEditor::ViewPrivate::transpose()
{
m_viewInternal->doTranspose();
}
-void KateView::cursorLeft()
+void KTextEditor::ViewPrivate::cursorLeft()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->cursorNextChar();
@@ -2622,7 +2622,7 @@ void KateView::cursorLeft()
}
}
-void KateView::shiftCursorLeft()
+void KTextEditor::ViewPrivate::shiftCursorLeft()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->cursorNextChar(true);
@@ -2631,7 +2631,7 @@ void KateView::shiftCursorLeft()
}
}
-void KateView::cursorRight()
+void KTextEditor::ViewPrivate::cursorRight()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->cursorPrevChar();
@@ -2640,7 +2640,7 @@ void KateView::cursorRight()
}
}
-void KateView::shiftCursorRight()
+void KTextEditor::ViewPrivate::shiftCursorRight()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->cursorPrevChar(true);
@@ -2649,7 +2649,7 @@ void KateView::shiftCursorRight()
}
}
-void KateView::wordLeft()
+void KTextEditor::ViewPrivate::wordLeft()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->wordNext();
@@ -2658,7 +2658,7 @@ void KateView::wordLeft()
}
}
-void KateView::shiftWordLeft()
+void KTextEditor::ViewPrivate::shiftWordLeft()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->wordNext(true);
@@ -2667,7 +2667,7 @@ void KateView::shiftWordLeft()
}
}
-void KateView::wordRight()
+void KTextEditor::ViewPrivate::wordRight()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->wordPrev();
@@ -2676,7 +2676,7 @@ void KateView::wordRight()
}
}
-void KateView::shiftWordRight()
+void KTextEditor::ViewPrivate::shiftWordRight()
{
if (m_viewInternal->m_view->currentTextLine().isRightToLeft()) {
m_viewInternal->wordPrev(true);
@@ -2685,137 +2685,137 @@ void KateView::shiftWordRight()
}
}
-void KateView::home()
+void KTextEditor::ViewPrivate::home()
{
m_viewInternal->home();
}
-void KateView::shiftHome()
+void KTextEditor::ViewPrivate::shiftHome()
{
m_viewInternal->home(true);
}
-void KateView::end()
+void KTextEditor::ViewPrivate::end()
{
m_viewInternal->end();
}
-void KateView::shiftEnd()
+void KTextEditor::ViewPrivate::shiftEnd()
{
m_viewInternal->end(true);
}
-void KateView::up()
+void KTextEditor::ViewPrivate::up()
{
m_viewInternal->cursorUp();
}
-void KateView::shiftUp()
+void KTextEditor::ViewPrivate::shiftUp()
{
m_viewInternal->cursorUp(true);
}
-void KateView::down()
+void KTextEditor::ViewPrivate::down()
{
m_viewInternal->cursorDown();
}
-void KateView::shiftDown()
+void KTextEditor::ViewPrivate::shiftDown()
{
m_viewInternal->cursorDown(true);
}
-void KateView::scrollUp()
+void KTextEditor::ViewPrivate::scrollUp()
{
m_viewInternal->scrollUp();
}
-void KateView::scrollDown()
+void KTextEditor::ViewPrivate::scrollDown()
{
m_viewInternal->scrollDown();
}
-void KateView::topOfView()
+void KTextEditor::ViewPrivate::topOfView()
{
m_viewInternal->topOfView();
}
-void KateView::shiftTopOfView()
+void KTextEditor::ViewPrivate::shiftTopOfView()
{
m_viewInternal->topOfView(true);
}
-void KateView::bottomOfView()
+void KTextEditor::ViewPrivate::bottomOfView()
{
m_viewInternal->bottomOfView();
}
-void KateView::shiftBottomOfView()
+void KTextEditor::ViewPrivate::shiftBottomOfView()
{
m_viewInternal->bottomOfView(true);
}
-void KateView::pageUp()
+void KTextEditor::ViewPrivate::pageUp()
{
m_viewInternal->pageUp();
}
-void KateView::shiftPageUp()
+void KTextEditor::ViewPrivate::shiftPageUp()
{
m_viewInternal->pageUp(true);
}
-void KateView::pageDown()
+void KTextEditor::ViewPrivate::pageDown()
{
m_viewInternal->pageDown();
}
-void KateView::shiftPageDown()
+void KTextEditor::ViewPrivate::shiftPageDown()
{
m_viewInternal->pageDown(true);
}
-void KateView::top()
+void KTextEditor::ViewPrivate::top()
{
m_viewInternal->top_home();
}
-void KateView::shiftTop()
+void KTextEditor::ViewPrivate::shiftTop()
{
m_viewInternal->top_home(true);
}
-void KateView::bottom()
+void KTextEditor::ViewPrivate::bottom()
{
m_viewInternal->bottom_end();
}
-void KateView::shiftBottom()
+void KTextEditor::ViewPrivate::shiftBottom()
{
m_viewInternal->bottom_end(true);
}
-void KateView::toMatchingBracket()
+void KTextEditor::ViewPrivate::toMatchingBracket()
{
m_viewInternal->cursorToMatchingBracket();
}
-void KateView::shiftToMatchingBracket()
+void KTextEditor::ViewPrivate::shiftToMatchingBracket()
{
m_viewInternal->cursorToMatchingBracket(true);
}
-KTextEditor::Range KateView::selectionRange() const
+KTextEditor::Range KTextEditor::ViewPrivate::selectionRange() const
{
return m_selection;
}
-KTextEditor::Document *KateView::document() const
+KTextEditor::Document *KTextEditor::ViewPrivate::document() const
{
return m_doc;
}
-void KateView::setContextMenu(QMenu *menu)
+void KTextEditor::ViewPrivate::setContextMenu(QMenu *menu)
{
if (m_contextMenu) {
disconnect(m_contextMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowContextMenu()));
@@ -2830,12 +2830,12 @@ void KateView::setContextMenu(QMenu *menu)
}
}
-QMenu *KateView::contextMenu() const
+QMenu *KTextEditor::ViewPrivate::contextMenu() const
{
if (m_userContextMenuSet) {
return m_contextMenu;
} else {
- KXMLGUIClient *client = const_cast<KateView *>(this);
+ KXMLGUIClient *client = const_cast<KTextEditor::ViewPrivate *>(this);
while (client->parentClient()) {
client = client->parentClient();
}
@@ -2859,10 +2859,10 @@ QMenu *KateView::contextMenu() const
return 0;
}
-QMenu *KateView::defaultContextMenu(QMenu *menu) const
+QMenu *KTextEditor::ViewPrivate::defaultContextMenu(QMenu *menu) const
{
if (!menu) {
- menu = new QMenu(const_cast<KateView *>(this));
+ menu = new QMenu(const_cast<KTextEditor::ViewPrivate *>(this));
}
menu->addAction(m_editUndo);
@@ -2885,7 +2885,7 @@ QMenu *KateView::defaultContextMenu(QMenu *menu) const
return menu;
}
-void KateView::aboutToShowContextMenu()
+void KTextEditor::ViewPrivate::aboutToShowContextMenu()
{
QMenu *menu = qobject_cast<QMenu *>(sender());
@@ -2894,13 +2894,13 @@ void KateView::aboutToShowContextMenu()
}
}
-void KateView::aboutToHideContextMenu()
+void KTextEditor::ViewPrivate::aboutToHideContextMenu()
{
m_spellingMenu->setUseMouseForMisspelledRange(false);
}
// BEGIN ConfigInterface stff
-QStringList KateView::configKeys() const
+QStringList KTextEditor::ViewPrivate::configKeys() const
{
return QStringList() << QLatin1String("icon-bar") << QLatin1String("line-numbers") << QLatin1String("dynamic-word-wrap")
<< QLatin1String("background-color") << QLatin1String("selection-color")
@@ -2908,7 +2908,7 @@ QStringList KateView::configKeys() const
<< QLatin1String("folding-bar");
}
-QVariant KateView::configValue(const QString &key)
+QVariant KTextEditor::ViewPrivate::configValue(const QString &key)
{
if (key == QLatin1String("icon-bar")) {
return config()->iconBar();
@@ -2936,7 +2936,7 @@ QVariant KateView::configValue(const QString &key)
return QVariant();
}
-void KateView::setConfigValue(const QString &key, const QVariant &value)
+void KTextEditor::ViewPrivate::setConfigValue(const QString &key, const QVariant &value)
{
if (value.canConvert(QVariant::Color)) {
if (key == QLatin1String("background-color")) {
@@ -2971,17 +2971,17 @@ void KateView::setConfigValue(const QString &key, const QVariant &value)
// END ConfigInterface
-void KateView::userInvokedCompletion()
+void KTextEditor::ViewPrivate::userInvokedCompletion()
{
completionWidget()->userInvokedCompletion();
}
-KateViewBar *KateView::bottomViewBar() const
+KateViewBar *KTextEditor::ViewPrivate::bottomViewBar() const
{
return m_bottomViewBar;
}
-KateCommandLineBar *KateView::cmdLineBar()
+KateCommandLineBar *KTextEditor::ViewPrivate::cmdLineBar()
{
if (!m_cmdLine) {
m_cmdLine = new KateCommandLineBar(this, bottomViewBar());
@@ -2991,7 +2991,7 @@ KateCommandLineBar *KateView::cmdLineBar()
return m_cmdLine;
}
-KateScriptConsole *KateView::consoleBar()
+KateScriptConsole *KTextEditor::ViewPrivate::consoleBar()
{
if (!m_console) {
m_console = new KateScriptConsole(this, bottomViewBar());
@@ -3001,7 +3001,7 @@ KateScriptConsole *KateView::consoleBar()
return m_console;
}
-KateSearchBar *KateView::searchBar(bool initHintAsPower)
+KateSearchBar *KTextEditor::ViewPrivate::searchBar(bool initHintAsPower)
{
if (!m_searchBar) {
m_searchBar = new KateSearchBar(initHintAsPower, this, KateViewConfig::global());
@@ -3009,7 +3009,7 @@ KateSearchBar *KateView::searchBar(bool initHintAsPower)
return m_searchBar;
}
-KateGotoBar *KateView::gotoBar()
+KateGotoBar *KTextEditor::ViewPrivate::gotoBar()
{
if (!m_gotoBar) {
m_gotoBar = new KateGotoBar(this);
@@ -3019,7 +3019,7 @@ KateGotoBar *KateView::gotoBar()
return m_gotoBar;
}
-KateDictionaryBar *KateView::dictionaryBar()
+KateDictionaryBar *KTextEditor::ViewPrivate::dictionaryBar()
{
if (!m_dictionaryBar) {
m_dictionaryBar = new KateDictionaryBar(this);
@@ -3029,7 +3029,7 @@ KateDictionaryBar *KateView::dictionaryBar()
return m_dictionaryBar;
}
-KateViEmulatedCommandBar *KateView::viModeEmulatedCommandBar()
+KateViEmulatedCommandBar *KTextEditor::ViewPrivate::viModeEmulatedCommandBar()
{
if (!m_viModeEmulatedCommandBar) {
m_viModeEmulatedCommandBar = new KateViEmulatedCommandBar(this, this);
@@ -3039,29 +3039,29 @@ KateViEmulatedCommandBar *KateView::viModeEmulatedCommandBar()
return m_viModeEmulatedCommandBar;
}
-void KateView::setAnnotationModel(KTextEditor::AnnotationModel *model)
+void KTextEditor::ViewPrivate::setAnnotationModel(KTextEditor::AnnotationModel *model)
{
KTextEditor::AnnotationModel *oldmodel = m_annotationModel;
m_annotationModel = model;
m_viewInternal->m_leftBorder->annotationModelChanged(oldmodel, m_annotationModel);
}
-KTextEditor::AnnotationModel *KateView::annotationModel() const
+KTextEditor::AnnotationModel *KTextEditor::ViewPrivate::annotationModel() const
{
return m_annotationModel;
}
-void KateView::setAnnotationBorderVisible(bool visible)
+void KTextEditor::ViewPrivate::setAnnotationBorderVisible(bool visible)
{
m_viewInternal->m_leftBorder->setAnnotationBorderOn(visible);
}
-bool KateView::isAnnotationBorderVisible() const
+bool KTextEditor::ViewPrivate::isAnnotationBorderVisible() const
{
return m_viewInternal->m_leftBorder->annotationBorderOn();
}
-KTextEditor::Range KateView::visibleRange()
+KTextEditor::Range KTextEditor::ViewPrivate::visibleRange()
{
//ensure that the view is up-to-date, otherwise 'endPos()' might fail!
m_viewInternal->updateView();
@@ -3069,23 +3069,23 @@ KTextEditor::Range KateView::visibleRange()
m_viewInternal->toRealCursor(m_viewInternal->endPos()));
}
-void KateView::toggleOnTheFlySpellCheck(bool b)
+void KTextEditor::ViewPrivate::toggleOnTheFlySpellCheck(bool b)
{
m_doc->onTheFlySpellCheckingEnabled(b);
}
-void KateView::reflectOnTheFlySpellCheckStatus(bool enabled)
+void KTextEditor::ViewPrivate::reflectOnTheFlySpellCheckStatus(bool enabled)
{
m_spellingMenu->setVisible(enabled);
m_toggleOnTheFlySpellCheck->setChecked(enabled);
}
-KateSpellingMenu *KateView::spellingMenu()
+KateSpellingMenu *KTextEditor::ViewPrivate::spellingMenu()
{
return m_spellingMenu;
}
-void KateView::notifyAboutRangeChange(int startLine, int endLine, bool rangeWithAttribute)
+void KTextEditor::ViewPrivate::notifyAboutRangeChange(int startLine, int endLine, bool rangeWithAttribute)
{
#ifdef VIEW_RANGE_DEBUG
// output args
@@ -3124,7 +3124,7 @@ void KateView::notifyAboutRangeChange(int startLine, int endLine, bool rangeWith
}
}
-void KateView::slotDelayedUpdateOfView()
+void KTextEditor::ViewPrivate::slotDelayedUpdateOfView()
{
if (!m_delayedUpdateTriggered) {
return;
@@ -3151,7 +3151,7 @@ void KateView::slotDelayedUpdateOfView()
m_lineToUpdateMax = -1;
}
-void KateView::updateRangesIn(KTextEditor::Attribute::ActivationType activationType)
+void KTextEditor::ViewPrivate::updateRangesIn(KTextEditor::Attribute::ActivationType activationType)
{
// new ranges with cursor in, default none
QSet<Kate::TextRange *> newRangesIn;
@@ -3244,7 +3244,7 @@ void KateView::updateRangesIn(KTextEditor::Attribute::ActivationType activationT
oldSet = newRangesIn;
}
-void KateView::postMessage(KTextEditor::Message *message,
+void KTextEditor::ViewPrivate::postMessage(KTextEditor::Message *message,
QList<QSharedPointer<QAction> > actions)
{
// just forward to KateMessageWidget :-)
@@ -3255,51 +3255,51 @@ void KateView::postMessage(KTextEditor::Message *message,
} else if (message->position() == KTextEditor::Message::TopInView) {
if (!m_floatTopMessageWidget) {
m_floatTopMessageWidget = new KateMessageWidget(m_viewInternal, true);
- m_notificationLayout->insertWidget(0, m_floatTopMessageWidget, 0, Qt::AlignTop | Qt::AlignRight);
- connect(this, SIGNAL(displayRangeChanged(KateView*)), m_floatTopMessageWidget, SLOT(startAutoHideTimer()));
+ m_notificationLayout->insertWidget(0, m_floatTopMessageWidget, 0, Qt::AlignTop); // FIXME KF5 | Qt::AlignRight
+ connect(this, SIGNAL(displayRangeChanged(KTextEditor::ViewPrivate*)), m_floatTopMessageWidget, SLOT(startAutoHideTimer()));
connect(this, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), m_floatTopMessageWidget, SLOT(startAutoHideTimer()));
}
m_floatTopMessageWidget->postMessage(message, actions);
} else if (message->position() == KTextEditor::Message::BottomInView) {
if (!m_floatBottomMessageWidget) {
m_floatBottomMessageWidget = new KateMessageWidget(m_viewInternal, true);
- m_notificationLayout->addWidget(m_floatBottomMessageWidget, 0, Qt::AlignBottom | Qt::AlignRight);
- connect(this, SIGNAL(displayRangeChanged(KateView*)), m_floatBottomMessageWidget, SLOT(startAutoHideTimer()));
+ m_notificationLayout->addWidget(m_floatBottomMessageWidget, 0, Qt::AlignBottom); // FIXME KF5 | Qt::AlignRight
+ connect(this, SIGNAL(displayRangeChanged(KTextEditor::ViewPrivate*)), m_floatBottomMessageWidget, SLOT(startAutoHideTimer()));
connect(this, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), m_floatBottomMessageWidget, SLOT(startAutoHideTimer()));
}
m_floatBottomMessageWidget->postMessage(message, actions);
}
}
-void KateView::saveFoldingState()
+void KTextEditor::ViewPrivate::saveFoldingState()
{
m_savedFoldingState = m_textFolding.exportFoldingRanges();
}
-void KateView::applyFoldingState()
+void KTextEditor::ViewPrivate::applyFoldingState()
{
m_textFolding.importFoldingRanges(m_savedFoldingState);
m_savedFoldingState.clear();
}
-void KateView::exportHtmlToClipboard ()
+void KTextEditor::ViewPrivate::exportHtmlToClipboard ()
{
KateExporter (this).exportToClipboard ();
}
-void KateView::exportHtmlToFile ()
+void KTextEditor::ViewPrivate::exportHtmlToFile ()
{
KateExporter (this).exportToFile ();
}
-void KateView::clearHighlights()
+void KTextEditor::ViewPrivate::clearHighlights()
{
qDeleteAll(m_rangesForHighlights);
m_rangesForHighlights.clear();
m_currentTextForHighlights.clear();
}
-void KateView::selectionChangedForHighlights()
+void KTextEditor::ViewPrivate::selectionChangedForHighlights()
{
QString text;
// if text of selection is still the same, abort
@@ -3323,7 +3323,7 @@ void KateView::selectionChangedForHighlights()
createHighlights();
}
-void KateView::createHighlights()
+void KTextEditor::ViewPrivate::createHighlights()
{
KTextEditor::Attribute::Ptr attr(new KTextEditor::Attribute());
attr->setBackground(Qt::yellow);
@@ -3364,12 +3364,12 @@ void KateView::createHighlights()
}
//BEGIN KTextEditor::PrintInterface stuff
-bool KateView::print()
+bool KTextEditor::ViewPrivate::print()
{
return KatePrinter::print(this);
}
-void KateView::printPreview()
+void KTextEditor::ViewPrivate::printPreview()
{
KatePrinter::printPreview(this);
}
diff --git a/src/view/kateview.h b/src/view/kateview.h
index 22d9ea4..f9a295c 100644
--- a/src/view/kateview.h
+++ b/src/view/kateview.h
@@ -64,6 +64,7 @@ class KateDictionaryBar;
class KateSpellingMenu;
class KateScriptConsole;
class KateMessageWidget;
+class KateIconBorder;
class KToggleAction;
class KSelectAction;
@@ -71,10 +72,13 @@ class KSelectAction;
class QAction;
class QVBoxLayout;
+namespace KTextEditor
+{
+
//
// Kate KTextEditor::View class ;)
//
-class KTEXTEDITOR_EXPORT KateView : public KTextEditor::View,
+class KTEXTEDITOR_EXPORT ViewPrivate : public KTextEditor::View,
public KTextEditor::TextHintInterface,
public KTextEditor::SessionConfigInterface,
public KTextEditor::TemplateInterface2,
@@ -91,13 +95,13 @@ class KTEXTEDITOR_EXPORT KateView : public KTextEditor::View,
Q_INTERFACES(KTextEditor::CodeCompletionInterface)
Q_INTERFACES(KTextEditor::AnnotationViewInterface)
- friend class KateViewInternal;
- friend class KateIconBorder;
- friend class KateViModeBase;
+ friend class ::KateViewInternal;
+ friend class ::KateIconBorder;
+ friend class ::KateViModeBase;
public:
- KateView(KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow = nullptr);
- ~KateView();
+ ViewPrivate (KateDocument *doc, QWidget *parent, KTextEditor::MainWindow *mainWindow = nullptr);
+ ~ViewPrivate ();
/**
* Get the view's main window, if any
@@ -774,7 +778,7 @@ public:
KTextEditor::Range visibleRange();
Q_SIGNALS:
- void displayRangeChanged(KateView *view);
+ void displayRangeChanged(ViewPrivate *view);
protected:
KToggleAction *m_toggleOnTheFlySpellCheck;
@@ -935,6 +939,8 @@ public Q_SLOTS:
virtual void printPreview();
};
+}
+
/**
* metatype register
*/
diff --git a/src/view/kateviewhelpers.cpp b/src/view/kateviewhelpers.cpp
index 18ae449..ddcaf5f 100644
--- a/src/view/kateviewhelpers.cpp
+++ b/src/view/kateviewhelpers.cpp
@@ -785,7 +785,7 @@ public:
//END KateCmdLineEditFlagCompletion
//BEGIN KateCmdLineEdit
-KateCommandLineBar::KateCommandLineBar(KateView *view, QWidget *parent)
+KateCommandLineBar::KateCommandLineBar(KTextEditor::ViewPrivate *view, QWidget *parent)
: KateViewBarWidget(true, parent)
{
QHBoxLayout *topLayout = new QHBoxLayout();
@@ -828,7 +828,7 @@ void KateCommandLineBar::execute(const QString &text)
m_lineEdit->slotReturnPressed(text);
}
-KateCmdLineEdit::KateCmdLineEdit(KateCommandLineBar *bar, KateView *view)
+KateCmdLineEdit::KateCmdLineEdit(KateCommandLineBar *bar, KTextEditor::ViewPrivate *view)
: KLineEdit()
, m_view(view)
, m_bar(bar)
@@ -2185,7 +2185,7 @@ void KateViewEncodingAction::Private::_k_subActionTriggered(QAction *action)
}
}
-KateViewEncodingAction::KateViewEncodingAction(KateDocument *_doc, KateView *_view, const QString &text, QObject *parent)
+KateViewEncodingAction::KateViewEncodingAction(KateDocument *_doc, KTextEditor::ViewPrivate *_view, const QString &text, QObject *parent)
: KSelectAction(text, parent), doc(_doc), view(_view), d(new Private(this))
{
d->init();
@@ -2335,7 +2335,7 @@ KateViewBarWidget::KateViewBarWidget(bool addCloseButton, QWidget *parent)
setFocusProxy(m_centralWidget);
}
-KateViewBar::KateViewBar(bool external, QWidget *parent, KateView *view)
+KateViewBar::KateViewBar(bool external, QWidget *parent, KTextEditor::ViewPrivate *view)
: QWidget(parent), m_external(external), m_view(view), m_permanentBarWidget(0)
{
@@ -2489,7 +2489,7 @@ void KateViewBar::hideEvent(QHideEvent *event)
//END KateViewBar related classes
-KatePasteMenu::KatePasteMenu(const QString &text, KateView *view)
+KatePasteMenu::KatePasteMenu(const QString &text, KTextEditor::ViewPrivate *view)
: KActionMenu(text, view)
, m_view(view)
{
diff --git a/src/view/kateviewhelpers.h b/src/view/kateviewhelpers.h
index 342eacd..129cf64 100644
--- a/src/view/kateviewhelpers.h
+++ b/src/view/kateviewhelpers.h
@@ -39,7 +39,7 @@
#include "katetextline.h"
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateViewInternal;
#define MAXFOLDINGCOLORS 16
@@ -148,7 +148,7 @@ private:
bool m_middleMouseDown;
bool m_leftMouseDown;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateDocument *m_doc;
class KateViewInternal *m_viewInternal;
@@ -257,7 +257,7 @@ private:
void showAnnotationMenu(int line, const QPoint &pos);
int annotationLineWidth(int line);
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateDocument *m_doc;
KateViewInternal *m_viewInternal;
@@ -303,7 +303,7 @@ class KateViewEncodingAction: public KSelectAction
Q_PROPERTY(int codecMib READ currentCodecMib)
public:
- KateViewEncodingAction(KateDocument *_doc, KateView *_view, const QString &text, QObject *parent);
+ KateViewEncodingAction(KateDocument *_doc, KTextEditor::ViewPrivate *_view, const QString &text, QObject *parent);
~KateViewEncodingAction();
@@ -327,7 +327,7 @@ Q_SIGNALS:
private:
KateDocument *doc;
- KateView *view;
+ KTextEditor::ViewPrivate *view;
class Private
{
@@ -403,7 +403,7 @@ class KateViewBar : public QWidget
public:
KateViewBar(bool external,
QWidget *parent,
- KateView *view);
+ KTextEditor::ViewPrivate *view);
/**
* Adds a widget to this viewbar.
@@ -476,7 +476,7 @@ private:
bool m_external;
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
QStackedWidget *m_stack;
KateViewBarWidget *m_permanentBarWidget;
QVBoxLayout *m_layout;
@@ -487,7 +487,7 @@ class KTEXTEDITOR_EXPORT KateCommandLineBar : public KateViewBarWidget
Q_OBJECT
public:
- explicit KateCommandLineBar(KateView *view, QWidget *parent = 0);
+ explicit KateCommandLineBar(KTextEditor::ViewPrivate *view, QWidget *parent = 0);
~KateCommandLineBar();
void setText(const QString &text, bool selected = true);
@@ -505,7 +505,7 @@ class KateCmdLineEdit : public KLineEdit
Q_OBJECT
public:
- KateCmdLineEdit(KateCommandLineBar *bar, KateView *view);
+ KateCmdLineEdit(KateCommandLineBar *bar, KTextEditor::ViewPrivate *view);
virtual bool event(QEvent *e);
void hideEvent(QHideEvent *e);
@@ -538,7 +538,7 @@ private:
void fromHistory(bool up);
QString helptext(const QPoint &) const;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateCommandLineBar *m_bar;
bool m_msgMode;
QString m_oldText;
@@ -555,10 +555,10 @@ class KatePasteMenu : public KActionMenu
Q_OBJECT
public:
- KatePasteMenu(const QString &text, KateView *view);
+ KatePasteMenu(const QString &text, KTextEditor::ViewPrivate *view);
private:
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
private Q_SLOTS:
void slotAboutToShow();
diff --git a/src/view/kateviewinternal.cpp b/src/view/kateviewinternal.cpp
index c28e545..afb670c 100644
--- a/src/view/kateviewinternal.cpp
+++ b/src/view/kateviewinternal.cpp
@@ -60,7 +60,7 @@
static const bool debugPainting = false;
-KateViewInternal::KateViewInternal(KateView *view)
+KateViewInternal::KateViewInternal(KTextEditor::ViewPrivate *view)
: QWidget(view)
, editSessionNumber(0)
, editIsRunning(false)
@@ -215,7 +215,7 @@ KateViewInternal::KateViewInternal(KateView *view)
QAccessible::installFactory(accessibleInterfaceFactory);
#endif
- // update is called in KateView, after construction and layout is over
+ // update is called in KTextEditor::ViewPrivate, after construction and layout is over
// but before any other kateviewinternal call
}
@@ -960,11 +960,11 @@ protected:
column() >= 0 &&
(!view()->wrapCursor() || column() <= doc()->lineLength(line()));
}
- KateView *view()
+ KTextEditor::ViewPrivate *view()
{
return m_vi->m_view;
}
- const KateView *view() const
+ const KTextEditor::ViewPrivate *view() const
{
return m_vi->m_view;
}
diff --git a/src/view/kateviewinternal.h b/src/view/kateviewinternal.h
index 23b7e82..8463d8c 100644
--- a/src/view/kateviewinternal.h
+++ b/src/view/kateviewinternal.h
@@ -61,7 +61,7 @@ class KateViewInternal : public QWidget
{
Q_OBJECT
- friend class KateView;
+ friend class KTextEditor::ViewPrivate;
friend class KateIconBorder;
friend class KateScrollBar;
friend class CalculatingCursor;
@@ -77,9 +77,9 @@ public:
};
public:
- KateViewInternal(KateView *view);
+ KateViewInternal(KTextEditor::ViewPrivate *view);
~KateViewInternal();
- KateView *view() const
+ KTextEditor::ViewPrivate *view() const
{
return m_view;
}
@@ -281,7 +281,7 @@ private:
KateRenderer *renderer() const;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
class KateIconBorder *m_leftBorder;
int m_mouseX;
diff --git a/src/vimode/katevicommandrangeexpressionparser.cpp b/src/vimode/katevicommandrangeexpressionparser.cpp
index 5c3055c..9a46ff3 100644
--- a/src/vimode/katevicommandrangeexpressionparser.cpp
+++ b/src/vimode/katevicommandrangeexpressionparser.cpp
@@ -66,12 +66,12 @@ CommandRangeExpressionParser::CommandRangeExpressionParser()
m_cmdRange.setPattern(QLatin1String("^(") + m_position.pattern() + QLatin1String(")((?:,(") + m_position.pattern() + QLatin1String("))?)"));
}
-Range CommandRangeExpressionParser::parseRangeExpression(const QString &command, KateView *view, QString &destRangeExpression, QString &destTransformedCommand)
+Range CommandRangeExpressionParser::parseRangeExpression(const QString &command, KTextEditor::ViewPrivate *view, QString &destRangeExpression, QString &destTransformedCommand)
{
return rangeExpressionParser.parseRangeExpression(command, destRangeExpression, destTransformedCommand, view);
}
-Range CommandRangeExpressionParser::parseRangeExpression(const QString &command, QString &destRangeExpression, QString &destTransformedCommand, KateView *view)
+Range CommandRangeExpressionParser::parseRangeExpression(const QString &command, QString &destRangeExpression, QString &destTransformedCommand, KTextEditor::ViewPrivate *view)
{
Range parsedRange(0, -1, 0, -1);
if (command.isEmpty()) {
@@ -114,7 +114,7 @@ Range CommandRangeExpressionParser::parseRangeExpression(const QString &command,
return parsedRange;
}
-int CommandRangeExpressionParser::calculatePosition(const QString &string, KateView *view)
+int CommandRangeExpressionParser::calculatePosition(const QString &string, KTextEditor::ViewPrivate *view)
{
int pos = 0;
diff --git a/src/vimode/katevicommandrangeexpressionparser.h b/src/vimode/katevicommandrangeexpressionparser.h
index 1d4f0f8..152f4db 100644
--- a/src/vimode/katevicommandrangeexpressionparser.h
+++ b/src/vimode/katevicommandrangeexpressionparser.h
@@ -27,7 +27,7 @@
#include <QRegExp>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class CommandRangeExpressionParser
{
@@ -43,10 +43,10 @@ public:
*
* An invalid Range is returned if no leading range expression could be found.
*/
- static KTextEditor::Range parseRangeExpression(const QString &command, KateView *view, QString &destRangeExpression, QString &destTransformedCommand);
+ static KTextEditor::Range parseRangeExpression(const QString &command, KTextEditor::ViewPrivate *view, QString &destRangeExpression, QString &destTransformedCommand);
private:
- KTextEditor::Range parseRangeExpression(const QString &command, QString &destRangeExpression, QString &destTransformedCommand, KateView *view);
- int calculatePosition(const QString &string, KateView *view);
+ KTextEditor::Range parseRangeExpression(const QString &command, QString &destRangeExpression, QString &destTransformedCommand, KTextEditor::ViewPrivate *view);
+ int calculatePosition(const QString &string, KTextEditor::ViewPrivate *view);
QRegExp m_line;
QRegExp m_lastLine;
QRegExp m_thisLine;
diff --git a/src/vimode/kateviemulatedcommandbar.cpp b/src/vimode/kateviemulatedcommandbar.cpp
index c5cf432..5f9a0e8 100644
--- a/src/vimode/kateviemulatedcommandbar.cpp
+++ b/src/vimode/kateviemulatedcommandbar.cpp
@@ -285,7 +285,7 @@ QString withSearchConfigRemoved(const QString &originalSearchText, const bool is
}
}
-KateViEmulatedCommandBar::KateViEmulatedCommandBar(KateView *view, QWidget *parent)
+KateViEmulatedCommandBar::KateViEmulatedCommandBar(KTextEditor::ViewPrivate *view, QWidget *parent)
: KateViewBarWidget(false, parent),
m_isActive(false),
m_mode(NoMode),
diff --git a/src/vimode/kateviemulatedcommandbar.h b/src/vimode/kateviemulatedcommandbar.h
index 1d8391f..b2c6fc3 100644
--- a/src/vimode/kateviemulatedcommandbar.h
+++ b/src/vimode/kateviemulatedcommandbar.h
@@ -26,7 +26,7 @@
#include <ktexteditor/attribute.h>
#include <ktexteditor/movingrange.h>
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class QLabel;
class QCompleter;
class QStringListModel;
@@ -42,7 +42,7 @@ class KTEXTEDITOR_EXPORT KateViEmulatedCommandBar : public KateViewBarWidget
Q_OBJECT
public:
enum Mode { NoMode, SearchForward, SearchBackward, Command };
- explicit KateViEmulatedCommandBar(KateView *view, QWidget *parent = 0);
+ explicit KateViEmulatedCommandBar(KTextEditor::ViewPrivate *view, QWidget *parent = 0);
virtual ~KateViEmulatedCommandBar();
void init(Mode mode, const QString &initialText = QString());
bool isActive();
@@ -56,7 +56,7 @@ public:
private:
bool m_isActive;
Mode m_mode;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
QLineEdit *m_edit;
QLabel *m_barTypeIndicator;
void showBarTypeIndicator(Mode mode);
diff --git a/src/vimode/kateviglobal.cpp b/src/vimode/kateviglobal.cpp
index dc35281..e1a0662 100644
--- a/src/vimode/kateviglobal.cpp
+++ b/src/vimode/kateviglobal.cpp
@@ -208,7 +208,7 @@ bool KateViGlobal::isMappingRecursive(MappingMode mode, const QString &from) con
return m_mappingsForMode[mode][from].isRecursive;
}
-KateViGlobal::MappingMode KateViGlobal::mappingModeForCurrentViMode(KateView *view)
+KateViGlobal::MappingMode KateViGlobal::mappingModeForCurrentViMode(KTextEditor::ViewPrivate *view)
{
if (view->viModeEmulatedCommandBar()->isActive()) {
return CommandModeMapping;
diff --git a/src/vimode/kateviglobal.h b/src/vimode/kateviglobal.h
index e3ba39b..4dd1bc8 100644
--- a/src/vimode/kateviglobal.h
+++ b/src/vimode/kateviglobal.h
@@ -71,7 +71,7 @@ public:
* Returns CommandModeMapping if the emulated command bar is active, else the mapping mode
* corresponding to the current Vi mode.
*/
- static MappingMode mappingModeForCurrentViMode(KateView *view);
+ static MappingMode mappingModeForCurrentViMode(KTextEditor::ViewPrivate *view);
QStringList searchHistory();
void clearSearchHistory();
diff --git a/src/vimode/kateviinputmodemanager.cpp b/src/vimode/kateviinputmodemanager.cpp
index 996f7a6..9aeb442 100644
--- a/src/vimode/kateviinputmodemanager.cpp
+++ b/src/vimode/kateviinputmodemanager.cpp
@@ -50,7 +50,7 @@ using KTextEditor::Mark;
using KTextEditor::MarkInterface;
using KTextEditor::MovingCursor;
-KateViInputModeManager::KateViInputModeManager(KateView *view, KateViewInternal *viewInternal)
+KateViInputModeManager::KateViInputModeManager(KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal)
{
m_viNormalMode = new KateViNormalMode(this, view, viewInternal);
m_viInsertMode = new KateViInsertMode(this, view, viewInternal);
diff --git a/src/vimode/kateviinputmodemanager.h b/src/vimode/kateviinputmodemanager.h
index e19cb9e..0f46840 100644
--- a/src/vimode/kateviinputmodemanager.h
+++ b/src/vimode/kateviinputmodemanager.h
@@ -31,7 +31,7 @@
#include <ktexteditor/markinterface.h>
class KConfigGroup;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateDocument;
class KateViewInternal;
class KateViModeBase;
@@ -72,7 +72,7 @@ class KTEXTEDITOR_EXPORT KateViInputModeManager : public QObject
Q_OBJECT
public:
- KateViInputModeManager(KateView *view, KateViewInternal *viewInternal);
+ KateViInputModeManager(KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal);
~KateViInputModeManager();
/**
@@ -337,7 +337,7 @@ private:
ViMode m_currentViMode;
ViMode m_previousViMode;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateViewInternal *m_viewInternal;
KateViKeyParser *m_keyParser;
diff --git a/src/vimode/kateviinsertmode.cpp b/src/vimode/kateviinsertmode.cpp
index b5c7d76..bbbbfbb 100644
--- a/src/vimode/kateviinsertmode.cpp
+++ b/src/vimode/kateviinsertmode.cpp
@@ -35,7 +35,7 @@
using KTextEditor::Cursor;
KateViInsertMode::KateViInsertMode(KateViInputModeManager *viInputModeManager,
- KateView *view, KateViewInternal *viewInternal) : KateViModeBase()
+ KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal) : KateViModeBase()
{
m_view = view;
m_viewInternal = viewInternal;
diff --git a/src/vimode/kateviinsertmode.h b/src/vimode/kateviinsertmode.h
index 8afb76c..6cb06b2 100644
--- a/src/vimode/kateviinsertmode.h
+++ b/src/vimode/kateviinsertmode.h
@@ -27,7 +27,7 @@
#include <ktexteditor_export.h>
class KateViMotion;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateViewInternal;
/**
@@ -47,7 +47,7 @@ class KTEXTEDITOR_EXPORT KateViInsertMode : public KateViModeBase
{
Q_OBJECT
public:
- KateViInsertMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal);
+ KateViInsertMode(KateViInputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal);
~KateViInsertMode();
bool handleKeypress(const QKeyEvent *e);
diff --git a/src/vimode/katevikeymapper.cpp b/src/vimode/katevikeymapper.cpp
index 4a9f76a..798709e 100644
--- a/src/vimode/katevikeymapper.cpp
+++ b/src/vimode/katevikeymapper.cpp
@@ -26,7 +26,7 @@
#include <QTimer>
-KateViKeyMapper::KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *doc, KateView *view)
+KateViKeyMapper::KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *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 6974a62..7a3e9a6 100644
--- a/src/vimode/katevikeymapper.h
+++ b/src/vimode/katevikeymapper.h
@@ -26,7 +26,7 @@
class KateViInputModeManager;
class KateDocument;
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class QTimer;
@@ -34,7 +34,7 @@ class KTEXTEDITOR_EXPORT KateViKeyMapper : public QObject
{
Q_OBJECT
public:
- KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *doc, KateView *view);
+ KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *doc, KTextEditor::ViewPrivate *view);
bool handleKeypress(QChar key);
void setMappingTimeout(int timeoutMS);
void setDoNotMapNextKeypress();
@@ -55,7 +55,7 @@ private:
QTimer *m_mappingTimer;
KateViInputModeManager *m_viInputModeManager;
KateDocument *m_doc;
- KateView *m_view;
+ 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;
int m_numMappingsBeingExecuted;
diff --git a/src/vimode/katevimodebase.cpp b/src/vimode/katevimodebase.cpp
index c808950..9548bb5 100644
--- a/src/vimode/katevimodebase.cpp
+++ b/src/vimode/katevimodebase.cpp
@@ -1388,8 +1388,8 @@ void KateViModeBase::addToNumberUnderCursor(int count)
void KateViModeBase::switchView(Direction direction)
{
- QList<KateView *> visible_views;
- foreach (KateView *view, KTextEditor::EditorPrivate::self()->views()) {
+ QList<KTextEditor::ViewPrivate *> visible_views;
+ foreach (KTextEditor::ViewPrivate *view, KTextEditor::EditorPrivate::self()->views()) {
if (view->isVisible()) {
visible_views.push_back(view);
}
@@ -1403,7 +1403,7 @@ void KateViModeBase::switchView(Direction direction)
int curr_cursor_y = m_view->mapToGlobal(m_view->cursorToCoordinate(m_view->cursorPosition())).y();
int curr_cursor_x = m_view->mapToGlobal(m_view->cursorToCoordinate(m_view->cursorPosition())).x();
- KateView *bestview = NULL;
+ KTextEditor::ViewPrivate *bestview = NULL;
int best_x1 = -1, best_x2 = -1, best_y1 = -1, best_y2 = -1, best_center_y = -1, best_center_x = -1;
if (direction == Next && visible_views.count() != 1) {
@@ -1417,7 +1417,7 @@ void KateViModeBase::switchView(Direction direction)
}
}
} else {
- foreach (KateView *view, visible_views) {
+ foreach (KTextEditor::ViewPrivate *view, visible_views) {
QPoint point = view->mapToGlobal(view->pos());
int x1 = point.x();
int x2 = point.x() + view->width();
diff --git a/src/vimode/katevimodebase.h b/src/vimode/katevimodebase.h
index 3d68917..4027716 100644
--- a/src/vimode/katevimodebase.h
+++ b/src/vimode/katevimodebase.h
@@ -190,7 +190,7 @@ protected:
bool m_lastMotionWasVisualLineUpOrDown;
bool m_currentMotionWasVisualLineUpOrDown;
- KateView *m_view;
+ KTextEditor::ViewPrivate *m_view;
KateViewInternal *m_viewInternal;
KateViInputModeManager *m_viInputModeManager;
diff --git a/src/vimode/katevinormalmode.cpp b/src/vimode/katevinormalmode.cpp
index 333f2b0..ed70c40 100644
--- a/src/vimode/katevinormalmode.cpp
+++ b/src/vimode/katevinormalmode.cpp
@@ -55,7 +55,7 @@ using KTextEditor::Range;
#define ADDMOTION(STR, FUNC, FLGS) m_motions.push_back( \
new KateViMotion( this, QLatin1String(STR), &KateViNormalMode::FUNC, FLGS ) );
-KateViNormalMode::KateViNormalMode(KateViInputModeManager *viInputModeManager, KateView *view,
+KateViNormalMode::KateViNormalMode(KateViInputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view,
KateViewInternal *viewInternal) : KateViModeBase()
{
m_view = view;
diff --git a/src/vimode/katevinormalmode.h b/src/vimode/katevinormalmode.h
index db69f87..aa3025f 100644
--- a/src/vimode/katevinormalmode.h
+++ b/src/vimode/katevinormalmode.h
@@ -49,7 +49,7 @@ class KTEXTEDITOR_EXPORT KateViNormalMode : public KateViModeBase
Q_OBJECT
public:
- KateViNormalMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal);
+ KateViNormalMode(KateViInputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal);
virtual ~KateViNormalMode();
bool handleKeypress(const QKeyEvent *e);
diff --git a/src/vimode/katevireplacemode.cpp b/src/vimode/katevireplacemode.cpp
index 5200fd3..25ac320 100644
--- a/src/vimode/katevireplacemode.cpp
+++ b/src/vimode/katevireplacemode.cpp
@@ -25,7 +25,7 @@
#include "kateconfig.h"
KateViReplaceMode::KateViReplaceMode(KateViInputModeManager *viInputModeManager,
- KateView *view, KateViewInternal *viewInternal) : KateViModeBase()
+ KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal) : KateViModeBase()
{
m_view = view;
m_viewInternal = viewInternal;
diff --git a/src/vimode/katevireplacemode.h b/src/vimode/katevireplacemode.h
index 97874cb..cf67ebb 100644
--- a/src/vimode/katevireplacemode.h
+++ b/src/vimode/katevireplacemode.h
@@ -23,7 +23,7 @@
#include "katevimodebase.h"
-class KateView;
+namespace KTextEditor { class ViewPrivate; }
class KateViewInternal;
class QKeyEvent;
@@ -34,7 +34,7 @@ class QKeyEvent;
class KateViReplaceMode : public KateViModeBase
{
public:
- KateViReplaceMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal);
+ KateViReplaceMode(KateViInputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal);
~KateViReplaceMode();
bool handleKeypress(const QKeyEvent *e);
diff --git a/src/vimode/katevivisualmode.cpp b/src/vimode/katevivisualmode.cpp
index c3a7cfa..f117e8a 100644
--- a/src/vimode/katevivisualmode.cpp
+++ b/src/vimode/katevivisualmode.cpp
@@ -38,7 +38,7 @@ using KTextEditor::View;
#define ADDMOTION(STR, FUNC, FLGS) m_motions.push_back( new \
KateViMotion( this, QLatin1String(STR), &KateViNormalMode::FUNC, FLGS ) );
-KateViVisualMode::KateViVisualMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal)
+KateViVisualMode::KateViVisualMode(KateViInputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal)
: KateViNormalMode(viInputModeManager, view, viewInternal)
{
m_start.setPosition(-1, -1);
diff --git a/src/vimode/katevivisualmode.h b/src/vimode/katevivisualmode.h
index 00e7823..b676da1 100644
--- a/src/vimode/katevivisualmode.h
+++ b/src/vimode/katevivisualmode.h
@@ -36,7 +36,7 @@ class KateViVisualMode : public KateViNormalMode
Q_OBJECT
public:
- KateViVisualMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal);
+ KateViVisualMode(KateViInputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal);
~KateViVisualMode();
void init();