summaryrefslogtreecommitdiffstats
path: root/kate/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'kate/interfaces')
-rw-r--r--kate/interfaces/CMakeLists.txt47
-rw-r--r--kate/interfaces/Makefile.am14
-rw-r--r--kate/interfaces/application.cpp97
-rw-r--r--kate/interfaces/application.h79
-rw-r--r--kate/interfaces/documentmanager.cpp120
-rw-r--r--kate/interfaces/documentmanager.h111
-rw-r--r--kate/interfaces/mainwindow.cpp82
-rw-r--r--kate/interfaces/mainwindow.h65
-rw-r--r--kate/interfaces/plugin.cpp106
-rw-r--r--kate/interfaces/plugin.h87
-rw-r--r--kate/interfaces/pluginconfiginterface.cpp63
-rw-r--r--kate/interfaces/pluginconfiginterface.h63
-rw-r--r--kate/interfaces/pluginconfiginterfaceextension.cpp68
-rw-r--r--kate/interfaces/pluginconfiginterfaceextension.h104
-rw-r--r--kate/interfaces/pluginmanager.cpp78
-rw-r--r--kate/interfaces/pluginmanager.h70
-rw-r--r--kate/interfaces/toolviewmanager.cpp85
-rw-r--r--kate/interfaces/toolviewmanager.h96
-rw-r--r--kate/interfaces/viewmanager.cpp73
-rw-r--r--kate/interfaces/viewmanager.h89
20 files changed, 1597 insertions, 0 deletions
diff --git a/kate/interfaces/CMakeLists.txt b/kate/interfaces/CMakeLists.txt
new file mode 100644
index 000000000..eb7577394
--- /dev/null
+++ b/kate/interfaces/CMakeLists.txt
@@ -0,0 +1,47 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+##### headers ###################################
+
+install( FILES
+ application.h documentmanager.h mainwindow.h
+ plugin.h viewmanager.h pluginconfiginterface.h
+ pluginconfiginterfaceextension.h toolviewmanager.h
+ pluginmanager.h
+ DESTINATION ${INCLUDE_INSTALL_DIR}/kate )
+
+
+##### kateinterfacesprivate (static lib) ########
+
+set( target kateinterfacesprivate )
+
+set( ${target}_SRCS
+ application.cpp mainwindow.cpp documentmanager.cpp
+ viewmanager.cpp toolviewmanager.cpp pluginmanager.cpp
+ plugin.cpp pluginconfiginterface.cpp
+ pluginconfiginterfaceextension.cpp
+)
+
+tde_add_library( ${target} STATIC_PIC AUTOMOC
+ SOURCES ${${target}_SRCS}
+ LINK katepartinterfaces-shared
+)
diff --git a/kate/interfaces/Makefile.am b/kate/interfaces/Makefile.am
new file mode 100644
index 000000000..57901370b
--- /dev/null
+++ b/kate/interfaces/Makefile.am
@@ -0,0 +1,14 @@
+METASOURCES = AUTO
+
+noinst_LTLIBRARIES = libkateinterfacesprivate.la
+
+libkateinterfacesprivate_la_SOURCES = application.cpp mainwindow.cpp documentmanager.cpp viewmanager.cpp toolviewmanager.cpp \
+ pluginmanager.cpp plugin.cpp pluginconfiginterface.cpp pluginconfiginterfaceextension.cpp
+
+libkateinterfacesprivate_la_LIBADD = -lkatepartinterfaces
+libkateinterfacesprivate_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor
+
+kateinclude_HEADERS = application.h documentmanager.h mainwindow.h plugin.h viewmanager.h pluginconfiginterface.h pluginconfiginterfaceextension.h toolviewmanager.h pluginmanager.h
+kateincludedir = $(includedir)/kate
+
+INCLUDES= $(all_includes)
diff --git a/kate/interfaces/application.cpp b/kate/interfaces/application.cpp
new file mode 100644
index 000000000..5aded5505
--- /dev/null
+++ b/kate/interfaces/application.cpp
@@ -0,0 +1,97 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "application.h"
+#include "application.moc"
+
+#include "documentmanager.h"
+#include "mainwindow.h"
+#include "pluginmanager.h"
+
+#include "../app/kateapp.h"
+#include "../app/katedocmanager.h"
+#include "../app/katepluginmanager.h"
+#include "../app/katemainwindow.h"
+
+namespace Kate
+{
+
+class PrivateApplication
+ {
+ public:
+ PrivateApplication ()
+ {
+ }
+
+ ~PrivateApplication ()
+ {
+
+ }
+
+ KateApp *app;
+ };
+
+Application::Application (void *application) : TQObject ((KateApp *) application)
+{
+ d = new PrivateApplication;
+ d->app = (KateApp *) application;
+}
+
+Application::~Application ()
+{
+ delete d;
+}
+
+DocumentManager *Application::documentManager ()
+{
+ return d->app->documentManager ()->documentManager ();
+}
+
+PluginManager *Application::pluginManager ()
+{
+ return d->app->pluginManager ()->pluginManager ();
+}
+
+MainWindow *Application::activeMainWindow ()
+{
+ if (!d->app->activeMainWindow())
+ return 0;
+
+ return d->app->activeMainWindow()->mainWindow();
+}
+
+uint Application::mainWindows ()
+{
+ return d->app->mainWindows ();
+}
+
+MainWindow *Application::mainWindow (uint n)
+{
+ if (n < mainWindows ())
+ return d->app->mainWindow (n)->mainWindow();
+
+ return 0;
+}
+
+Application *application ()
+{
+ return KateApp::self()->application ();
+}
+
+}
+
diff --git a/kate/interfaces/application.h b/kate/interfaces/application.h
new file mode 100644
index 000000000..52eb129d5
--- /dev/null
+++ b/kate/interfaces/application.h
@@ -0,0 +1,79 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_APPLICATION_INCLUDE_
+#define _KATE_APPLICATION_INCLUDE_
+
+#include <tqobject.h>
+#include <kurl.h>
+
+namespace Kate
+{
+
+class DocumentManager;
+class PluginManager;
+class InitPluginManager;
+class MainWindow;
+
+/**
+ * Interface to the application, beside some global methodes to access
+ * other objects like document/projectmanager, ... no way goes around this
+ * central interface
+ */
+class KDE_EXPORT Application : public TQObject
+{
+ friend class PrivateApplication;
+
+ Q_OBJECT
+
+ public:
+ /**
+ * Construtor, should not interest, internal usage
+ */
+ Application (void *application);
+
+ /**
+ * Desctructor
+ */
+ virtual ~Application ();
+
+ public:
+ /** Returns a pointer to the document manager
+ */
+ Kate::DocumentManager *documentManager ();
+
+ Kate::PluginManager *pluginManager ();
+
+ Kate::MainWindow *activeMainWindow ();
+
+ uint mainWindows ();
+ Kate::MainWindow *mainWindow (uint n = 0);
+
+ private:
+ class PrivateApplication *d;
+};
+
+/**
+ * Returns the application object
+ * @return Application application object
+ */
+KDE_EXPORT Application *application ();
+
+}
+
+#endif
diff --git a/kate/interfaces/documentmanager.cpp b/kate/interfaces/documentmanager.cpp
new file mode 100644
index 000000000..750839781
--- /dev/null
+++ b/kate/interfaces/documentmanager.cpp
@@ -0,0 +1,120 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "documentmanager.h"
+#include "documentmanager.moc"
+
+#include "plugin.h"
+#include "viewmanager.h"
+#include "toolviewmanager.h"
+#include "pluginmanager.h"
+
+#include "application.h"
+
+#include "../app/katedocmanager.h"
+
+namespace Kate
+{
+
+class PrivateDocumentManager
+ {
+ public:
+ PrivateDocumentManager ()
+ {
+ }
+
+ ~PrivateDocumentManager ()
+ {
+ }
+
+ KateDocManager *docMan;
+ };
+
+DocumentManager::DocumentManager (void *documentManager) : TQObject ((KateDocManager*) documentManager)
+{
+ d = new PrivateDocumentManager ();
+ d->docMan = (KateDocManager*) documentManager;
+}
+
+DocumentManager::~DocumentManager ()
+{
+ delete d;
+}
+
+Document *DocumentManager::document (uint n)
+{
+ return d->docMan->document (n);
+}
+
+Document *DocumentManager::activeDocument ()
+{
+ return d->docMan->activeDocument ();
+}
+
+Document *DocumentManager::documentWithID (uint id)
+{
+ return d->docMan->documentWithID (id);
+}
+
+int DocumentManager::findDocument (const KURL &url)
+{
+ return d->docMan->findDocument (url);
+}
+
+bool DocumentManager::isOpen (const KURL &url)
+{
+ return d->docMan->isOpen (url);
+}
+
+uint DocumentManager::documents ()
+{
+ return d->docMan->documents ();
+}
+
+Document *DocumentManager::openURL(const KURL&url,const TQString &encoding,uint *id)
+{
+ return d->docMan->openURL (url, encoding, id);
+}
+
+bool DocumentManager::closeDocument(Document *document)
+{
+ return d->docMan->closeDocument (document);
+}
+
+bool DocumentManager::closeDocument(uint n)
+{
+ return d->docMan->closeDocument (n);
+}
+
+bool DocumentManager::closeDocumentWithID(uint id)
+{
+ return d->docMan->closeDocument (id);
+}
+
+bool DocumentManager::closeAllDocuments()
+{
+ return d->docMan->closeAllDocuments ();
+}
+
+DocumentManager *documentManager ()
+{
+ return application()->documentManager ();
+}
+
+}
+
diff --git a/kate/interfaces/documentmanager.h b/kate/interfaces/documentmanager.h
new file mode 100644
index 000000000..8b5f554af
--- /dev/null
+++ b/kate/interfaces/documentmanager.h
@@ -0,0 +1,111 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_DOCMANAGER_INCLUDE_
+#define _KATE_DOCMANAGER_INCLUDE_
+
+#include <tqobject.h>
+#include <kurl.h>
+
+namespace Kate
+{
+/** This interface provides access to the Kate Document Manager.
+*/
+class KDE_EXPORT DocumentManager : public TQObject
+{
+ friend class PrivateDocumentManager;
+
+ Q_OBJECT
+
+ public:
+ DocumentManager ( void *documentManager );
+ virtual ~DocumentManager ();
+
+ public:
+ /** Returns a pointer to the document indexed by n in the managers internal list.
+ */
+ class Document *document (uint n = 0);
+ /** Returns a pointer to the currently active document or NULL if no document is open.
+ */
+ class Document *activeDocument ();
+ /** Returns a pointer to the document with the given ID or NULL if no such document exists.
+ */
+ class Document *documentWithID (uint id);
+
+ /** Returns the ID of the document located at url if such a document is known by the manager.
+ */
+ int findDocument (const KURL &url);
+ /** Returns true if the document located at url is open, otherwise false.
+ */
+ bool isOpen (const KURL &url);
+
+ /** returns the number of documents managed by this manager.
+ */
+ uint documents ();
+
+ /** open a document and return a pointer to the document, if you specify a pointer != 0 to the id parameter
+ * you will get the document id returned too
+ */
+ class Document *openURL(const KURL&url,const TQString &encoding=TQString::null,uint *id =0);
+ /** close a document by pointer
+ */
+ bool closeDocument(class Document *document);
+ /** close a document identified by the index
+ */
+ bool closeDocument(uint n = 0);
+ /** close a document identified by the ID
+ */
+ bool closeDocumentWithID(uint id);
+ /** close all documents
+ */
+ bool closeAllDocuments();
+
+ #undef signals
+ #define signals public
+ signals:
+ #undef signals
+ #define signals protected
+
+ /**
+ * emitted if the current doc changes (there need not to be a active document)
+ */
+ void documentChanged ();
+
+ /**
+ * this document has now been created
+ */
+ void documentCreated (Kate::Document *document);
+
+ /**
+ * the document with this number was deleted
+ */
+ void documentDeleted (uint documentNumber);
+
+ private:
+ class PrivateDocumentManager *d;
+};
+
+/**
+ * Returns the document manager object
+ * @return DocumentManager document manager object
+ */
+KDE_EXPORT DocumentManager *documentManager ();
+
+}
+
+#endif
diff --git a/kate/interfaces/mainwindow.cpp b/kate/interfaces/mainwindow.cpp
new file mode 100644
index 000000000..4596cacb5
--- /dev/null
+++ b/kate/interfaces/mainwindow.cpp
@@ -0,0 +1,82 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "mainwindow.h"
+#include "mainwindow.moc"
+
+#include "documentmanager.h"
+#include "plugin.h"
+#include "viewmanager.h"
+#include "toolviewmanager.h"
+#include "pluginmanager.h"
+
+#include "../app/katemainwindow.h"
+#include "../app/kateviewmanager.h"
+
+namespace Kate
+{
+
+class PrivateMainWindow
+ {
+ public:
+ PrivateMainWindow ()
+ {
+ }
+
+ ~PrivateMainWindow ()
+ {
+
+ }
+
+ KateMainWindow *win;
+ };
+
+MainWindow::MainWindow (void *mainWindow) : TQObject ((KateMainWindow*) mainWindow)
+{
+ d = new PrivateMainWindow;
+ d->win = (KateMainWindow*) mainWindow;
+}
+
+MainWindow::~MainWindow ()
+{
+ delete d;
+}
+
+KXMLGUIFactory *MainWindow::guiFactory() const
+{
+ return d->win->guiFactory();
+}
+
+ViewManager *MainWindow::viewManager () const
+{
+ return d->win->viewManager ()->viewManager ();
+}
+
+class TQWidget *MainWindow::centralWidget() const
+{
+ return d->win->centralWidget();
+}
+
+ToolViewManager *MainWindow::toolViewManager () const
+{
+ return d->win->toolViewManager ();
+}
+
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/interfaces/mainwindow.h b/kate/interfaces/mainwindow.h
new file mode 100644
index 000000000..bb40ffb9c
--- /dev/null
+++ b/kate/interfaces/mainwindow.h
@@ -0,0 +1,65 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_MAINWINDOW_INCLUDE_
+#define _KATE_MAINWINDOW_INCLUDE_
+
+#include <tqobject.h>
+
+#include <kxmlguifactory.h>
+#include <kurl.h>
+
+namespace Kate
+{
+
+class ViewManager;
+
+class KDE_EXPORT MainWindow : public TQObject
+{
+ friend class PrivateMainWindow;
+
+ Q_OBJECT
+
+ public:
+ MainWindow (void *mainWindow);
+ virtual ~MainWindow ();
+
+ public: /*these are slots for kjs*/
+ KXMLGUIFactory *guiFactory() const;
+
+ public slots:
+ Kate::ViewManager *viewManager () const;
+
+ public :
+ /**
+ * Access the widget (in the middle of the 4 sidebars) in which the editor
+ * component and the KateTabBar are embedded. This widget is a TQVBox, so
+ * other child widgets can be embedded unter the editor widget.
+ */
+ class TQWidget *centralWidget() const;
+ class ToolViewManager *toolViewManager() const;
+
+ private:
+ class PrivateMainWindow *d;
+};
+
+}
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/interfaces/plugin.cpp b/kate/interfaces/plugin.cpp
new file mode 100644
index 000000000..d68724549
--- /dev/null
+++ b/kate/interfaces/plugin.cpp
@@ -0,0 +1,106 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+ #include "application.h"
+
+#include "plugin.h"
+#include "plugin.moc"
+
+#include <tdeparts/componentfactory.h>
+
+namespace Kate
+{
+
+ class PrivatePlugin
+ {
+ public:
+ PrivatePlugin ()
+ {
+ }
+
+ ~PrivatePlugin ()
+ {
+ }
+ };
+
+ class PrivatePluginViewInterface
+ {
+ public:
+ PrivatePluginViewInterface ()
+ {
+ }
+
+ ~PrivatePluginViewInterface ()
+ {
+ }
+
+ };
+
+unsigned int Plugin::globalPluginNumber = 0;
+unsigned int PluginViewInterface::globalPluginViewInterfaceNumber = 0;
+
+Plugin::Plugin( Application *application, const char *name ) : TQObject (application, name )
+{
+ globalPluginNumber++;
+ myPluginNumber = globalPluginNumber;
+}
+
+Plugin::~Plugin()
+{
+}
+
+unsigned int Plugin::pluginNumber () const
+{
+ return myPluginNumber;
+}
+
+Application *Plugin::application () const
+{
+ return Kate::application();
+}
+
+PluginViewInterface::PluginViewInterface()
+{
+ globalPluginViewInterfaceNumber++;
+ myPluginViewInterfaceNumber = globalPluginViewInterfaceNumber;
+}
+
+PluginViewInterface::~PluginViewInterface()
+{
+}
+
+unsigned int PluginViewInterface::pluginViewInterfaceNumber () const
+{
+ return myPluginViewInterfaceNumber;
+}
+
+Plugin *createPlugin ( const char* libname, Application *application, const char *name, const TQStringList &args )
+{
+ return KParts::ComponentFactory::createInstanceFromLibrary<Plugin>( libname, application, name, args);
+}
+
+PluginViewInterface *pluginViewInterface (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<PluginViewInterface*>(plugin->tqt_cast("Kate::PluginViewInterface"));
+}
+
+}
+
diff --git a/kate/interfaces/plugin.h b/kate/interfaces/plugin.h
new file mode 100644
index 000000000..00932c5ff
--- /dev/null
+++ b/kate/interfaces/plugin.h
@@ -0,0 +1,87 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+ Copyright (C) 2002 Joseph Wenninger <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_PLUGIN_INCLUDE_
+#define _KATE_PLUGIN_INCLUDE_
+
+#include <tqwidget.h>
+#include <tqpixmap.h>
+#include <kicontheme.h>
+
+#include <kurl.h>
+
+namespace Kate
+{
+
+class Application;
+class MainWindow;
+
+class KDE_EXPORT Plugin : public TQObject
+{
+ friend class PrivatePlugin;
+
+ Q_OBJECT
+
+ public:
+ Plugin (Application *application = 0, const char *name = 0 );
+ virtual ~Plugin ();
+
+ unsigned int pluginNumber () const;
+
+ Application *application() const;
+
+ private:
+ class PrivatePlugin *d;
+ static unsigned int globalPluginNumber;
+ unsigned int myPluginNumber;
+};
+
+KDE_EXPORT Plugin *createPlugin ( const char* libname, Application *application = 0, const char *name = 0,const TQStringList &args = TQStringList() );
+
+/*
+ * view plugin class
+ * this plugin will be bound to a tdetexteditor::view
+ */
+class KDE_EXPORT PluginViewInterface
+{
+ friend class PrivatePluginViewInterface;
+
+ public:
+ PluginViewInterface ();
+ virtual ~PluginViewInterface ();
+
+ unsigned int pluginViewInterfaceNumber () const;
+
+ /*
+ * will be called from the part to bound the plugin to a view
+ */
+ virtual void addView (MainWindow *) = 0;
+ virtual void removeView (MainWindow *) = 0;
+
+ private:
+ class PrivatePluginViewInterface *d;
+ static unsigned int globalPluginViewInterfaceNumber;
+ unsigned int myPluginViewInterfaceNumber;
+};
+
+KDE_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin);
+
+}
+
+#endif
diff --git a/kate/interfaces/pluginconfiginterface.cpp b/kate/interfaces/pluginconfiginterface.cpp
new file mode 100644
index 000000000..ab6c7d736
--- /dev/null
+++ b/kate/interfaces/pluginconfiginterface.cpp
@@ -0,0 +1,63 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "pluginconfiginterface.h"
+
+#include "plugin.h"
+
+namespace Kate
+{
+
+class PrivatePluginConfigInterface
+{
+ public:
+ PrivatePluginConfigInterface() {}
+ ~PrivatePluginConfigInterface() {}
+};
+
+}
+
+using namespace Kate;
+
+unsigned int PluginConfigInterface::globalPluginConfigInterfaceNumber = 0;
+
+PluginConfigInterface::PluginConfigInterface()
+{
+ globalPluginConfigInterfaceNumber++;
+ myPluginConfigInterfaceNumber = globalPluginConfigInterfaceNumber++;
+
+ d = new PrivatePluginConfigInterface();
+}
+
+PluginConfigInterface::~PluginConfigInterface()
+{
+ delete d;
+}
+
+unsigned int PluginConfigInterface::pluginConfigInterfaceNumber () const
+{
+ return myPluginConfigInterfaceNumber;
+}
+
+PluginConfigInterface *Kate::pluginConfigInterface (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<PluginConfigInterface*>(plugin->tqt_cast("Kate::PluginConfigInterface"));
+}
diff --git a/kate/interfaces/pluginconfiginterface.h b/kate/interfaces/pluginconfiginterface.h
new file mode 100644
index 000000000..f626b1cde
--- /dev/null
+++ b/kate/interfaces/pluginconfiginterface.h
@@ -0,0 +1,63 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kate_pluginconfiginterface_h__
+#define __kate_pluginconfiginterface_h__
+
+#include <kdemacros.h>
+
+namespace Kate
+{
+
+/*
+* This is an interface for the KTextEditor::Document/Plugin/ViewPlugin classes !!!
+*/
+class KDE_EXPORT PluginConfigInterface
+{
+ friend class PrivatePluginConfigInterface;
+
+ public:
+ PluginConfigInterface();
+ virtual ~PluginConfigInterface();
+
+ unsigned int pluginConfigInterfaceNumber () const;
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ Read/Write the config to the standard place where this editor
+ part saves it config, say: read/save default values for that
+ editor part
+ */
+ virtual void readConfig () = 0;
+ virtual void writeConfig () = 0;
+
+ private:
+ class PrivatePluginConfigInterface *d;
+ static unsigned int globalPluginConfigInterfaceNumber;
+ unsigned int myPluginConfigInterfaceNumber;
+};
+
+class Plugin;
+KDE_EXPORT PluginConfigInterface *pluginConfigInterface (Plugin *plugin);
+
+}
+
+#endif
diff --git a/kate/interfaces/pluginconfiginterfaceextension.cpp b/kate/interfaces/pluginconfiginterfaceextension.cpp
new file mode 100644
index 000000000..68b7b8ec1
--- /dev/null
+++ b/kate/interfaces/pluginconfiginterfaceextension.cpp
@@ -0,0 +1,68 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "pluginconfiginterfaceextension.h"
+#include "pluginconfiginterfaceextension.moc"
+
+#include "plugin.h"
+
+namespace Kate
+{
+
+class PrivatePluginConfigInterfaceExtension
+{
+ public:
+ PrivatePluginConfigInterfaceExtension() {}
+ ~PrivatePluginConfigInterfaceExtension() {}
+};
+
+}
+
+using namespace Kate;
+
+PluginConfigPage::PluginConfigPage ( TQWidget *parent, const char *name ) : TQWidget (parent, name) { }
+
+PluginConfigPage::~PluginConfigPage () { }
+
+unsigned int PluginConfigInterfaceExtension::globalPluginConfigInterfaceExtensionNumber = 0;
+
+PluginConfigInterfaceExtension::PluginConfigInterfaceExtension()
+{
+ globalPluginConfigInterfaceExtensionNumber++;
+ myPluginConfigInterfaceExtensionNumber = globalPluginConfigInterfaceExtensionNumber++;
+
+ d = new PrivatePluginConfigInterfaceExtension();
+}
+
+PluginConfigInterfaceExtension::~PluginConfigInterfaceExtension()
+{
+ delete d;
+}
+
+unsigned int PluginConfigInterfaceExtension::pluginConfigInterfaceExtensionNumber () const
+{
+ return myPluginConfigInterfaceExtensionNumber;
+}
+
+PluginConfigInterfaceExtension *Kate::pluginConfigInterfaceExtension (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<PluginConfigInterfaceExtension*>(plugin->tqt_cast("Kate::PluginConfigInterfaceExtension"));
+}
diff --git a/kate/interfaces/pluginconfiginterfaceextension.h b/kate/interfaces/pluginconfiginterfaceextension.h
new file mode 100644
index 000000000..8a64ec090
--- /dev/null
+++ b/kate/interfaces/pluginconfiginterfaceextension.h
@@ -0,0 +1,104 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kate_pluginconfiginterfaceextension_h__
+#define __kate_pluginconfiginterfaceextension_h__
+
+#include <tqwidget.h>
+#include <tqpixmap.h>
+#include <kicontheme.h>
+
+namespace Kate
+{
+
+class KDE_EXPORT PluginConfigPage : public TQWidget
+{
+ Q_OBJECT
+
+ public:
+ PluginConfigPage ( TQWidget *parent=0, const char *name=0 );
+ virtual ~PluginConfigPage ();
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ Applies the changes to the document
+ */
+ virtual void apply () = 0;
+
+ /**
+ Reset the changes
+ */
+ virtual void reset () = 0;
+
+ /**
+ Sets default options
+ */
+ virtual void defaults () = 0;
+
+ signals:
+ void changed();
+};
+
+/*
+* This is an interface for the KTextEditor::Document/Plugin/ViewPlugin classes !!!
+*/
+class KDE_EXPORT PluginConfigInterfaceExtension
+{
+ friend class PrivatePluginConfigInterfaceExtension;
+
+ public:
+ PluginConfigInterfaceExtension();
+ virtual ~PluginConfigInterfaceExtension();
+
+ unsigned int pluginConfigInterfaceExtensionNumber () const;
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ Number of available config pages
+ */
+ virtual uint configPages () const = 0;
+
+ /**
+ returns config page with the given number,
+ config pages from 0 to configPages()-1 are available
+ if configPages() > 0
+ */
+ virtual PluginConfigPage *configPage (uint number = 0, TQWidget *parent = 0, const char *name=0 ) = 0;
+
+ virtual TQString configPageName (uint number = 0) const = 0;
+ virtual TQString configPageFullName (uint number = 0) const = 0;
+ virtual TQPixmap configPagePixmap (uint number = 0, int size = TDEIcon::SizeSmall) const = 0;
+
+ private:
+ class PrivatePluginConfigInterfaceExtension *d;
+ static unsigned int globalPluginConfigInterfaceExtensionNumber;
+ unsigned int myPluginConfigInterfaceExtensionNumber;
+};
+
+class Plugin;
+KDE_EXPORT PluginConfigInterfaceExtension *pluginConfigInterfaceExtension (Plugin *plugin);
+
+}
+
+#endif
diff --git a/kate/interfaces/pluginmanager.cpp b/kate/interfaces/pluginmanager.cpp
new file mode 100644
index 000000000..8d4f13f7c
--- /dev/null
+++ b/kate/interfaces/pluginmanager.cpp
@@ -0,0 +1,78 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "pluginmanager.moc"
+
+#include "plugin.h"
+#include "documentmanager.h"
+#include "toolviewmanager.h"
+#include "pluginmanager.h"
+
+#include "../app/katepluginmanager.h"
+#include "../app/kateapp.h"
+
+namespace Kate
+{
+
+class PrivatePluginManager
+ {
+ public:
+ PrivatePluginManager ()
+ {
+ }
+
+ ~PrivatePluginManager ()
+ {
+ }
+
+ KatePluginManager *pluginMan;
+ };
+
+PluginManager::PluginManager (void *pluginManager) : TQObject ((KatePluginManager*) pluginManager)
+{
+ d = new PrivatePluginManager ();
+ d->pluginMan = (KatePluginManager*) pluginManager;
+}
+
+PluginManager::~PluginManager ()
+{
+ delete d;
+}
+
+Plugin *PluginManager::plugin(const TQString &name)
+{
+ return d->pluginMan->plugin(name);
+}
+
+bool PluginManager::pluginAvailable(const TQString &name)
+{
+ return d->pluginMan->pluginAvailable (name);
+}
+
+Plugin *PluginManager::loadPlugin(const TQString &name,bool permanent)
+{
+ return d->pluginMan->loadPlugin (name, permanent);
+}
+
+void PluginManager::unloadPlugin(const TQString &name,bool permanent)
+{
+ d->pluginMan->unloadPlugin (name, permanent);
+}
+
+}
+
diff --git a/kate/interfaces/pluginmanager.h b/kate/interfaces/pluginmanager.h
new file mode 100644
index 000000000..0aeb7785e
--- /dev/null
+++ b/kate/interfaces/pluginmanager.h
@@ -0,0 +1,70 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+ Copyright (C) 2002 Joseph Wenninger <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_PLUGINMANAGER_INCLUDE_
+#define _KATE_PLUGINMANAGER_INCLUDE_
+
+#include <tqobject.h>
+#include <kurl.h>
+
+namespace Kate
+{
+/** This interface provides access to the Kate Plugin Manager.
+*/
+class KDE_EXPORT PluginManager : public TQObject
+{
+ friend class PrivatePluginManager;
+
+ Q_OBJECT
+
+ public:
+ PluginManager ( void *pluginManager );
+ virtual ~PluginManager ();
+
+ public:
+ /** if the plugin with the library name "name" is loaded, a pointer to that plugin is returned */
+ class Plugin *plugin(const TQString &name);
+
+ /** return true, if plugin is known to kate (either loaded or not loaded)
+ *
+ * This method is not used yet
+ */
+ bool pluginAvailable(const TQString &name);
+
+ /** tries loading the specified plugin and returns a pointer to the new plugin or 0
+ * if permanent is true (default value) the plugin will be loaded at the next kate startup
+ *
+ * This method is not used yet
+ */
+ class Plugin *loadPlugin(const TQString &name,bool permanent=true);
+
+ /** unload the specified plugin. If the value permanent is true (default value), the plugin will not be
+ * loaded on kate's next startup. Even if it had been loaded with permanent=true.
+ *
+ * This method is not used yet
+ */
+ void unloadPlugin(const TQString &name,bool permanent=true);
+
+ private:
+ class PrivatePluginManager *d;
+};
+
+}
+
+#endif
diff --git a/kate/interfaces/toolviewmanager.cpp b/kate/interfaces/toolviewmanager.cpp
new file mode 100644
index 000000000..1447cde84
--- /dev/null
+++ b/kate/interfaces/toolviewmanager.cpp
@@ -0,0 +1,85 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Joseph Wenninger <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "toolviewmanager.h"
+#include "toolviewmanager.moc"
+
+#include "plugin.h"
+#include "documentmanager.h"
+#include "pluginmanager.h"
+
+#include "../app/katemainwindow.h"
+
+namespace Kate
+{
+
+class PrivateToolViewManager
+ {
+ public:
+ PrivateToolViewManager ()
+ {
+ }
+
+ ~PrivateToolViewManager ()
+ {
+ }
+
+ KateMainWindow *toolViewMan;
+ };
+
+ToolViewManager::ToolViewManager (void *toolViewManager) : TQObject ((KateMainWindow*) toolViewManager)
+{
+ d = new PrivateToolViewManager ();
+ d->toolViewMan = (KateMainWindow*) toolViewManager;
+}
+
+ToolViewManager::~ToolViewManager ()
+{
+ delete d;
+}
+
+TQWidget *ToolViewManager::createToolView (const TQString &identifier, ToolViewManager::Position pos, const TQPixmap &icon, const TQString &text)
+{
+ return d->toolViewMan->createToolView (identifier, (KMultiTabBar::KMultiTabBarPosition)pos, icon, text);
+}
+
+bool ToolViewManager::moveToolView (TQWidget *widget, ToolViewManager::Position pos)
+{
+ if (!widget || !widget->tqt_cast("KateMDI::ToolView"))
+ return false;
+
+ return d->toolViewMan->moveToolView (static_cast<KateMDI::ToolView*>(widget), (KMultiTabBar::KMultiTabBarPosition)pos);
+}
+
+bool ToolViewManager::showToolView(TQWidget *widget)
+{
+ if (!widget || !widget->tqt_cast("KateMDI::ToolView"))
+ return false;
+
+ return d->toolViewMan->showToolView (static_cast<KateMDI::ToolView*>(widget));
+}
+
+bool ToolViewManager::hideToolView(TQWidget *widget)
+{
+ if (!widget || !widget->tqt_cast("KateMDI::ToolView"))
+ return false;
+
+ return d->toolViewMan->hideToolView (static_cast<KateMDI::ToolView*>(widget));
+}
+
+}
diff --git a/kate/interfaces/toolviewmanager.h b/kate/interfaces/toolviewmanager.h
new file mode 100644
index 000000000..88a669476
--- /dev/null
+++ b/kate/interfaces/toolviewmanager.h
@@ -0,0 +1,96 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Joseph Wenninger <[email protected]>
+ Copyright (C) 2002 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_TOOLVIEWMANAGER_INCLUDE_
+#define _KATE_TOOLVIEWMANAGER_INCLUDE_
+
+#include <tqwidget.h>
+#include <kurl.h>
+
+namespace Kate
+{
+
+/**
+ Interface to the toolviewmanager
+ */
+class KDE_EXPORT ToolViewManager : public TQObject
+{
+ friend class PrivateToolViewManager;
+
+ Q_OBJECT
+
+ public:
+ /**
+ * Construtor, should not interest, internal usage
+ */
+ ToolViewManager (void *toolViewManager);
+
+ /**
+ * Desctructor
+ */
+ virtual ~ToolViewManager ();
+
+ public:
+ /**
+ * positions
+ */
+ enum Position {Left, Right, Top, Bottom};
+
+ /**
+ * add a given widget to the given sidebar if possible, name is very important
+ * @param identifier unique identifier for this toolview
+ * @param pos position for the toolview, if we are in session restore, this is only a preference
+ * @param icon icon to use for the toolview
+ * @param text text to use in addition to icon
+ * @return created toolview on success or 0
+ */
+ TQWidget *createToolView (const TQString &identifier, ToolViewManager::Position pos, const TQPixmap &icon, const TQString &text);
+
+ /**
+ * Move the toolview
+ * @param widget to show, widget given must be widget constructed by createToolView
+ * @param pos position to move widget to
+ * @return bool success
+ */
+ bool moveToolView (TQWidget *widget, ToolViewManager::Position pos);
+
+ /**
+ * Show the toolview
+ * @param widget to show, widget given must be widget constructed by createToolView
+ * @return bool success
+ */
+ bool showToolView (TQWidget *widget);
+
+ /**
+ * Hide the toolview
+ * @param widget to hide, widget given must be widget constructed by createToolView
+ * @return bool success
+ */
+ bool hideToolView (TQWidget *widget);
+
+ private:
+ /**
+ * REALLY PRIVATE ;)
+ */
+ class PrivateToolViewManager *d;
+};
+
+}
+
+#endif
diff --git a/kate/interfaces/viewmanager.cpp b/kate/interfaces/viewmanager.cpp
new file mode 100644
index 000000000..d365f514e
--- /dev/null
+++ b/kate/interfaces/viewmanager.cpp
@@ -0,0 +1,73 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "viewmanager.h"
+#include "viewmanager.moc"
+
+#include "plugin.h"
+#include "documentmanager.h"
+#include "toolviewmanager.h"
+#include "pluginmanager.h"
+
+#include "../app/kateviewmanager.h"
+
+namespace Kate
+{
+
+class PrivateViewManager
+ {
+ public:
+ PrivateViewManager ()
+ {
+ }
+
+ ~PrivateViewManager ()
+ {
+ }
+
+ KateViewManager *viewMan;
+ };
+
+ViewManager::ViewManager (void *viewManager) : TQObject ((KateViewManager*) viewManager)
+{
+ d = new PrivateViewManager ();
+ d->viewMan = (KateViewManager*) viewManager;
+}
+
+ViewManager::~ViewManager ()
+{
+ delete d;
+}
+
+View *ViewManager::activeView()
+{
+ return d->viewMan->activeView();
+}
+
+void ViewManager::activateView ( uint documentNumber )
+{
+ d->viewMan->activateView( documentNumber );
+}
+
+void ViewManager::openURL (const KURL &url)
+{
+ d->viewMan->openURL (url, TQString::null, true);
+}
+
+}
+
diff --git a/kate/interfaces/viewmanager.h b/kate/interfaces/viewmanager.h
new file mode 100644
index 000000000..15eb61312
--- /dev/null
+++ b/kate/interfaces/viewmanager.h
@@ -0,0 +1,89 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_VIEWMANAGER_INCLUDE_
+#define _KATE_VIEWMANAGER_INCLUDE_
+
+#include <tqobject.h>
+#include <kurl.h>
+
+namespace Kate
+{
+
+class View;
+
+/**
+ * Interface to the viewmanager
+ */
+class KDE_EXPORT ViewManager : public TQObject
+{
+ friend class PrivateViewManager;
+
+ Q_OBJECT
+
+ public:
+ /**
+ * Construtor, should not interest, internal usage
+ */
+ ViewManager (void *viewManager);
+
+ /**
+ * Desctructor
+ */
+ virtual ~ViewManager ();
+
+ public slots: /*these are slots for kjs*/
+ /**
+ * Returns a pointer to the currently active view
+ * @return View active view
+ */
+ Kate::View *activeView ();
+
+ /**
+ * Activates the view with the corresponding documentNumber
+ * @param documentNumber the document's number
+ */
+ void activateView ( uint documentNumber );
+
+ /**
+ * Opens the file pointed to by URL
+ * @param url url to the file
+ */
+ void openURL (const KURL &url);
+
+ #undef signals
+ #define signals public
+ signals:
+ #undef signals
+ #define signals protected
+
+ /**
+ * Active view has changed
+ */
+ void viewChanged ();
+
+ private:
+ /**
+ * REALLY PRIVATE ;)
+ */
+ class PrivateViewManager *d;
+};
+
+}
+
+#endif