summaryrefslogtreecommitdiffstats
path: root/interfaces/ktexteditor
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces/ktexteditor')
-rw-r--r--interfaces/ktexteditor/.kateconfig1
-rw-r--r--interfaces/ktexteditor/Makefile.am52
-rw-r--r--interfaces/ktexteditor/blockselectiondcopinterface.cpp33
-rw-r--r--interfaces/ktexteditor/blockselectiondcopinterface.h60
-rw-r--r--interfaces/ktexteditor/blockselectioninterface.cpp74
-rw-r--r--interfaces/ktexteditor/blockselectioninterface.h82
-rw-r--r--interfaces/ktexteditor/clipboarddcopinterface.cpp40
-rw-r--r--interfaces/ktexteditor/clipboarddcopinterface.h54
-rw-r--r--interfaces/ktexteditor/clipboardinterface.cpp56
-rw-r--r--interfaces/ktexteditor/clipboardinterface.h74
-rw-r--r--interfaces/ktexteditor/codecompletioninterface.cpp51
-rw-r--r--interfaces/ktexteditor/codecompletioninterface.h202
-rw-r--r--interfaces/ktexteditor/configinterface.cpp79
-rw-r--r--interfaces/ktexteditor/configinterface.h93
-rw-r--r--interfaces/ktexteditor/configinterfaceextension.cpp84
-rw-r--r--interfaces/ktexteditor/configinterfaceextension.h116
-rw-r--r--interfaces/ktexteditor/cursorinterface.cpp69
-rw-r--r--interfaces/ktexteditor/cursorinterface.h84
-rw-r--r--interfaces/ktexteditor/document.h73
-rw-r--r--interfaces/ktexteditor/documentdcopinfo.cpp33
-rw-r--r--interfaces/ktexteditor/documentdcopinfo.h47
-rw-r--r--interfaces/ktexteditor/documentinfo.cpp65
-rw-r--r--interfaces/ktexteditor/documentinfo.h60
-rw-r--r--interfaces/ktexteditor/dynwordwrapinterface.cpp69
-rw-r--r--interfaces/ktexteditor/dynwordwrapinterface.h64
-rw-r--r--interfaces/ktexteditor/editdcopinterface.cpp61
-rw-r--r--interfaces/ktexteditor/editdcopinterface.h90
-rw-r--r--interfaces/ktexteditor/editinterface.cpp57
-rw-r--r--interfaces/ktexteditor/editinterface.h137
-rw-r--r--interfaces/ktexteditor/editinterfaceext.cpp50
-rw-r--r--interfaces/ktexteditor/editinterfaceext.h74
-rw-r--r--interfaces/ktexteditor/editor.h64
-rw-r--r--interfaces/ktexteditor/editorchooser.cpp162
-rw-r--r--interfaces/ktexteditor/editorchooser.h58
-rw-r--r--interfaces/ktexteditor/editorchooser_ui.ui64
-rw-r--r--interfaces/ktexteditor/encodingdcopinterface.cpp28
-rw-r--r--interfaces/ktexteditor/encodingdcopinterface.h46
-rw-r--r--interfaces/ktexteditor/encodinginterface.cpp76
-rw-r--r--interfaces/ktexteditor/encodinginterface.h63
-rw-r--r--interfaces/ktexteditor/highlightinginterface.cpp69
-rw-r--r--interfaces/ktexteditor/highlightinginterface.h92
-rw-r--r--interfaces/ktexteditor/kcm_ktexteditor.desktop172
-rw-r--r--interfaces/ktexteditor/ktexteditor.cpp231
-rw-r--r--interfaces/ktexteditor/ktexteditor.desktop86
-rw-r--r--interfaces/ktexteditor/ktexteditoreditor.desktop86
-rw-r--r--interfaces/ktexteditor/ktexteditorplugin.desktop87
-rw-r--r--interfaces/ktexteditor/markinterface.cpp74
-rw-r--r--interfaces/ktexteditor/markinterface.h171
-rw-r--r--interfaces/ktexteditor/markinterfaceextension.cpp69
-rw-r--r--interfaces/ktexteditor/markinterfaceextension.h83
-rw-r--r--interfaces/ktexteditor/plugin.h88
-rw-r--r--interfaces/ktexteditor/popupmenuinterface.cpp69
-rw-r--r--interfaces/ktexteditor/popupmenuinterface.h66
-rw-r--r--interfaces/ktexteditor/printdcopinterface.cpp30
-rw-r--r--interfaces/ktexteditor/printdcopinterface.h46
-rw-r--r--interfaces/ktexteditor/printinterface.cpp74
-rw-r--r--interfaces/ktexteditor/printinterface.h63
-rw-r--r--interfaces/ktexteditor/searchdcopinterface.cpp95
-rw-r--r--interfaces/ktexteditor/searchdcopinterface.h59
-rw-r--r--interfaces/ktexteditor/searchinterface.cpp55
-rw-r--r--interfaces/ktexteditor/searchinterface.h65
-rw-r--r--interfaces/ktexteditor/selectiondcopinterface.cpp64
-rw-r--r--interfaces/ktexteditor/selectiondcopinterface.h72
-rw-r--r--interfaces/ktexteditor/selectionextdcopinterface.h57
-rw-r--r--interfaces/ktexteditor/selectioninterface.cpp65
-rw-r--r--interfaces/ktexteditor/selectioninterface.h100
-rw-r--r--interfaces/ktexteditor/selectioninterfaceext.cpp115
-rw-r--r--interfaces/ktexteditor/selectioninterfaceext.h74
-rw-r--r--interfaces/ktexteditor/sessionconfiginterface.cpp88
-rw-r--r--interfaces/ktexteditor/sessionconfiginterface.h71
-rw-r--r--interfaces/ktexteditor/templateinterface.cpp197
-rw-r--r--interfaces/ktexteditor/templateinterface.h131
-rw-r--r--interfaces/ktexteditor/texthintinterface.cpp66
-rw-r--r--interfaces/ktexteditor/texthintinterface.h79
-rw-r--r--interfaces/ktexteditor/undodcopinterface.cpp57
-rw-r--r--interfaces/ktexteditor/undodcopinterface.h54
-rw-r--r--interfaces/ktexteditor/undointerface.cpp74
-rw-r--r--interfaces/ktexteditor/undointerface.h84
-rw-r--r--interfaces/ktexteditor/variableinterface.cpp48
-rw-r--r--interfaces/ktexteditor/variableinterface.h72
-rw-r--r--interfaces/ktexteditor/view.h68
-rw-r--r--interfaces/ktexteditor/viewcursordcopinterface.cpp68
-rw-r--r--interfaces/ktexteditor/viewcursordcopinterface.h74
-rw-r--r--interfaces/ktexteditor/viewcursorinterface.cpp74
-rw-r--r--interfaces/ktexteditor/viewcursorinterface.h95
-rw-r--r--interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp29
-rw-r--r--interfaces/ktexteditor/viewstatusmsgdcopinterface.h45
-rw-r--r--interfaces/ktexteditor/viewstatusmsginterface.cpp76
-rw-r--r--interfaces/ktexteditor/viewstatusmsginterface.h63
-rw-r--r--interfaces/ktexteditor/wordwrapinterface.cpp70
-rw-r--r--interfaces/ktexteditor/wordwrapinterface.h66
91 files changed, 6971 insertions, 0 deletions
diff --git a/interfaces/ktexteditor/.kateconfig b/interfaces/ktexteditor/.kateconfig
new file mode 100644
index 000000000..5b0885abe
--- /dev/null
+++ b/interfaces/ktexteditor/.kateconfig
@@ -0,0 +1 @@
+kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/interfaces/ktexteditor/Makefile.am b/interfaces/ktexteditor/Makefile.am
new file mode 100644
index 000000000..5a173b447
--- /dev/null
+++ b/interfaces/ktexteditor/Makefile.am
@@ -0,0 +1,52 @@
+INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(top_srcdir)/interfaces -I$(top_builddir)/interfaces -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes)
+
+lib_LTLIBRARIES = libktexteditor.la
+
+libktexteditor_la_SOURCES = ktexteditor.cpp \
+ editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp \
+ codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp \
+ configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp \
+ printinterface.cpp highlightinginterface.cpp markinterface.cpp \
+ popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp \
+ editdcopinterface.cpp editdcopinterface.skel clipboarddcopinterface.cpp \
+ clipboarddcopinterface.skel selectiondcopinterface.cpp selectiondcopinterface.skel \
+ searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp \
+ configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp \
+ viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp \
+ blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp\
+ blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp \
+ encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel \
+ undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp \
+ viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp \
+ viewstatusmsgdcopinterface.skel selectioninterfaceext.cpp selectionextdcopinterface.skel \
+ texthintinterface.cpp editinterfaceext.cpp variableinterface.cpp templateinterface.cpp
+
+
+libktexteditor_la_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+libktexteditor_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/dcop/libDCOP.la $(top_builddir)/kabc/libkabc.la
+
+ktexteditorinclude_HEADERS = document.h view.h editor.h plugin.h editinterface.h undointerface.h \
+ selectioninterface.h cursorinterface.h \
+ clipboardinterface.h popupmenuinterface.h \
+ viewcursorinterface.h searchinterface.h highlightinginterface.h \
+ blockselectioninterface.h codecompletioninterface.h \
+ configinterface.h markinterface.h printinterface.h wordwrapinterface.h \
+ dynwordwrapinterface.h markinterfaceextension.h configinterfaceextension.h \
+ encodinginterface.h viewstatusmsginterface.h sessionconfiginterface.h editorchooser.h \
+ documentinfo.h selectioninterfaceext.h selectionextdcopinterface.h texthintinterface.h \
+ editinterfaceext.h variableinterface.h templateinterface.h
+
+ktexteditorincludedir = $(includedir)/ktexteditor
+
+METASOURCES = AUTO
+
+servicetypedir = $(kde_servicetypesdir)
+servicetype_DATA = ktexteditor.desktop ktexteditoreditor.desktop ktexteditorplugin.desktop
+
+kcm_ktexteditor_DATA = kcm_ktexteditor.desktop
+kcm_ktexteditordir = $(kde_datadir)/kcm_componentchooser
+
+templateinterface.lo: $(top_builddir)/kabc/addressee.h
+
+include ../../admin/Doxyfile.am
+
diff --git a/interfaces/ktexteditor/blockselectiondcopinterface.cpp b/interfaces/ktexteditor/blockselectiondcopinterface.cpp
new file mode 100644
index 000000000..34b7294b2
--- /dev/null
+++ b/interfaces/ktexteditor/blockselectiondcopinterface.cpp
@@ -0,0 +1,33 @@
+#include "blockselectiondcopinterface.h"
+#include "blockselectioninterface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+BlockSelectionDCOPInterface::BlockSelectionDCOPInterface( BlockSelectionInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+BlockSelectionDCOPInterface::~BlockSelectionDCOPInterface()
+{
+
+}
+
+uint BlockSelectionDCOPInterface::blockSelectionInterfaceNumber ()
+{
+ return m_parent->blockSelectionInterfaceNumber();
+}
+bool BlockSelectionDCOPInterface::blockSelectionMode ()
+{
+ return m_parent->blockSelectionMode ();
+}
+bool BlockSelectionDCOPInterface::setBlockSelectionMode (bool on)
+{
+ return m_parent->setBlockSelectionMode (on);
+}
+bool BlockSelectionDCOPInterface::toggleBlockSelectionMode ()
+{
+ return m_parent->toggleBlockSelectionMode ();
+}
diff --git a/interfaces/ktexteditor/blockselectiondcopinterface.h b/interfaces/ktexteditor/blockselectiondcopinterface.h
new file mode 100644
index 000000000..19fc950cb
--- /dev/null
+++ b/interfaces/ktexteditor/blockselectiondcopinterface.h
@@ -0,0 +1,60 @@
+#ifndef BlockSelection_DCOP_INTERFACE_H
+#define BlockSelection_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+
+namespace KTextEditor
+{
+ class BlockSelectionInterface;
+ /**
+ This is the main interface to the BlockSelectionInterface of KTextEditor.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to BlockSelectionInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT BlockSelectionDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent BlockSelectionInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ BlockSelectionDCOPInterface( BlockSelectionInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~BlockSelectionDCOPInterface();
+ k_dcop:
+ uint blockSelectionInterfaceNumber ();
+
+ /**
+ * Returns the status of the selection mode - true indicates block selection mode is on.
+ * If this is true, selections applied via the SelectionInterface are handled as
+ * blockselections and the paste functions of the ClipboardInterface works on
+ * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;)
+ */
+ bool blockSelectionMode ();
+
+ /**
+ * set blockselection mode to state "on"
+ */
+ bool setBlockSelectionMode (bool on) ;
+
+ /**
+ * toggle blockseletion mode
+ */
+ bool toggleBlockSelectionMode ();
+
+ private:
+ BlockSelectionInterface *m_parent;
+ };
+}
+#endif
diff --git a/interfaces/ktexteditor/blockselectioninterface.cpp b/interfaces/ktexteditor/blockselectioninterface.cpp
new file mode 100644
index 000000000..80e0c8570
--- /dev/null
+++ b/interfaces/ktexteditor/blockselectioninterface.cpp
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "blockselectioninterface.h"
+#include "blockselectiondcopinterface.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivateBlockSelectionInterface
+{
+ public:
+ PrivateBlockSelectionInterface() {interface = 0;}
+ ~PrivateBlockSelectionInterface() {}
+ BlockSelectionDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int BlockSelectionInterface::globalBlockSelectionInterfaceNumber = 0;
+
+BlockSelectionInterface::BlockSelectionInterface()
+{
+ globalBlockSelectionInterfaceNumber++;
+ myBlockSelectionInterfaceNumber = globalBlockSelectionInterfaceNumber++;
+ QString name = "BlockSelectionInterface#" + QString::number(myBlockSelectionInterfaceNumber);
+
+ d = new PrivateBlockSelectionInterface();
+ d->interface = new BlockSelectionDCOPInterface(this, name.latin1());
+}
+
+BlockSelectionInterface::~BlockSelectionInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int BlockSelectionInterface::blockSelectionInterfaceNumber () const
+{
+ return myBlockSelectionInterfaceNumber;
+}
+
+void BlockSelectionInterface::setBlockSelectionInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("BlockSelectionInterface#"+suffix);
+}
+
+BlockSelectionInterface *KTextEditor::blockSelectionInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<BlockSelectionInterface*>(doc->qt_cast("KTextEditor::BlockSelectionInterface"));
+}
diff --git a/interfaces/ktexteditor/blockselectioninterface.h b/interfaces/ktexteditor/blockselectioninterface.h
new file mode 100644
index 000000000..d5104208c
--- /dev/null
+++ b/interfaces/ktexteditor/blockselectioninterface.h
@@ -0,0 +1,82 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_blockselectioninterface_h__
+#define __ktexteditor_blockselectioninterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+ * An interface for the Document class which allows the selection
+ * method to be changed between selecting rectangular blocks of text and normal mode
+ * (all text between the start cursor and the current cursor).
+ */
+class KTEXTEDITOR_EXPORT BlockSelectionInterface
+{
+ friend class PrivateBlockSelectionInterface;
+
+ public:
+ BlockSelectionInterface ();
+ virtual ~BlockSelectionInterface ();
+
+ unsigned int blockSelectionInterfaceNumber () const;
+
+ protected:
+ void setBlockSelectionInterfaceDCOPSuffix (const QCString &suffix);
+
+ /**
+ * slots !!!
+ */
+ public:
+ /**
+ * Returns the status of the selection mode - true indicates block selection mode is on.
+ * If this is true, selections applied via the SelectionInterface are handled as
+ * blockselections and the paste functions of the ClipboardInterface works on
+ * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;)
+ */
+ virtual bool blockSelectionMode () = 0;
+
+ /**
+ * Set block selection mode to state "on"
+ */
+ virtual bool setBlockSelectionMode (bool on) = 0;
+
+ /**
+ * toggle block seletion mode
+ */
+ virtual bool toggleBlockSelectionMode () = 0;
+
+ private:
+ class PrivateBlockSelectionInterface *d;
+ static unsigned int globalBlockSelectionInterfaceNumber;
+ unsigned int myBlockSelectionInterfaceNumber;
+};
+
+/**
+ * Access the block selection interface of document @param doc
+ */
+KTEXTEDITOR_EXPORT BlockSelectionInterface *blockSelectionInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/clipboarddcopinterface.cpp b/interfaces/ktexteditor/clipboarddcopinterface.cpp
new file mode 100644
index 000000000..334046ee5
--- /dev/null
+++ b/interfaces/ktexteditor/clipboarddcopinterface.cpp
@@ -0,0 +1,40 @@
+#include "clipboarddcopinterface.h"
+#include "clipboardinterface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+ClipboardDCOPInterface::ClipboardDCOPInterface( ClipboardInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+ClipboardDCOPInterface::~ClipboardDCOPInterface()
+{
+
+}
+
+ /**
+ * Copies selected text.
+ */
+ void ClipboardDCOPInterface::copy ( )
+ {
+ m_parent->copy();
+ }
+
+ /**
+ * Cuts selected text.
+ */
+ void ClipboardDCOPInterface::cut ( )
+ {
+ m_parent->cut();
+ }
+
+ /**
+ * Pastes text from clipboard.
+ */
+ void ClipboardDCOPInterface::paste ( )
+ {
+ m_parent->paste();
+ }
diff --git a/interfaces/ktexteditor/clipboarddcopinterface.h b/interfaces/ktexteditor/clipboarddcopinterface.h
new file mode 100644
index 000000000..fe4c3d3c7
--- /dev/null
+++ b/interfaces/ktexteditor/clipboarddcopinterface.h
@@ -0,0 +1,54 @@
+#ifndef Clipboard_DCOP_INTERFACE_H
+#define Clipboard_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+
+namespace KTextEditor
+{
+ class ClipboardInterface;
+ /**
+ This is the main interface to the ClipboardInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to ClipboardInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT ClipboardDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent ClipboardInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ ClipboardDCOPInterface( ClipboardInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~ClipboardDCOPInterface();
+ k_dcop:
+ /**
+ * copies selected text
+ */
+ void copy ( );
+ /**
+ * cuts selected text
+ */
+ void cut ( );
+ /**
+ * pastes selected text
+ */
+ void paste ( );
+ private:
+ ClipboardInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/clipboardinterface.cpp b/interfaces/ktexteditor/clipboardinterface.cpp
new file mode 100644
index 000000000..5d267841a
--- /dev/null
+++ b/interfaces/ktexteditor/clipboardinterface.cpp
@@ -0,0 +1,56 @@
+#include "clipboardinterface.h"
+#include "clipboarddcopinterface.h"
+
+#include "view.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateClipboardInterface
+ {
+ public:
+ PrivateClipboardInterface()
+ {
+ interface = 0;
+ }
+ ~PrivateClipboardInterface(){}
+ // Data Members
+ ClipboardDCOPInterface *interface;
+ };
+
+}
+
+unsigned int ClipboardInterface::globalClipboardInterfaceNumber = 0;
+
+ClipboardInterface::ClipboardInterface()
+{
+ d = new PrivateClipboardInterface();
+ globalClipboardInterfaceNumber++;
+ myClipboardInterfaceNumber = globalClipboardInterfaceNumber++;
+ QString name = "ClipboardInterface#" + QString::number(myClipboardInterfaceNumber);
+ d->interface = new ClipboardDCOPInterface(this, name.latin1());
+}
+ClipboardInterface::~ClipboardInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int ClipboardInterface::clipboardInterfaceNumber () const
+{
+ return myClipboardInterfaceNumber;
+}
+
+void ClipboardInterface::setClipboardInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("ClipboardInterface#"+suffix);
+}
+
+ClipboardInterface *KTextEditor::clipboardInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<ClipboardInterface*>(view->qt_cast("KTextEditor::ClipboardInterface"));
+}
diff --git a/interfaces/ktexteditor/clipboardinterface.h b/interfaces/ktexteditor/clipboardinterface.h
new file mode 100644
index 000000000..c55df503e
--- /dev/null
+++ b/interfaces/ktexteditor/clipboardinterface.h
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_clipboardinterface_h__
+#define __ktexteditor_clipboardinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface for accessing the clipboard through the View class.
+*/
+class KTEXTEDITOR_EXPORT ClipboardInterface
+{
+ friend class PrivateClipboardInterface;
+
+ public:
+ ClipboardInterface();
+ virtual ~ClipboardInterface();
+
+ unsigned int clipboardInterfaceNumber () const;
+
+ protected:
+ void setClipboardInterfaceDCOPSuffix (const QCString &suffix);
+
+ /**
+ * slots !!!
+ */
+ public:
+ /**
+ * copies selected text
+ */
+ virtual void copy ( ) const = 0;
+
+ /**
+ * copies selected text
+ */
+ virtual void cut ( ) = 0;
+
+ /**
+ * copies selected text
+ */
+ virtual void paste ( ) = 0;
+
+ private:
+ class PrivateClipboardInterface *d;
+ static unsigned int globalClipboardInterfaceNumber;
+ unsigned int myClipboardInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT ClipboardInterface *clipboardInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/codecompletioninterface.cpp b/interfaces/ktexteditor/codecompletioninterface.cpp
new file mode 100644
index 000000000..51250d2d6
--- /dev/null
+++ b/interfaces/ktexteditor/codecompletioninterface.cpp
@@ -0,0 +1,51 @@
+
+#include "codecompletioninterface.h"
+#include "view.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateCodeCompletionInterface
+ {
+ public:
+ PrivateCodeCompletionInterface() {}
+ ~PrivateCodeCompletionInterface(){}
+
+ };
+}
+
+unsigned int CodeCompletionInterface::globalCodeCompletionInterfaceNumber = 0;
+
+CodeCompletionInterface::CodeCompletionInterface()
+{
+ globalCodeCompletionInterfaceNumber++;
+ myCodeCompletionInterfaceNumber = globalCodeCompletionInterfaceNumber++;
+
+ d = new PrivateCodeCompletionInterface();
+}
+
+CodeCompletionInterface::~CodeCompletionInterface()
+{
+ delete d;
+}
+
+unsigned int CodeCompletionInterface::codeCompletionInterfaceNumber () const
+{
+ return myCodeCompletionInterfaceNumber;
+}
+
+void CodeCompletionInterface::setCodeCompletionInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("CodeCompletionInterface#"+suffix);
+}
+
+CodeCompletionInterface *KTextEditor::codeCompletionInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<CodeCompletionInterface*>(view->qt_cast("KTextEditor::CodeCompletionInterface"));
+}
+
+
diff --git a/interfaces/ktexteditor/codecompletioninterface.h b/interfaces/ktexteditor/codecompletioninterface.h
new file mode 100644
index 000000000..d1174d32a
--- /dev/null
+++ b/interfaces/ktexteditor/codecompletioninterface.h
@@ -0,0 +1,202 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ 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 __ktexteditor_codecompletioninterface_h__
+#define __ktexteditor_codecompletioninterface_h__
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+ * An item for the completion popup. <code>text</code> is the completed string,
+ * <code>prefix</code> appears in front of it, <code>suffix</code> appears after it.
+ * <code>type</code> does not appear in the completion list.
+ * <code>prefix</code>, <code>suffix</code>, and <code>type</code> are not part of the
+ * inserted text if a completion takes place. <code>comment</code> appears in a tooltip right of
+ * the completion list for the currently selected item. <code>userdata</code> can be
+ * free formed data, which the user of this interface can use in
+ * CodeCompletionInterface::filterInsertString().
+ *
+ *
+ */
+class KTEXTEDITOR_EXPORT CompletionEntry
+{
+ public:
+ QString type;
+ QString text;
+ QString prefix;
+ QString postfix;
+ QString comment;
+
+ QString userdata;
+
+ bool operator==( const CompletionEntry &c ) const {
+ return ( c.type == type &&
+ c.text == text &&
+ c.postfix == postfix &&
+ c.prefix == prefix &&
+ c.comment == comment &&
+ c.userdata == userdata);
+ }
+};
+
+/**
+ * This is an interface for the KTextEditor::View class. It can be used
+ * to show completion lists, i.e. lists that pop up while a user is typing.
+ * The user can then choose from the list or he can just keep typing. The
+ * completion list will disappear if an item is chosen, if no completion
+ * is available or if the user presses Esc etc. The contents of the list
+ * is automatically adapted to the string the user types.
+ *
+ * There are other signals, which may be implmemented, but aren't documented here, because
+ * it would have been a BIC change...:
+ *
+ * void completionExtendedComment(CompletionEntry)
+ *
+ * This is emitted when the user has completed the argument entry (ie. enters the wrapping symbol(s)
+ * void argHintCompleted()
+ *
+ * This is emitted when there is a reason other than completion for the hint being hidden.
+ * void argHintAborted()
+ *
+ * This is emitted when a code completion box is about to be displayed
+ * void aboutToShowCompletionBox()
+ *
+ */
+class KTEXTEDITOR_EXPORT CodeCompletionInterface
+{
+ friend class PrivateCodeCompletionInterface;
+
+ public:
+ CodeCompletionInterface();
+ virtual ~CodeCompletionInterface();
+
+ unsigned int codeCompletionInterfaceNumber () const;
+
+ protected:
+ void setCodeCompletionInterfaceDCOPSuffix (const QCString &suffix);
+
+
+ public:
+ //
+ // slots !!!
+ //
+ /**
+ * This shows an argument hint.
+ */
+ virtual void showArgHint (QStringList functionList, const QString& strWrapping, const QString& strDelimiter) = 0;
+
+ /**
+ * This shows a completion list. @p offset is the real start of the text that
+ * should be completed. <code>0</code> means that the text starts at the current cursor
+ * position. if @p casesensitive is @p true, the popup will only contain completions
+ * that match the input text regarding case.
+ */
+ virtual void showCompletionBox (QValueList<CompletionEntry> complList,int offset=0, bool casesensitive=true)=0;
+
+ //
+ // signals !!!
+ //
+ public:
+
+
+ /**
+ * This signal is emitted when the completion list disappears and no completion has
+ * been done. This is the case e.g. when the user presses Escape.
+ *
+ * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback
+ * when the implementation doesn't support it
+ *
+ * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited
+ * function, if you support it, declare it as a signal
+ */
+ virtual void completionAborted()=0;
+
+ /**
+ * This signal is emitted when the completion list disappears and a completion has
+ * been inserted into text. This is the case e.g. when the user presses Return
+ * on a selected item in the completion list.
+ *
+ * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback
+ * when the implementation doesn't support it
+ *
+ * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited
+ * function, if you support it, declare it as a signal
+ */
+ virtual void completionDone()=0;
+
+ /**
+ * This signal is the same as completionDone(), but additionally it carries
+ * the information which completion item was used.
+ *
+ * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback
+ * when the implementation doesn't support it
+ *
+ * IMPORTANT: The pointer to the CompleteionEntry, is only valid in the slots connected to this signal
+ * when the connected slots are left, the data element may be destroyed, depending on the implementation
+ *
+ * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited
+ * function, if you support it, declare it as a signal.
+ *
+ */
+ virtual void completionDone(CompletionEntry)=0;
+
+ /**
+ * This signal is emitted when the argument hint disappears.
+ * This is the case e.g. when the user moves the cursor somewhere else.
+ *
+ * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback
+ * when the implementation doesn't support it
+ *
+ * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited
+ * function, if you support it, declare it as a signal
+ */
+ virtual void argHintHidden()=0;
+
+ /**
+ * This signal is emitted just before a completion takes place.
+ * You can use it to modify the CompletionEntry. The modified
+ * entry will not be visible in the completion list (because that has
+ * just disappeared) but it will be used when the completion is
+ * inserted into the text.
+ *
+ * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback
+ * when the implementation doesn't support it
+ *
+ * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited
+ * function, if you support it, declare it as a signal
+ */
+ virtual void filterInsertString(CompletionEntry*,QString*)=0;
+
+
+ private:
+ class PrivateCodeCompletionInterface *d;
+ static unsigned int globalCodeCompletionInterfaceNumber;
+ unsigned int myCodeCompletionInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT CodeCompletionInterface *codeCompletionInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/configinterface.cpp b/interfaces/ktexteditor/configinterface.cpp
new file mode 100644
index 000000000..39d2454ba
--- /dev/null
+++ b/interfaces/ktexteditor/configinterface.cpp
@@ -0,0 +1,79 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "configinterface.h"
+
+#include "document.h"
+#include "plugin.h"
+
+namespace KTextEditor
+{
+
+class PrivateConfigInterface
+{
+ public:
+ PrivateConfigInterface() {}
+ ~PrivateConfigInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int ConfigInterface::globalConfigInterfaceNumber = 0;
+
+ConfigInterface::ConfigInterface()
+{
+ globalConfigInterfaceNumber++;
+ myConfigInterfaceNumber = globalConfigInterfaceNumber++;
+
+ d = new PrivateConfigInterface();
+}
+
+ConfigInterface::~ConfigInterface()
+{
+ delete d;
+}
+
+unsigned int ConfigInterface::configInterfaceNumber () const
+{
+ return myConfigInterfaceNumber;
+}
+
+void ConfigInterface::setConfigInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("ConfigInterface#"+suffix);
+}
+
+ConfigInterface *KTextEditor::configInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<ConfigInterface*>(doc->qt_cast("KTextEditor::ConfigInterface"));
+}
+
+ConfigInterface *KTextEditor::configInterface (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<ConfigInterface*>(plugin->qt_cast("KTextEditor::ConfigInterface"));
+}
diff --git a/interfaces/ktexteditor/configinterface.h b/interfaces/ktexteditor/configinterface.h
new file mode 100644
index 000000000..f80603d01
--- /dev/null
+++ b/interfaces/ktexteditor/configinterface.h
@@ -0,0 +1,93 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_configinterface_h__
+#define __ktexteditor_configinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+class KConfig;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface for accessing the configuration of the
+* Document and Plugin classes.
+*/
+class KTEXTEDITOR_EXPORT ConfigInterface
+{
+ friend class PrivateConfigInterface;
+
+ public:
+ ConfigInterface();
+ virtual ~ConfigInterface();
+
+ unsigned int configInterfaceNumber () const;
+
+ protected:
+ void setConfigInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // 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, which means for all current open documents
+ */
+ virtual void readConfig () = 0;
+ virtual void writeConfig () = 0;
+
+ /**
+ Read/Write the config of the part to a given kconfig object
+ to store the settings in a different place than the standard
+ */
+ virtual void readConfig (KConfig *) = 0;
+ virtual void writeConfig (KConfig *) = 0;
+
+ /**
+ Read/Write session config of only this document/view/plugin
+ */
+ virtual void readSessionConfig (KConfig *) = 0;
+ virtual void writeSessionConfig (KConfig *) = 0;
+
+ /**
+ Shows a config dialog for the part, changes will be applied
+ to the part, but not saved anywhere automagically, call
+ writeConfig to save it
+ */
+ virtual void configDialog () = 0;
+
+ private:
+ class PrivateConfigInterface *d;
+ static unsigned int globalConfigInterfaceNumber;
+ unsigned int myConfigInterfaceNumber;
+};
+
+class Plugin;
+class Document;
+
+KTEXTEDITOR_EXPORT ConfigInterface *configInterface (Document *doc);
+KTEXTEDITOR_EXPORT ConfigInterface *configInterface (Plugin *plugin);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/configinterfaceextension.cpp b/interfaces/ktexteditor/configinterfaceextension.cpp
new file mode 100644
index 000000000..9f7456cbe
--- /dev/null
+++ b/interfaces/ktexteditor/configinterfaceextension.cpp
@@ -0,0 +1,84 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "configinterfaceextension.h"
+#include "configinterfaceextension.moc"
+
+#include "document.h"
+#include "plugin.h"
+
+namespace KTextEditor
+{
+
+class PrivateConfigInterfaceExtension
+{
+ public:
+ PrivateConfigInterfaceExtension() {}
+ ~PrivateConfigInterfaceExtension() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+ConfigPage::ConfigPage ( QWidget *parent, const char *name ) : QWidget (parent, name) { ; }
+
+ConfigPage::~ConfigPage () { ; }
+
+unsigned int ConfigInterfaceExtension::globalConfigInterfaceExtensionNumber = 0;
+
+ConfigInterfaceExtension::ConfigInterfaceExtension()
+{
+ globalConfigInterfaceExtensionNumber++;
+ myConfigInterfaceExtensionNumber = globalConfigInterfaceExtensionNumber++;
+
+ d = new PrivateConfigInterfaceExtension();
+}
+
+ConfigInterfaceExtension::~ConfigInterfaceExtension()
+{
+ delete d;
+}
+
+unsigned int ConfigInterfaceExtension::configInterfaceExtensionNumber () const
+{
+ return myConfigInterfaceExtensionNumber;
+}
+
+void ConfigInterfaceExtension::setConfigInterfaceExtensionDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("ConfigInterfaceExtension#"+suffix);
+}
+
+ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<ConfigInterfaceExtension*>(doc->qt_cast("KTextEditor::ConfigInterfaceExtension"));
+}
+
+ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<ConfigInterfaceExtension*>(plugin->qt_cast("KTextEditor::ConfigInterfaceExtension"));
+}
diff --git a/interfaces/ktexteditor/configinterfaceextension.h b/interfaces/ktexteditor/configinterfaceextension.h
new file mode 100644
index 000000000..abec0f0fe
--- /dev/null
+++ b/interfaces/ktexteditor/configinterfaceextension.h
@@ -0,0 +1,116 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_configinterfaceextension_h__
+#define __ktexteditor_configinterfaceextension_h__
+
+#include <qwidget.h>
+#include <qpixmap.h>
+#include <kicontheme.h>
+
+namespace KTextEditor
+{
+
+class KTEXTEDITOR_EXPORT ConfigPage : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ ConfigPage ( QWidget *parent=0, const char *name=0 );
+ virtual ~ConfigPage ();
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ Applies the changes to all documents
+ */
+ virtual void apply () = 0;
+
+ /**
+ Reset the changes
+ */
+ virtual void reset () = 0;
+
+ /**
+ Sets default options
+ */
+ virtual void defaults () = 0;
+
+ signals:
+ /**
+ Emitted when something changes
+ */
+ void changed();
+};
+
+/**
+* This is an interface to extend the configuration of the
+* Document, Plugin and PluginViewInterface classes.
+*/
+class KTEXTEDITOR_EXPORT ConfigInterfaceExtension
+{
+ friend class PrivateConfigInterfaceExtension;
+
+ public:
+ ConfigInterfaceExtension();
+ virtual ~ConfigInterfaceExtension();
+
+ unsigned int configInterfaceExtensionNumber () const;
+
+ protected:
+ void setConfigInterfaceExtensionDCOPSuffix (const QCString &suffix);
+
+ //
+ // 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 ConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name=0 ) = 0;
+
+ virtual QString configPageName (uint number = 0) const = 0;
+ virtual QString configPageFullName (uint number = 0) const = 0;
+ virtual QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const = 0;
+
+
+ private:
+ class PrivateConfigInterfaceExtension *d;
+ static unsigned int globalConfigInterfaceExtensionNumber;
+ unsigned int myConfigInterfaceExtensionNumber;
+};
+
+class Document;
+class Plugin;
+class ViewPlugin;
+
+KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Document *doc);
+KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Plugin *plugin);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/cursorinterface.cpp b/interfaces/ktexteditor/cursorinterface.cpp
new file mode 100644
index 000000000..9dec0de30
--- /dev/null
+++ b/interfaces/ktexteditor/cursorinterface.cpp
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "cursorinterface.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivateCursorInterface
+{
+ public:
+ PrivateCursorInterface() {}
+ ~PrivateCursorInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int CursorInterface::globalCursorInterfaceNumber = 0;
+
+CursorInterface::CursorInterface()
+{
+ globalCursorInterfaceNumber++;
+ myCursorInterfaceNumber = globalCursorInterfaceNumber++;
+
+ d = new PrivateCursorInterface();
+}
+
+CursorInterface::~CursorInterface()
+{
+ delete d;
+}
+
+unsigned int CursorInterface::cursorInterfaceNumber () const
+{
+ return myCursorInterfaceNumber;
+}
+
+void CursorInterface::setCursorInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("CursorInterface#"+suffix);
+}
+
+CursorInterface *KTextEditor::cursorInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<CursorInterface*>(doc->qt_cast("KTextEditor::CursorInterface"));
+}
diff --git a/interfaces/ktexteditor/cursorinterface.h b/interfaces/ktexteditor/cursorinterface.h
new file mode 100644
index 000000000..b243d3c4c
--- /dev/null
+++ b/interfaces/ktexteditor/cursorinterface.h
@@ -0,0 +1,84 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_cursorinterface_h__
+#define __ktexteditor_cursorinterface_h__
+
+#include <qptrlist.h>
+#include <qstring.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+ * This class represents a text cursor.
+ */
+class KTEXTEDITOR_EXPORT Cursor
+{
+ public:
+ virtual void position ( unsigned int *line, unsigned int *col ) const = 0;
+
+ virtual bool setPosition ( unsigned int line, unsigned int col ) = 0;
+
+ virtual bool insertText ( const QString& text ) = 0;
+
+ virtual bool removeText ( unsigned int numberOfCharacters ) = 0;
+
+ virtual QChar currentChar () const = 0;
+};
+
+/**
+* This is an interface for accessing the cursor of the Document class.
+*/
+class KTEXTEDITOR_EXPORT CursorInterface
+{
+ friend class PrivateCursorInterface;
+
+ public:
+ CursorInterface ();
+ virtual ~CursorInterface ();
+
+ unsigned int cursorInterfaceNumber () const;
+
+ protected:
+ void setCursorInterfaceDCOPSuffix (const QCString &suffix);
+
+ public:
+ /**
+ * Create a new cursor object
+ */
+ virtual Cursor *createCursor ( ) = 0;
+
+ /*
+ * Accessor to the list of cursors.
+ */
+ virtual QPtrList<Cursor> cursors () const = 0;
+
+ private:
+ class PrivateCursorInterface *d;
+ static unsigned int globalCursorInterfaceNumber;
+ unsigned int myCursorInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT CursorInterface *cursorInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/document.h b/interfaces/ktexteditor/document.h
new file mode 100644
index 000000000..9260d596c
--- /dev/null
+++ b/interfaces/ktexteditor/document.h
@@ -0,0 +1,73 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_document_h__
+#define __ktexteditor_document_h__
+
+#include "editor.h"
+
+namespace KTextEditor
+{
+
+/**
+ * The main class representing a text document.
+ * This class provides access to the document's views.
+ */
+class KTEXTEDITOR_EXPORT Document : public KTextEditor::Editor
+{
+ friend class PrivateDocument;
+
+ Q_OBJECT
+
+ public:
+ Document ( QObject *parent = 0, const char *name = 0 );
+ virtual ~Document ();
+
+ /**
+ * Returns the global number of this document in your app.
+ */
+ unsigned int documentNumber () const;
+
+ /**
+ * Returns this document's DCOP suffix for identifiying its DCOP interface.
+ */
+ QCString documentDCOPSuffix () const;
+
+ /**
+ * Create a view that will display the document data. You can create as many
+ * views as you like. When the user modifies data in one view then all other
+ * views will be updated as well.
+ */
+ virtual class View *createView ( QWidget *parent, const char *name = 0 ) = 0;
+
+ /*
+ * Returns a list of all views of this document.
+ */
+ virtual QPtrList<class View> views () const = 0;
+
+ private:
+ class PrivateDocument *d;
+ static unsigned int globalDocumentNumber;
+ unsigned int myDocumentNumber;
+};
+
+KTEXTEDITOR_EXPORT Document *createDocument ( const char* libname, QObject *parent = 0, const char *name = 0 );
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/documentdcopinfo.cpp b/interfaces/ktexteditor/documentdcopinfo.cpp
new file mode 100644
index 000000000..7377fcf79
--- /dev/null
+++ b/interfaces/ktexteditor/documentdcopinfo.cpp
@@ -0,0 +1,33 @@
+#include "documentinfo.h"
+#include "documentdcopinfo.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+DocumentInfoDCOPInterface::DocumentInfoDCOPInterface( DocumentInfoInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+DocumentInfoDCOPInterface::~DocumentInfoDCOPInterface()
+{
+
+}
+
+QString DocumentInfoDCOPInterface::mimeType()
+{
+ return m_parent->mimeType();
+}
+long DocumentInfoDCOPInterface::fileSize()
+{
+ return m_parent->fileSize();
+}
+QString DocumentInfoDCOPInterface::niceFileSize()
+{
+ return m_parent->niceFileSize();
+}
+uint DocumentInfoDCOPInterface::documentInfoInterfaceNumber ()
+{
+ return m_parent->documentInfoInterfaceNumber ();
+}
diff --git a/interfaces/ktexteditor/documentdcopinfo.h b/interfaces/ktexteditor/documentdcopinfo.h
new file mode 100644
index 000000000..2293ff119
--- /dev/null
+++ b/interfaces/ktexteditor/documentdcopinfo.h
@@ -0,0 +1,47 @@
+#ifndef DocumentInfo_DCOP_INTERFACE_H
+#define DocumentInfo_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+
+namespace KTextEditor
+{
+ class DocumentInfoInterface;
+ /**
+ This is the main interface to the DocumentInfoInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to DocumentInfoInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+
+ class KTEXTEDITOR_EXPORT DocumentInfoDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent DocumentInfoInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ DocumentInfoDCOPInterface( DocumentInfoInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~DocumentInfoDCOPInterface();
+ k_dcop:
+ QString mimeType();
+ long fileSize();
+ QString niceFileSize();
+ uint documentInfoInterfaceNumber ();
+ private:
+ DocumentInfoInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/documentinfo.cpp b/interfaces/ktexteditor/documentinfo.cpp
new file mode 100644
index 000000000..0047b5454
--- /dev/null
+++ b/interfaces/ktexteditor/documentinfo.cpp
@@ -0,0 +1,65 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "documentinfo.h"
+#include "documentdcopinfo.h"
+
+namespace KTextEditor
+{
+
+class PrivateDocumentInfoInterface
+{
+ public:
+ PrivateDocumentInfoInterface() {interface = 0;}
+ ~PrivateDocumentInfoInterface() {}
+ DocumentInfoDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int DocumentInfoInterface::globalDocumentInfoInterfaceNumber = 0;
+
+DocumentInfoInterface::DocumentInfoInterface()
+{
+ globalDocumentInfoInterfaceNumber++;
+ myDocumentInfoInterfaceNumber = globalDocumentInfoInterfaceNumber++;
+
+ d = new PrivateDocumentInfoInterface();
+ QString name = "DocumentInterface#" + QString::number(myDocumentInfoInterfaceNumber);
+ d->interface = new DocumentInfoDCOPInterface(this, name.latin1());
+}
+
+DocumentInfoInterface::~DocumentInfoInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int DocumentInfoInterface::documentInfoInterfaceNumber () const
+{
+ return myDocumentInfoInterfaceNumber;
+}
+
+void DocumentInfoInterface::setDocumentInfoInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("DocumentInfoInterface#"+suffix);
+}
diff --git a/interfaces/ktexteditor/documentinfo.h b/interfaces/ktexteditor/documentinfo.h
new file mode 100644
index 000000000..9e6eb06e5
--- /dev/null
+++ b/interfaces/ktexteditor/documentinfo.h
@@ -0,0 +1,60 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ 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 __ktexteditor_documentinfointerface_h__
+#define __ktexteditor_documentinfointerface_h__
+
+class QString;
+class QCString;
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+ * This is an interface for accessing information about files open
+ * in the Document, Plugin and PluginViewInterface classes.
+ */
+class KTEXTEDITOR_EXPORT DocumentInfoInterface
+{
+ friend class PrivateDocumentInterface;
+
+ public:
+ DocumentInfoInterface();
+ virtual ~DocumentInfoInterface();
+
+ virtual QString mimeType()=0;
+ virtual long fileSize()=0;
+ virtual QString niceFileSize()=0;
+
+ unsigned int documentInfoInterfaceNumber () const;
+
+ protected:
+ void setDocumentInfoInterfaceDCOPSuffix (const QCString &suffix);
+
+ private:
+ class PrivateDocumentInfoInterface *d;
+ static unsigned int globalDocumentInfoInterfaceNumber;
+ unsigned int myDocumentInfoInterfaceNumber;
+};
+
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/dynwordwrapinterface.cpp b/interfaces/ktexteditor/dynwordwrapinterface.cpp
new file mode 100644
index 000000000..e8448ed9c
--- /dev/null
+++ b/interfaces/ktexteditor/dynwordwrapinterface.cpp
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "dynwordwrapinterface.h"
+#include "view.h"
+
+namespace KTextEditor
+{
+
+class PrivateDynWordWrapInterface
+{
+ public:
+ PrivateDynWordWrapInterface() {}
+ ~PrivateDynWordWrapInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int DynWordWrapInterface::globalDynWordWrapInterfaceNumber = 0;
+
+DynWordWrapInterface::DynWordWrapInterface()
+{
+ globalDynWordWrapInterfaceNumber++;
+ myDynWordWrapInterfaceNumber = globalDynWordWrapInterfaceNumber++;
+
+ d = new PrivateDynWordWrapInterface();
+}
+
+DynWordWrapInterface::~DynWordWrapInterface()
+{
+ delete d;
+}
+
+unsigned int DynWordWrapInterface::dynWordWrapInterfaceNumber () const
+{
+ return myDynWordWrapInterfaceNumber;
+}
+
+void DynWordWrapInterface::setDynWordWrapInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("DynWordWrapInterface#"+suffix);
+}
+
+DynWordWrapInterface *KTextEditor::dynWordWrapInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<DynWordWrapInterface*>(view->qt_cast("KTextEditor::DynWordWrapInterface"));
+}
diff --git a/interfaces/ktexteditor/dynwordwrapinterface.h b/interfaces/ktexteditor/dynwordwrapinterface.h
new file mode 100644
index 000000000..165b4191d
--- /dev/null
+++ b/interfaces/ktexteditor/dynwordwrapinterface.h
@@ -0,0 +1,64 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_dynwordwrapinterface_h__
+#define __ktexteditor_dynwordwrapinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+ * This is an interface for accessing dynamic word wrapping functionality
+ * of the View class.
+ */
+class KTEXTEDITOR_EXPORT DynWordWrapInterface
+{
+ friend class PrivateDynWordWrapInterface;
+
+ public:
+ DynWordWrapInterface ();
+ virtual ~DynWordWrapInterface ();
+
+ unsigned int dynWordWrapInterfaceNumber () const;
+
+ protected:
+ void setDynWordWrapInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ virtual void setDynWordWrap (bool) = 0;
+ virtual bool dynWordWrap () const = 0;
+
+ private:
+ class PrivateDynWordWrapInterface *d;
+ static unsigned int globalDynWordWrapInterfaceNumber;
+ unsigned int myDynWordWrapInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT DynWordWrapInterface *dynWordWrapInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/editdcopinterface.cpp b/interfaces/ktexteditor/editdcopinterface.cpp
new file mode 100644
index 000000000..1a002d775
--- /dev/null
+++ b/interfaces/ktexteditor/editdcopinterface.cpp
@@ -0,0 +1,61 @@
+#include "editdcopinterface.h"
+#include "editinterface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+EditDCOPInterface::EditDCOPInterface( EditInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+EditDCOPInterface::~EditDCOPInterface()
+{
+
+}
+
+QString EditDCOPInterface::text ()
+{
+ return m_parent->text();
+}
+
+QString EditDCOPInterface::textLine ( uint line )
+{
+ return m_parent->textLine(line);
+}
+
+int EditDCOPInterface::numLines ()
+{
+ return m_parent->numLines();
+}
+
+int EditDCOPInterface::length ()
+{
+ return m_parent->length();
+}
+
+void EditDCOPInterface::setText ( const QString &text )
+{
+ m_parent->setText(text);
+}
+
+bool EditDCOPInterface::insertText ( uint line, uint col, const QString &text )
+{
+ return m_parent->insertText( line, col, text);
+}
+
+bool EditDCOPInterface::removeText ( uint startLine, uint startCol, uint endLine, uint endCol )
+{
+ return m_parent->removeText( startLine, startCol, endLine, endCol);
+}
+
+bool EditDCOPInterface::insertLine ( uint line, const QString &text )
+{
+ return m_parent->insertLine( line, text);
+}
+
+bool EditDCOPInterface::removeLine ( uint line )
+{
+ return m_parent->removeLine( line );
+}
diff --git a/interfaces/ktexteditor/editdcopinterface.h b/interfaces/ktexteditor/editdcopinterface.h
new file mode 100644
index 000000000..b6956d5fa
--- /dev/null
+++ b/interfaces/ktexteditor/editdcopinterface.h
@@ -0,0 +1,90 @@
+#ifndef EDIT_DCOP_INTERFACE_H
+#define EDIT_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+//#include "editdcopinterface.moc"
+namespace KTextEditor
+{
+ class EditInterface;
+ /**
+ This is the main interface to the EditInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to EditInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT EditDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent EditInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ EditDCOPInterface( EditInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ **/
+ virtual ~EditDCOPInterface();
+ k_dcop:
+ /**
+ * @return the complete document as a single QString
+ */
+ virtual QString text ();
+
+ /**
+ * @return All the text from the requested line.
+ */
+ virtual QString textLine ( uint line );
+
+ /**
+ * @return The current number of lines in the document
+ */
+ virtual int numLines ();
+
+ /**
+ * @return the number of characters in the document
+ */
+ virtual int length ();
+
+ /**
+ * Set the given text into the view.
+ * Warning: This will overwrite any data currently held in this view.
+ */
+ virtual void setText (const QString &text );
+
+ /**
+ * Inserts text at line "line", column "col"
+ * returns true if success
+ */
+ virtual bool insertText ( uint line, uint col, const QString &text );
+
+ /**
+ * remove text at line "line", column "col"
+ * returns true if success
+ */
+ virtual bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol) ;
+
+ /**
+ * Insert line(s) at the given line number.
+ */
+ virtual bool insertLine ( uint line, const QString &text );
+
+ /**
+ * Insert line(s) at the given line number.
+ * If only one line is in the current document, removeLine will fail (return false)
+ */
+ virtual bool removeLine ( uint line );
+ private:
+ EditInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/editinterface.cpp b/interfaces/ktexteditor/editinterface.cpp
new file mode 100644
index 000000000..095c44ba9
--- /dev/null
+++ b/interfaces/ktexteditor/editinterface.cpp
@@ -0,0 +1,57 @@
+#include "editinterface.h"
+#include "editdcopinterface.h"
+#include "document.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateEditInterface
+ {
+ public:
+ PrivateEditInterface()
+ {
+ interface = 0;
+ }
+ ~PrivateEditInterface(){}
+ // Data Members
+ EditDCOPInterface *interface;
+ };
+
+}
+
+uint EditInterface::globalEditInterfaceNumber = 0;
+
+EditInterface::EditInterface()
+{
+ d = new PrivateEditInterface();
+ globalEditInterfaceNumber++;
+ myEditInterfaceNumber = globalEditInterfaceNumber;
+ QString name = "EditInterface#" + QString::number(myEditInterfaceNumber);
+ d->interface = new EditDCOPInterface(this, name.latin1());
+}
+
+EditInterface::~EditInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+uint EditInterface::editInterfaceNumber () const
+{
+ return myEditInterfaceNumber;
+}
+
+void EditInterface::setEditInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("EditInterface#"+suffix);
+}
+
+EditInterface *KTextEditor::editInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<EditInterface*>(doc->qt_cast("KTextEditor::EditInterface"));
+}
+
diff --git a/interfaces/ktexteditor/editinterface.h b/interfaces/ktexteditor/editinterface.h
new file mode 100644
index 000000000..baea99803
--- /dev/null
+++ b/interfaces/ktexteditor/editinterface.h
@@ -0,0 +1,137 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_editinterface_h__
+#define __ktexteditor_editinterface_h__
+
+#include <qstring.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+* This is the main interface for accessing and modifying
+* text of the Document class.
+*/
+class KTEXTEDITOR_EXPORT EditInterface
+{
+ friend class PrivateEditInterface;
+
+ public:
+ EditInterface();
+ virtual ~EditInterface();
+
+ uint editInterfaceNumber () const;
+
+ protected:
+ void setEditInterfaceDCOPSuffix (const QCString &suffix);
+
+ public:
+ /**
+ * slots !!!
+ */
+ /**
+ * @return the complete document as a single QString
+ */
+ virtual QString text () const = 0;
+
+ /**
+ * @return a QString
+ */
+ virtual QString text ( uint startLine, uint startCol, uint endLine, uint endCol ) const = 0;
+
+ /**
+ * @return All the text from the requested line.
+ */
+ virtual QString textLine ( uint line ) const = 0;
+
+ /**
+ * @return The current number of lines in the document
+ */
+ virtual uint numLines () const = 0;
+
+ /**
+ * @return the number of characters in the document
+ */
+ virtual uint length () const = 0;
+
+ /**
+ * @return the number of characters in the line (-1 if no line "line")
+ */
+ virtual int lineLength ( uint line ) const = 0;
+
+ /**
+ * Set the given text into the view.
+ * Warning: This will overwrite any data currently held in this view.
+ */
+ virtual bool setText ( const QString &text ) = 0;
+
+ /**
+ * clears the document
+ * Warning: This will overwrite any data currently held in this view.
+ */
+ virtual bool clear () = 0;
+
+ /**
+ * Inserts text at line "line", column "col"
+ * returns true if success
+ * Use insertText(numLines(), ...) to append text at end of document
+ */
+ virtual bool insertText ( uint line, uint col, const QString &text ) = 0;
+
+ /**
+ * remove text at line "line", column "col"
+ * returns true if success
+ */
+ virtual bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol ) = 0;
+
+ /**
+ * Insert line(s) at the given line number.
+ * Use insertLine(numLines(), text) to append line at end of document
+ */
+ virtual bool insertLine ( uint line, const QString &text ) = 0;
+
+ /**
+ * Remove line(s) at the given line number.
+ */
+ virtual bool removeLine ( uint line ) = 0;
+
+ /**
+ * signals !!!
+ */
+ public:
+ virtual void textChanged () = 0;
+
+ virtual void charactersInteractivelyInserted(int ,int ,const QString&)=0; //line, col, characters if you don't support this, don't create a signal, just overload it.
+
+ /**
+ * only for the interface itself - REAL PRIVATE
+ */
+ private:
+ class PrivateEditInterface *d;
+ static uint globalEditInterfaceNumber;
+ uint myEditInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT EditInterface *editInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/editinterfaceext.cpp b/interfaces/ktexteditor/editinterfaceext.cpp
new file mode 100644
index 000000000..7d4acf55f
--- /dev/null
+++ b/interfaces/ktexteditor/editinterfaceext.cpp
@@ -0,0 +1,50 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 "editinterfaceext.h"
+#include "document.h"
+
+using namespace KTextEditor;
+
+uint EditInterfaceExt::globalEditInterfaceExtNumber = 0;
+
+EditInterfaceExt::EditInterfaceExt()
+ : d(0L)
+{
+ globalEditInterfaceExtNumber++;
+ myEditInterfaceExtNumber = globalEditInterfaceExtNumber;
+}
+
+EditInterfaceExt::~EditInterfaceExt()
+{
+}
+
+uint EditInterfaceExt::editInterfaceExtNumber() const
+{
+ return myEditInterfaceExtNumber;
+}
+
+EditInterfaceExt *KTextEditor::editInterfaceExt (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<EditInterfaceExt*>(doc->qt_cast("KTextEditor::EditInterfaceExt"));
+}
+
diff --git a/interfaces/ktexteditor/editinterfaceext.h b/interfaces/ktexteditor/editinterfaceext.h
new file mode 100644
index 000000000..f34ce80b9
--- /dev/null
+++ b/interfaces/ktexteditor/editinterfaceext.h
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_editinterfaceext_h__
+#define __ktexteditor_editinterfaceext_h__
+
+#include <qstring.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+* This is the main interface for accessing and modifying
+* text of the Document class.
+*/
+class KTEXTEDITOR_EXPORT EditInterfaceExt
+{
+ friend class PrivateEditInterfaceExt;
+
+ public:
+ EditInterfaceExt();
+ virtual ~EditInterfaceExt();
+
+ uint editInterfaceExtNumber() const;
+
+ /**
+ * Begin an editing sequence. Edit commands during this sequence will be
+ * bunched together such that they represent a single undo command in the
+ * editor, and so that repaint events do not occur inbetween.
+ *
+ * Your application should not return control to the event loop while it
+ * has an unterminated (no matching editEnd() call) editing sequence
+ * (result undefined) - so do all of your work in one go...
+ */
+ virtual void editBegin() = 0;
+
+ /**
+ * End and editing sequence.
+ */
+ virtual void editEnd() = 0;
+
+ public:
+ /**
+ * only for the interface itself - REAL PRIVATE
+ */
+ private:
+ class PrivateEditInterfaceExt *d;
+ static uint globalEditInterfaceExtNumber;
+ uint myEditInterfaceExtNumber;
+};
+
+KTEXTEDITOR_EXPORT EditInterfaceExt *editInterfaceExt (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/editor.h b/interfaces/ktexteditor/editor.h
new file mode 100644
index 000000000..6f196d34e
--- /dev/null
+++ b/interfaces/ktexteditor/editor.h
@@ -0,0 +1,64 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_editor_h__
+#define __ktexteditor_editor_h__
+
+#include <kparts/part.h>
+
+/**
+ * KTextEditor is KDE's standard text editing KPart interface.
+ */
+namespace KTextEditor
+{
+
+/**
+ * This is a simplfied version of the Document & View classes
+ * Usage: Load it, merge it's gui + be happy
+ * Extensibility: Use the Document / View classes if you want
+ * advanced features, interfaces, etc. This class is just a good text editor
+ * widget replacement for applications which just need an embedded text edtor
+ * and are not interested in using advanced interfaces.
+ */
+
+class KTEXTEDITOR_EXPORT Editor : public KParts::ReadWritePart
+{
+ friend class PrivateEditor;
+
+ Q_OBJECT
+
+ public:
+ /**
+ * Create a new editor widget.
+ */
+ Editor ( QObject *parent = 0, const char *name = 0 );
+ virtual ~Editor ();
+
+ unsigned int editorNumber () const;
+
+ private:
+ class PrivateEditor *d;
+ static unsigned int globalEditorNumber;
+ unsigned int myEditorNumber;
+};
+
+KTEXTEDITOR_EXPORT Editor *createEditor ( const char* libname, QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0 );
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/editorchooser.cpp b/interfaces/ktexteditor/editorchooser.cpp
new file mode 100644
index 000000000..a7211ab49
--- /dev/null
+++ b/interfaces/ktexteditor/editorchooser.cpp
@@ -0,0 +1,162 @@
+#include <editorchooser.h>
+#include <editorchooser.moc>
+
+#include <qcombobox.h>
+#include <ktrader.h>
+#include <kconfig.h>
+#include <qstringlist.h>
+#include <kservice.h>
+#include <klocale.h>
+#include <qlabel.h>
+#include <kapplication.h>
+#include <qlayout.h>
+
+#include "editorchooser_ui.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateEditorChooser
+ {
+ public:
+ PrivateEditorChooser()
+ {
+ }
+ ~PrivateEditorChooser(){}
+ // Data Members
+ EditorChooser_UI *chooser;
+ QStringList ElementNames;
+ QStringList elements;
+ };
+
+}
+
+EditorChooser::EditorChooser(QWidget *parent,const char *name) :
+ QWidget (parent,name)
+ {
+ d = new PrivateEditorChooser ();
+
+ // sizemanagment
+ QGridLayout *grid = new QGridLayout( this, 1, 1 );
+
+
+ d->chooser = new EditorChooser_UI (this, name);
+
+ grid->addWidget( d->chooser, 0, 0);
+
+
+ KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
+ KConfig *config=new KConfig("default_components");
+ config->setGroup("KTextEditor");
+ QString editor = config->readPathEntry("embeddedEditor");
+
+ if (editor.isEmpty()) editor="katepart";
+
+ for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it)
+ {
+ if ((*it)->desktopEntryName().contains(editor))
+ {
+ d->chooser->editorCombo->insertItem(i18n("System Default (%1)").arg((*it)->name()));
+ break;
+ }
+ }
+
+ for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it)
+ {
+ d->chooser->editorCombo->insertItem((*it)->name());
+ d->elements.append((*it)->desktopEntryName());
+ }
+ d->chooser->editorCombo->setCurrentItem(0);
+}
+
+EditorChooser:: ~EditorChooser(){
+ delete d;
+}
+
+void EditorChooser::readAppSetting(const QString& postfix){
+ KConfig *cfg=kapp->config();
+ QString previousGroup=cfg->group();
+ cfg->setGroup("KTEXTEDITOR:"+postfix);
+ QString editor=cfg->readPathEntry("editor");
+ if (editor.isEmpty()) d->chooser->editorCombo->setCurrentItem(0);
+ else
+ {
+ int idx=d->elements.findIndex(editor);
+ idx=idx+1;
+ d->chooser->editorCombo->setCurrentItem(idx);
+ }
+ cfg->setGroup(previousGroup);
+}
+
+void EditorChooser::writeAppSetting(const QString& postfix){
+ KConfig *cfg=kapp->config();
+ QString previousGroup=cfg->group();
+ cfg->setGroup("KTEXTEDITOR:"+postfix);
+ cfg->writeEntry("DEVELOPER_INFO","NEVER TRY TO USE VALUES FROM THAT GROUP, THEY ARE SUBJECT TO CHANGES");
+ cfg->writePathEntry("editor", (d->chooser->editorCombo->currentItem()==0) ?
+ QString::null : (*d->elements.at(d->chooser->editorCombo->currentItem()-1)));
+ cfg->sync();
+ cfg->setGroup(previousGroup);
+
+}
+
+KTextEditor::Document *EditorChooser::createDocument(QObject *parent,const char* name, const QString& postfix,bool fallBackToKatePart){
+
+ KTextEditor::Document *tmpDoc=0;
+
+ KConfig *cfg=kapp->config();
+ QString previousGroup=cfg->group();
+ cfg->setGroup("KTEXTEDITOR:"+postfix);
+ QString editor=cfg->readPathEntry("editor");
+ cfg->setGroup(previousGroup);
+ if (editor.isEmpty())
+ {
+ KConfig *config=new KConfig("default_components");
+ config->setGroup("KTextEditor");
+ editor = config->readPathEntry("embeddedEditor", "katepart");
+ delete config;
+ }
+
+ KService::Ptr serv=KService::serviceByDesktopName(editor);
+ if (serv)
+ {
+ tmpDoc=KTextEditor::createDocument(serv->library().latin1(),parent,name);
+ if (tmpDoc) return tmpDoc;
+ }
+ if (fallBackToKatePart)
+ return KTextEditor::createDocument("libkatepart",parent,name);
+
+ return 0;
+}
+
+KTextEditor::Editor *EditorChooser::createEditor(QWidget *parentWidget,QObject *parent,const char* widgetName,
+ const char* name,const QString& postfix,bool fallBackToKatePart){
+
+ KTextEditor::Editor *tmpEd=0;
+
+ KConfig *cfg=kapp->config();
+ QString previousGroup=cfg->group();
+ cfg->setGroup("KTEXTEDITOR:"+postfix);
+ QString editor=cfg->readPathEntry("editor");
+ cfg->setGroup(previousGroup);
+ if (editor.isEmpty())
+ {
+ KConfig *config=new KConfig("default_components");
+ config->setGroup("KTextEditor");
+ editor = config->readPathEntry("embeddedEditor", "katepart");
+ delete config;
+ }
+
+ KService::Ptr serv=KService::serviceByDesktopName(editor);
+ if (serv)
+ {
+ tmpEd=KTextEditor::createEditor(serv->library().latin1(),parentWidget,widgetName,parent,name);
+ if (tmpEd) return tmpEd;
+ }
+ if (fallBackToKatePart)
+ return KTextEditor::createEditor("libkatepart",parentWidget,widgetName,parent,name);
+
+ return 0;
+}
+
diff --git a/interfaces/ktexteditor/editorchooser.h b/interfaces/ktexteditor/editorchooser.h
new file mode 100644
index 000000000..3feb73b62
--- /dev/null
+++ b/interfaces/ktexteditor/editorchooser.h
@@ -0,0 +1,58 @@
+#ifndef _EDITOR_CHOOSER_H_
+#define _EDITOR_CHOOSER_H_
+
+#include <ktexteditor/editor.h>
+#include <ktexteditor/document.h>
+
+#include <qwidget.h>
+
+class KConfig;
+class QString;
+
+namespace KTextEditor
+{
+
+class KTEXTEDITOR_EXPORT EditorChooser: public QWidget
+{
+ friend class PrivateEditorChooser;
+
+ Q_OBJECT
+
+ public:
+ EditorChooser(QWidget *parent=0,const char *name=0);
+ virtual ~EditorChooser();
+
+ /* void writeSysDefault();*/
+
+ void readAppSetting(const QString& postfix=QString::null);
+ void writeAppSetting(const QString& postfix=QString::null);
+
+ static KTextEditor::Document *createDocument(QObject* parent=0,const char *name=0,const QString& postfix=QString::null, bool fallBackToKatePart=true);
+ static KTextEditor::Editor *createEditor(QWidget *parentWidget,QObject *parent,const char* widgetName=0,const char* name=0,const QString& postfix=QString::null,bool fallBackToKatePart=true);
+ private:
+ class PrivateEditorChooser *d;
+};
+
+/*
+class EditorChooserBackEnd: public ComponentChooserPlugin {
+
+Q_OBJECT
+public:
+ EditorChooserBackEnd(QObject *parent=0, const char *name=0);
+ virtual ~EditorChooserBackEnd();
+
+ virtual QWidget *widget(QWidget *);
+ virtual const QStringList &choices();
+ virtual void saveSettings();
+
+ void readAppSetting(KConfig *cfg,const QString& postfix);
+ void writeAppSetting(KConfig *cfg,const QString& postfix);
+
+public slots:
+ virtual void madeChoice(int pos,const QString &choice);
+
+};
+*/
+
+}
+#endif
diff --git a/interfaces/ktexteditor/editorchooser_ui.ui b/interfaces/ktexteditor/editorchooser_ui.ui
new file mode 100644
index 000000000..fa1d99184
--- /dev/null
+++ b/interfaces/ktexteditor/editorchooser_ui.ui
@@ -0,0 +1,64 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>EditorChooser_UI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EditorChooser</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>482</width>
+ <height>141</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Editor Chooser</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>460</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Please choose the default text editing component that you wish to use in this application. If you choose &lt;B&gt;System Default&lt;/B&gt;, the application will honor your changes in the Control Center. All other choices will override that setting.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>editorCombo</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>editorCombo</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/interfaces/ktexteditor/encodingdcopinterface.cpp b/interfaces/ktexteditor/encodingdcopinterface.cpp
new file mode 100644
index 000000000..adf369c6d
--- /dev/null
+++ b/interfaces/ktexteditor/encodingdcopinterface.cpp
@@ -0,0 +1,28 @@
+#include "encodingdcopinterface.h"
+#include "encodinginterface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+EncodingDCOPInterface::EncodingDCOPInterface( EncodingInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+EncodingDCOPInterface::~EncodingDCOPInterface()
+{
+
+ }
+uint EncodingDCOPInterface::encodingInterfaceNumber ()
+{
+ return m_parent->encodingInterfaceNumber ();
+}
+void EncodingDCOPInterface::setEncoding (QString e)
+{
+ m_parent->setEncoding (e);
+}
+QString EncodingDCOPInterface::encoding()
+{
+ return m_parent->encoding();
+}
diff --git a/interfaces/ktexteditor/encodingdcopinterface.h b/interfaces/ktexteditor/encodingdcopinterface.h
new file mode 100644
index 000000000..b5996deee
--- /dev/null
+++ b/interfaces/ktexteditor/encodingdcopinterface.h
@@ -0,0 +1,46 @@
+#ifndef Encoding_DCOP_INTERFACE_H
+#define Encoding_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+//#include "editdcopinterface.moc"
+namespace KTextEditor
+{
+ class EncodingInterface;
+ /**
+ This is the main interface to the EncodingInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to EncodingInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT EncodingDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent EncodingInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ EncodingDCOPInterface( EncodingInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~EncodingDCOPInterface();
+ k_dcop:
+ uint encodingInterfaceNumber ();
+ void setEncoding (QString e) ;
+ QString encoding();
+
+ private:
+ EncodingInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/encodinginterface.cpp b/interfaces/ktexteditor/encodinginterface.cpp
new file mode 100644
index 000000000..b27204862
--- /dev/null
+++ b/interfaces/ktexteditor/encodinginterface.cpp
@@ -0,0 +1,76 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "encodinginterface.h"
+#include "encodingdcopinterface.h"
+#include "document.h"
+
+
+
+namespace KTextEditor
+{
+
+class PrivateEncodingInterface
+{
+ public:
+ PrivateEncodingInterface() {interface=0;}
+ ~PrivateEncodingInterface() {}
+ EncodingDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int EncodingInterface::globalEncodingInterfaceNumber = 0;
+
+EncodingInterface::EncodingInterface()
+{
+ globalEncodingInterfaceNumber++;
+ myEncodingInterfaceNumber = globalEncodingInterfaceNumber++;
+
+ d = new PrivateEncodingInterface();
+ ::QString name = "EncodingInterface#" + ::QString::number(myEncodingInterfaceNumber);
+ d->interface = new EncodingDCOPInterface(this, name.latin1());
+}
+
+EncodingInterface::~EncodingInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int EncodingInterface::encodingInterfaceNumber () const
+{
+ return myEncodingInterfaceNumber;
+}
+
+void EncodingInterface::setEncodingInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("EncodingInterface#"+suffix);
+}
+
+EncodingInterface *KTextEditor::encodingInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<EncodingInterface*>(doc->qt_cast("KTextEditor::EncodingInterface"));
+}
diff --git a/interfaces/ktexteditor/encodinginterface.h b/interfaces/ktexteditor/encodinginterface.h
new file mode 100644
index 000000000..245090e2e
--- /dev/null
+++ b/interfaces/ktexteditor/encodinginterface.h
@@ -0,0 +1,63 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_encodinginterface_h__
+#define __ktexteditor_encodinginterface_h__
+
+#include <kdelibs_export.h>
+
+class QString;
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to the text encoding of a Document class.
+*/
+class KTEXTEDITOR_EXPORT EncodingInterface
+{
+ friend class PrivateEncodingInterface;
+
+ public:
+ EncodingInterface();
+ virtual ~EncodingInterface();
+
+ unsigned int encodingInterfaceNumber () const;
+
+ protected:
+ void setEncodingInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ virtual void setEncoding (const class QString &e) = 0;
+ virtual class QString encoding() const = 0;
+
+ private:
+ class PrivateEncodingInterface *d;
+ static unsigned int globalEncodingInterfaceNumber;
+ unsigned int myEncodingInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT EncodingInterface *encodingInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/highlightinginterface.cpp b/interfaces/ktexteditor/highlightinginterface.cpp
new file mode 100644
index 000000000..8f0db5204
--- /dev/null
+++ b/interfaces/ktexteditor/highlightinginterface.cpp
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "highlightinginterface.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivateHighlightingInterface
+{
+ public:
+ PrivateHighlightingInterface() {}
+ ~PrivateHighlightingInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int HighlightingInterface::globalHighlightingInterfaceNumber = 0;
+
+HighlightingInterface::HighlightingInterface()
+{
+ globalHighlightingInterfaceNumber++;
+ myHighlightingInterfaceNumber = globalHighlightingInterfaceNumber++;
+
+ d = new PrivateHighlightingInterface();
+}
+
+HighlightingInterface::~HighlightingInterface()
+{
+ delete d;
+}
+
+unsigned int HighlightingInterface::highlightingInterfaceNumber () const
+{
+ return myHighlightingInterfaceNumber;
+}
+
+void HighlightingInterface::setHighlightingInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("HighlightingInterface#"+suffix);
+}
+
+HighlightingInterface *KTextEditor::highlightingInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<HighlightingInterface*>(doc->qt_cast("KTextEditor::HighlightingInterface"));
+}
diff --git a/interfaces/ktexteditor/highlightinginterface.h b/interfaces/ktexteditor/highlightinginterface.h
new file mode 100644
index 000000000..08784085c
--- /dev/null
+++ b/interfaces/ktexteditor/highlightinginterface.h
@@ -0,0 +1,92 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_highlightinginterface_h__
+#define __ktexteditor_highlightinginterface_h__
+
+#include <kdelibs_export.h>
+
+class QString;
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface for syntax highlighting of a Document.
+*/
+class KTEXTEDITOR_EXPORT HighlightingInterface
+{
+ friend class PrivateHighlightingInterface;
+
+ public:
+ HighlightingInterface ();
+ virtual ~HighlightingInterface ();
+
+ unsigned int highlightingInterfaceNumber () const;
+
+ protected:
+ void setHighlightingInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ * returns the current active highlighting mode
+ */
+ virtual unsigned int hlMode () = 0;
+
+ /**
+ * set the current active highlighting mode
+ */
+ virtual bool setHlMode (unsigned int mode) = 0;
+
+ /**
+ * returns the number of available highlightings
+ */
+ virtual unsigned int hlModeCount () = 0;
+
+ /**
+ * returns the name of the highlighting with number "mode"
+ */
+ virtual QString hlModeName (unsigned int mode) = 0;
+
+ /**
+ * returns the sectionname of the highlighting with number "mode"
+ */
+ virtual QString hlModeSectionName (unsigned int mode) = 0;
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void hlChanged () = 0;
+
+ private:
+ class PrivateHighlightingInterface *d;
+ static unsigned int globalHighlightingInterfaceNumber;
+ unsigned int myHighlightingInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT HighlightingInterface *highlightingInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/kcm_ktexteditor.desktop b/interfaces/ktexteditor/kcm_ktexteditor.desktop
new file mode 100644
index 000000000..544a8bcf9
--- /dev/null
+++ b/interfaces/ktexteditor/kcm_ktexteditor.desktop
@@ -0,0 +1,172 @@
+Name=Embedded Text Editor
+Name[af]=Ingebedde Teks Redigeerder
+Name[ar]=محرر نص مدمج
+Name[az]=Daxili Mətn Editoru
+Name[be]=Унутраны тэкставы рэдактар
+Name[bg]=Текстов редактор
+Name[bn]=অভ্যন্তরীন টেক্সট সম্পাদক
+Name[br]=Aozer skrid enframmet
+Name[bs]=Umetnuti tekst editor
+Name[ca]=Editor de text, encastable
+Name[cs]=Zabudovaný textový editor
+Name[csb]=Òbsôdzony editora tekstu
+Name[cy]=Golygydd Testun Mewnol
+Name[da]=Indlejret teksteditor
+Name[de]=Erweiterte Editorkomponente
+Name[el]=Ενσωματωμένος επεξεργαστής κειμένου
+Name[eo]=Interna tekstredaktilo
+Name[es]=Editor de texto empotrable
+Name[et]=Põimitud tekstiredaktor
+Name[eu]=Kapsulatutako testu-editorea
+Name[fa]=ویرایشگر متن نهفته
+Name[fi]=Upotettava tekstieditori
+Name[fr]=Éditeur de texte intégré
+Name[fy]=Ynsletten tekstbewurker
+Name[ga]=Eagarthóir téacs leabaithe
+Name[gl]=Editor de Textos Incrustado
+Name[he]=עורך טקסט מוטבע
+Name[hi]=अंतर्निहित पाठ संपादक
+Name[hr]=Ugrađeni uređivač teksta
+Name[hsb]=Integrowane wobdźěłanje tekstow
+Name[hu]=Beágyazott szövegszerkesztő
+Name[id]=Komponen Editor Teks Embedded
+Name[is]=Ívafinn textaritill
+Name[it]=Editor di testi integrato
+Name[ja]=埋め込みテキストエディタ
+Name[ka]=ტექსტის ჩადგმული რედაქტორი
+Name[kk]=Ендірілетін мәтін редакторы
+Name[km]=កម្មវិធី​និពន្ធ​អត្ថបទ​ដែល​បាន​បង្កប់
+Name[ko]=끼워넣은 글월 편집기
+Name[lb]=Agebauten Texteditor
+Name[lt]=Įdėtas tekstų redaktorius
+Name[lv]=Iegultais teksta redaktors
+Name[mk]=Вгнезден текст уредувач
+Name[mn]=Холбоост текст боловсруулагч
+Name[ms]=Editor Teks Terimplan
+Name[nb]=Innebygget skriveprogram
+Name[nds]=Inbett Texteditor
+Name[ne]=सम्मिलित पाठ सम्पादक
+Name[nl]=Ingebedde tekst-editor
+Name[nn]=Inkluderbart skriveprogram
+Name[nso]=Mofetosi wa Sengwalwana yo a Robaditswego
+Name[pa]=ਸ਼ਾਮਿਲ ਪਾਠ ਸੰਪਾਦਕ
+Name[pl]=Osadzony edytor tekstu
+Name[pt]=Editor de Texto Embebido
+Name[pt_BR]=Editor de textos integrado
+Name[ro]=Editor de text înglobat
+Name[ru]=Встроенный текстовый редактор
+Name[rw]=Muhinduzi yUmwandiko Irimo
+Name[se]=Vuojuhahtti čállinprográmma
+Name[sk]=Vložiteľný textový editor
+Name[sl]=Vključeni urejevalnik besedil
+Name[sq]=Tekst Editori i ngulur
+Name[sr]=Уграђени уређивач текста
+Name[sr@Latn]=Ugrađeni uređivač teksta
+Name[ss]=Sihleli sembhalo lesilele
+Name[sv]=Inbäddad texteditor
+Name[ta]=உட்பொதிந்த உரை தொகுப்பி
+Name[te]=పొదగిన వాచకం సరిచేయునది
+Name[tg]=Таҳриргари матни дарунсохт
+Name[th]=โปรแกรมแก้ไขข้อความแบบฝังตัว
+Name[tr]=Gömülü Metin Düzenleyici
+Name[tt]=Mäten öçen Quşılma-Üzgärtkeçe
+Name[uk]=Вмонтований текстовий редактор
+Name[uz]=Ichki matn tahrirchi
+Name[uz@cyrillic]=Ички матн таҳрирчи
+Name[ven]=Musengulusi wa manwalwa o dzheniswaho
+Name[vi]=Bộ Soạn thảo Văn bản nhúng
+Name[wa]=Ravalé aspougneu di tecse
+Name[xh]=Umhleli Wombhalo Olungiselelweyo
+Name[zh_CN]=嵌入式文本编辑器
+Name[zh_HK]=嵌入式文字編輯器
+Name[zh_TW]=嵌入式文字編輯器
+Name[zu]=Umlungisi Wombhalo Oshuthekiwe
+Comment=The text editor service provides applications with a text viewer and editor. KDE applications that provide text editing facilities should use this service.
+Comment[af]=Die teks redigeerder diens verskaf programme met 'n teks aansig en redigeerder. Kde programme wat verskaf teks redigering fasiliteite moet gebruik hierdie diens.
+Comment[ar]=تقوم خدمة محرر النصوص بتزويد التطبيقات بمعاين نصوص ومحرر. يجب أن تستخدم تطبيقات كيدي التي تزود بتسهيلات تحرير النصوص هذه الخدمة.
+Comment[az]=Mətn redaktə xidməti proqramları mətn nümayişçisi və editoru ilə tə'min edir. Mətn redaktə bacarıqları olan proqramlar bu xidməti işlətməlidir.
+Comment[be]=Сервіс тэкставага рэдактара дазваляе праглядаць і рэдагаваць тэкст у праграмах. Праграмы KDE, якія выконваюць гэтыя функцыі, павінны працаваць з гэтым сервісам.
+Comment[bg]=Текстовия редактор, представлява компонент за вграждане в другите програми, който предоставя функционалност за разглеждане и редактиране на текстови файлове.
+Comment[bn]=টেক্সট সম্পাদক সার্ভিসটি বিভিন্ন অ্যাপলিকেশন-কে একটি টেক্সট প্রদর্শক এবং সম্পাদক ব্যবহার করার সুযোগ দেয়। কোন কে.ডি.ই. অ্যাপলিকেশন টেক্সট সম্পাদনা করার সুবিধা দিতে চাইলে তার এই সার্ভিসটি ব্যবহার করা উচিত্‍।
+Comment[bs]=Text editor servis pruža aplikacijama preglednik i editor teksta. KDE aplikacije koje imaju mogućnost editovanja teksta bi trebale koristiti ovaj servis.
+Comment[ca]=El servei de l'editor de text proveeix d'aplicacions amb un visor i un editor de text. Les aplicacions KDE que proveeixen de facilitats d'edició haurien d'emprar aquest servei.
+Comment[cs]=Služba textového editoru poskytuje aplikacím prohlížeč a editor textu. Aplikace KDE, které umožňují editovat text, by měly používat tuto službu.
+Comment[csb]=Ùsłëżnota tekstowegò editora zezwôlô aplikacejom na przezéranié ë edicejã tekstów. Programë KDE, jaczé ùprzistãpniają nã edicëjną fùnkcëjã, mają brëkòwac ti ùsłëżnonë.
+Comment[cy]=Mae'r gwasanaeth golygu testun yn darparu gwelydd testun a golygydd i gymhwysiadau. dylai cymhwysiadau KDE sy'n darparu galluoedd golygu testun ddefnyddio'r gwasanaeth yma.
+Comment[da]=Teksteditor-tjenesten udstyrer programmer med en tekstfremviser og editor. KDE-programmer der bruger tekstredigeringsfaciliteter bør benytte denne tjeneste.
+Comment[de]=Diese Komponente stellt Programmen einen Textbetrachter und -editor zur Verfügung. KDE-Anwendungen, die mit Textbearbeitung zu tun haben, sollten dieses Angebot nutzen.
+Comment[el]=Η υπηρεσία επεξεργαστή κειμένου παρέχει στις εφαρμογές έναν προβολέα και επεξεργαστή κειμένου. Οι εφαρμογές του KDE που παρέχουν δυνατότητες επεξεργασίας κειμένου θα πρέπει να χρησιμοποιούν αυτή την υπηρεσία.
+Comment[eo]=La tekstredaktila servo donas vin aplikaĵojn kun tekstrigardilo kaj redaktilo. KDE aplikaĵoj kiuj volas uzi tekstredaktadon uzu tiun ĉi servon.
+Comment[es]=El servicio del editor de texto proporciona aplicaciones con un visor de textos y un editor de textos. Las aplicaciones KDE que suministran propiedades de edición deberían utilizar este servicio.
+Comment[et]=Tekstiredaktori teenus annab rakendustele komponendi teksti vaatamiseks ja redigeerimiseks. Seda kasutavad kõik KDE rakendused, mis tegelevad teksti redigeerimisega.
+Comment[eu]=Testu-editorearen zerbitzuak testu-ikustailea eta editorea duten aplikazioak eskaintzen ditu. Testuak editatzeko aukera ematen duten KDE aplikazioek erabili beharko lukete zerbitzu hau.
+Comment[fa]=خدمت ویرایشگر متن، کاربردهایی را توسط یک مشاهده‌گر و ویرایشگر متن، فراهم می‌کند. کاربردهای KDE که امکانات ویرایش متن را فراهم می‌کنند باید از این \ خدمت استفاده نمایند.
+Comment[fi]=Tekstieditoripalvelu tarjoaa sovelluksille tekstinäyttäjän- ja muokkaimen. KDE-sovelluksien, jotka tarjoavat tekstinmuokkauspalveluita, tulisi käyttää tätä palvelua.
+Comment[fo]=Tekstritiltænastuni gera forrit út við ein tekstvísari og -ritil. KDE-forrit ið geva nýtarin møguleiki fyri at rætta tekst eiga at nýta hesa tænasta.
+Comment[fr]=Le service d'édition de texte fournit des applications comportant un afficheur de texte et un éditeur. Les applications KDE qui fournissent des fonctions d'édition de texte devraient utiliser ce service.
+Comment[fy]=De tekstbewurkings-fasiliteit foarsjocht programma's fan een tekstwerjouwer en -ferwurker. KDE-applikaasjes mei tekstferwurkingsmooglikheden kinne hjir gebrûk fan meitsje.
+Comment[ga]=Cuirtear amharcán téacs agus eagarthóir ar fáil d'fheidhmchláir trín seirbhís eagarthóireachta téacs. Ba cheart d'fheidhmchláir KDE a sholáthraíonn áiseanna eagarthóireachta an tseirbhís seo a úsáid.
+Comment[gl]=O servizo de edición de texto fornece ás aplicacións de visor e editor de textos. Todas as aplicacións de KDE que fornezan facilidades de edición de textos deberan empregar este servizo.
+Comment[he]=שירות עורך הטקסט מספק ליישומים מציג ועורך טקסט. יישומי KDE שמספקים אמצעים לעריכת טקסט ישתמשו בשירות זה.
+Comment[hi]=पाठ संपादक सेवा जो अनुप्रयोगों को एक पाठ दर्शक व एक संपादक उपलब्घ कराती है। केडीई अनुप्रयोग जो पाठ संपादन सुविधा उपलब्ध कराती हैं, उन्हें इसका प्रयोग करना चाहिए।
+Comment[hr]=Usluga tekstualnog uređivača aplikacijama omugućuje pregledavanje i uređivanje teksta. KDE aplikacije koje omogućuju uređivanje teksta trebale bi upotrebljavati ovo sučelje.
+Comment[hsb]=Wobdźěłanje teksta staji programam wobdźěłarja a wobhladowarja teksta k dispoziciji. KDE-aplikacije, kiž tajke něšto trjebaja, měli tutón serwis wužiwać.
+Comment[hu]=A szövegszerkesztő szolgáltatáson keresztül az alkalmazások szövegek megtekintését és szerkesztését végezhetik el. A KDE szövegszerkesztő programjai használhatják.
+Comment[id]=Layanan penyuntingan teks memberikan penampil dan penyunting teks untuk aplikasi. Aplikasi KDE yang menyediakan fasilitas penyuntingan teks seharusnya menggunakan layanan ini.
+Comment[is]=Ívafni ritillinn færir forritum texta-skoðara og ritil. KDE forrit sem birta ritil til textavinnslu ættu að nota þessa þjónustu.
+Comment[it]=Il servizio di editor di testi fornisce alle applicazioni un visualizzatore ed un editor di testi. Le applicazioni KDE che permettono l'elaborazione di testi dovrebbero usare questo servizio.
+Comment[ja]=テキストエディタサービスはアプリケーションにテキストビューアとテキストエディタを提供します。テキスト編集の機能を持つ KDE アプリケーションはこれを使用します。
+Comment[ka]=პროგრამების ტექსტური რედაქტორი ტექსტების საჩვენებლად და დასარედაქტირებლად. იგი გამოიყენება იმ KDE პროგრამების მიერ, რომელთაც ტექსტის რედაქტირება ესაჭიროებათ.
+Comment[kk]=Қолданбаларға мәтінді қарау және өңдеу мүмкіншілікті беретін қызмет. Мәтінді өңдеу үшін KDE қолданбалар осы қызметті пайдалану керек.
+Comment[km]=សេវា​កម្មវិធី​និពន្ធ​អត្ថបទ​ផ្តល់​នូវ​សំណុំ​កម្មវិធីរួម​មាន​កម្មវិធី​មើល​អត្ថបទ និង​កម្មវិធី​និពន្ធ​អត្ថបទ ។ សំណុំ​កម្មវិធី KDE ដែល​ផ្តល់​មធ្យោបាយ​និពន្ធ​អត្ថបទ គួរ​ប្រើ​សេវា​នេះ ។
+Comment[ko]=이 글월 편집기 서비스는 응용 프로그램이 글월을 보거나 고칠 수 있는 기능을 제공합니다. 글월을 고칠 수 있는 KDE 응용 프로그램은 이 서비스를 써야 합니다.
+Comment[lb]=Den Texeditor-Service stellt Programmer en Textlieser an en Texteditor zur Verfügung.KDE-Programmer, déi Textmanipuléierungsfunktiounen ubidden, sollen dëse Service benotzen.
+Comment[lt]=Teksto redaktoriaus tarnyba pateikia programoms teksto žiūriklį ir redaktorių. KDE programos, leidžiančios redaguoti tekstą, turėtų naudoti šią tarnybą.
+Comment[lv]=Teksta redaktora serviss sniedz teksta aplūkošanas un rediģēšanas pakalpojumus programmām. KDE programmām, kurām tas ir nepieciešams, vajadzētu izmantot šo servisu.
+Comment[mk]=Сервисот за текст уредувач ги снабдува апликациите со текст прегледник и уредувач. KDE апликациите што овозможуваат уредување текст би требало да го користат овој сервис.
+Comment[mn]=Текст засварлагч үйлчилгээ нь текст харах болон засварлах прогрммуудаар хангадаг. KDE программууд энэ үйлчилгээний хэрэглэх хэрэгтэй текст засварлах нэмэлт боломжуудаар хангадаг.
+Comment[ms]= Servis penyunting teks yang menyediakan aplikasi dengan pelihat teks dan editor. Aplikasi KDE yang menyediakan kemudahan penyuntingan teks patut menggunakan servis ini.
+Comment[mt]=Is-servizz ta' editur ta' test jipprovdi l-programmi b'werrej u editur ta' test. Programmi tal-KDE li jipprovdu servizzi ta' editjar ta' test għandhom jużaw dan is-servizz.
+Comment[nb]=Skriveprogrammet gir kan vise og redigere teks. KDE-programmer som kan redigere tekst bør bruke denne tjenesten.
+Comment[nds]=De Texteditor-Deenst föögt Programmen en Textwieser un -editor to. KDE-Programmen, mit de Texten bewerkt warrt, schöölt em bruken.
+Comment[ne]=पाठ सम्पादक सेवाले पाठ दर्शक र सम्पादकसँग अनुप्रयोग उपलब्ध गराउँछ । KDE अनुप्रयोग जसले पाठ सम्पादक सुविधाहरू उपलब्ध गर्छ त्यसले यो सेवा प्रयोग गर्छ ।
+Comment[nl]=Dit component stelt programma's een tekstviewer en -editor tot hun beschikking. KDE-toepassingen die te maken hebben met het bewerken van tekst kunnen gebruik maken van deze aangeboden dienst.
+Comment[nn]=Skriveprogramtenesta tilbyr vising og redigering av tekst. KDE-program som skal visa eller redigera tekst bør bruka denne tenesta.
+Comment[nso]=Tirelo ya phetoso ya sengwalwana e aba ditshumiso le molebeledi lemofetosi wa sengwalwana. Ditshumiso tsa KDE tseo di abago ditirelo tsaphetoso ya sengwalwana di swanetse go somisa tirelo ye.
+Comment[pa]=ਪਾਠ ਸੰਪਾਦਕ ਸੇਵਾ ਉਹ ਸਾਰੇ ਕਾਰਜ ਉਪਲੱਬਧ ਕਰਵਾਉਦਾ ਹੈ, ਜੋ ਕਿ ਪਾਠ ਦਰਸ਼ਕ ਤੇ ਸੰਪਾਦਕ ਸ਼ਾਮਿਲ ਹਨ। KDE ਕਾਰਜ ਜੋ ਕਿ ਪਾਠ ਸੰਪਾਦਨ ਦੀ ਸਹੂਲਤ ਉਪਲੱਬਧ ਕਰਵਾਉਦੀਆਂ ਹਨ, ਇਸ ਨੂੰ ਇਸਤੇਮਾਲ ਕਰਦੀਆਂ ਹਨ।
+Comment[pl]=Usługa edytora tekstowego pozwala programom na przeglądanie i edycję tekstów. Programy KDE, które udostępniają funkcje edycyjne, powinny używać tej usługi.
+Comment[pt]=O serviço de edição de texto oferece às aplicações um visualizador e editor de texto. As aplicações do KDE que oferecem funcionalidade de edição de texto devem usar este serviço.
+Comment[pt_BR]=O serviço de edição de texto fornece aplicações com um visualizador e um editor de textos. Aplicações do KDE que fornecem facilidades de edição de texto devem usar este serviço.
+Comment[ro]=Serviciul de editare text asigură aplicaţiilor un vizualizor de text şi un editor. Aplicaţiile KDE care oferă capabilităţi de editare de text ar trebui să utilizeze acest serviciu.
+Comment[ru]=Сервис текстового редактора для приложений, в которых требуется просмотр и редактирование текста. Его должны использовать приложения KDE, где требуется редактирование текста.
+Comment[rw]=Serivise ya muhinduzi y'umwandiko itanga amaporogaramu afite mugaragaza na muhinduzi y'umwandiko. Amaporogaramu KDE atanga uburyo bwo guhindura umwandiko agomba gukoresha iyi serivise.
+Comment[se]=Čállinprográmmabálvalus fállá teakstačájeheami ja -doaimmaheaheami. KDE-prográmmat, mat fállet teakstadoaimmahanvejolašvuođaid, galggašedje geavahit dán bálvalusa.
+Comment[sk]=Služba textového editora poskytuje aplikáciám prehliadač a editor textových súborov. Aplikácie KDE, ktoré podporujú úpravu textu, by mali používať túto službu.
+Comment[sl]=Storitev urejevalnika besedila omogoča programom dostop do pregledovalnika in urejevalnika besedil. Programi za KDE, ki omogočajo urejanje besedila, naj bi uporabljali to storitev.
+Comment[sq]=Servisi i tekst editorit i pajis aplikacionet me vështruesin dhe editorin e tekstit. Aplikacionet e KDE-së që na pajisin me shërbime të editimit të tekstit duhet ta përdorin këtë servis.
+Comment[sr]= Сервис уређивача текста обезбеђује програмима преглед и измене текстова. KDE програми који обезбеђују могућност обраде текста требало би да користе овај сервис.
+Comment[sr@Latn]= Servis uređivača teksta obezbeđuje programima pregled i izmene tekstova. KDE programi koji obezbeđuju mogućnost obrade teksta trebalo bi da koriste ovaj servis.
+Comment[ss]=Lusito lwekuhleal umbhalo luniketa ticelo letinesibuki sembhalo kanye nesihleli. Ticelo te KDe letiniketa tinsita tekuhlelwa kwembhalo kufanele tisebentise lolusito.
+Comment[sv]=Texteditortjänsten ger program en textvisare och editor. KDE-program som tillhandahåller textredigeringsfunktioner bör använda denna tjänst.
+Comment[ta]=உரை மற்றும் தொகுப்பாளருடனான பயன்பாடுகளை உரை தொகுப்பாளர் சேவை வழங்குகிறது. உரை தொகுக்கும் வசதிகளை வழங்கும் கேடிஇ பயன்பாடுகள் இச்சேவையைப் பயன்படுத்த வேண்டும்.
+Comment[te]=కార్యక్రమాలకు వాచకం సరిచేయు సేవ ఒక వాచకం విక్షణ మరియు సరిచెయుటకు సహాయపడును. కెడిఈ కార్యక్రమాలు వాచకం సరిచెయు సౌకర్యాలు వున్నట్టైతె దిని సేవ ను ఉపయొగించొకొవలెను
+Comment[tg]=Хидмати таҳриргари матн барномаҳоро бо намоишгар ва таҳриргари матн таъмин мекунад. Барномаҳои KDE дорои таҳриргари матн бояд ин хидмат истифода барад.
+Comment[th]=บริการตัวแก้ไขข้อความ จะจัดเตรียมตัวดูข้อความและตัวแก้ไขข้อความให้กับแอพพลิเคชัน แอพพลิเคชันของ KDE ที่เตรียมความสามารถในการแก้ไขข้อความมาให้ ควรที่จะใช้บริการนี้
+Comment[tt]=Mäten üzgärtü xezmäte törle yazılımnarnı mäten kürsätkeçe/üzgärtkeçe belän tä'min itä. Mäten üzgärtüçe KDE-yazılımnar bu xezmätne qullanırğa tieş.
+Comment[uk]=Служба "Текстовий редактор" постачає програми з переглядачем та редактором тексту. Програми KDE, які надають можливість редагування тексту, повинні користуватись цією службою.
+Comment[uz]=Matn tarhrirchi xizmati dasturlarni matn koʻruvchi va tahrirchi bilan taʼminlaydi. Matn tahrirlash imkoniyatini yaratuvchi KDE dasturlari shu xizmatni ishlatishi kerak.
+Comment[uz@cyrillic]=Матн тарҳрирчи хизмати дастурларни матн кўрувчи ва таҳрирчи билан таъминлайди. Матн таҳрирлаш имкониятини яратувчи KDE дастурлари шу хизматни ишлатиши керак.
+Comment[ven]=Tshumelo ya musengulusi wa manwalwa i diswa apulifikhesheni dzirena na vhavhoni vha manwalwa na musengulusi. Apulifikhesheni ya KDE ine ya disa zwishumiswa zwa u sengulusa manwalwa i fanela u shumisa tshumelo ino.
+Comment[vi]=Dịch vụ soạn thảo văn bản cung cấp cho ứng dụng một bộ xem và soạn thảo văn bản. Các ứng dụng KDE mà cung cấp khả năng soạn thảo văn bản nên dùng dịch vụ này.
+Comment[xh]=Inkonzo yomhleli wombhalo onika izicelo ngombonisi wombhalo nomhleli Izicelo ze KDE ezinikezela ngohlelo lombhalo ekufuneka isebenzise lenkonzo.
+Comment[zh_CN]=文本编辑器服务提供了文本查看器和编辑器的应用程序。提供文本编辑功能的 KDE 应用程序都应该使用此服务。
+Comment[zh_HK]=文字編輯服務為各種程式提供一個檢視和編輯文字的介面。任何提供文字編輯功能的 KDE 程式都應該使用這項服務。
+Comment[zh_TW]=文字編輯服務提供程式一個文字檢視器以及編輯器。提供文字編輯功能的 KDE 程式擁該使用這項服務。
+Comment[zu]=Umsebenzi womlungisi wombhalo onikeza imiyaleli ngombukisi wombhalo kanye nomhleli.Abayaleli abanikeza izisebenzi zokulungisa umbhalo okumele zisebenzise lomsebenzi.
+ServiceTypeToConfigure=KTextEditor/Document
+MimeTypeOfInterest=text/plain
+defaultImplementation=katepart
+storeInFile=default_components
+valueSection=KTextEditor
+valueName=embeddedEditor
+configurationType=component
diff --git a/interfaces/ktexteditor/ktexteditor.cpp b/interfaces/ktexteditor/ktexteditor.cpp
new file mode 100644
index 000000000..be92cdedb
--- /dev/null
+++ b/interfaces/ktexteditor/ktexteditor.cpp
@@ -0,0 +1,231 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 <config.h>
+
+#include "document.h"
+#include "view.h"
+#include "plugin.h"
+#include "editor.h"
+
+#include <kaction.h>
+#include <kparts/factory.h>
+#include <kparts/componentfactory.h>
+
+#include "document.moc"
+#include "view.moc"
+#include "plugin.moc"
+#include "editor.moc"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateDocument
+ {
+ public:
+ PrivateDocument ()
+ {
+ }
+
+ ~PrivateDocument()
+ {
+ }
+ };
+
+ class PrivateView
+ {
+ public:
+ PrivateView ()
+ {
+ }
+
+ ~PrivateView()
+ {
+ }
+ };
+
+ class PrivatePlugin
+ {
+ public:
+ PrivatePlugin ()
+ {
+ }
+
+ ~PrivatePlugin ()
+ {
+ }
+
+ class Document *m_doc;
+ };
+
+ class PrivatePluginViewInterface
+ {
+ public:
+ PrivatePluginViewInterface ()
+ {
+ }
+
+ ~PrivatePluginViewInterface ()
+ {
+ }
+ };
+
+ class PrivateEditor
+ {
+ public:
+ PrivateEditor ()
+ {
+ }
+
+ ~PrivateEditor()
+ {
+ }
+ };
+}
+
+unsigned int Document::globalDocumentNumber = 0;
+unsigned int View::globalViewNumber = 0;
+unsigned int Plugin::globalPluginNumber = 0;
+unsigned int PluginViewInterface::globalPluginViewInterfaceNumber = 0;
+unsigned int Editor::globalEditorNumber = 0;
+
+Document::Document( QObject *parent, const char *name ) : KTextEditor::Editor (parent, name )
+{
+ globalDocumentNumber++;
+ myDocumentNumber = globalDocumentNumber;
+}
+
+Document::~Document()
+{
+}
+
+unsigned int Document::documentNumber () const
+{
+ return myDocumentNumber;
+}
+
+QCString Document::documentDCOPSuffix () const
+{
+ QCString num;
+ num.setNum (documentNumber());
+
+ return num;
+}
+
+View::View( Document *, QWidget *parent, const char *name ) : QWidget( parent, name )
+{
+ globalViewNumber++;
+ myViewNumber = globalViewNumber;
+}
+
+View::~View()
+{
+}
+
+unsigned int View::viewNumber () const
+{
+ return myViewNumber;
+}
+
+QCString View::viewDCOPSuffix () const
+{
+ QCString num1, num2;
+ num1.setNum (viewNumber());
+ num2.setNum (document()->documentNumber());
+
+ return num2 + "-" + num1;
+}
+
+Plugin::Plugin( Document *document, const char *name ) : QObject (document, name )
+{
+ globalPluginNumber++;
+ myPluginNumber = globalPluginNumber;
+ d = new PrivatePlugin ();
+ d->m_doc = document;
+}
+
+Plugin::~Plugin()
+{
+ delete d;
+}
+
+unsigned int Plugin::pluginNumber () const
+{
+ return myPluginNumber;
+}
+
+Document *Plugin::document () const
+{
+ return d->m_doc;
+}
+
+PluginViewInterface::PluginViewInterface()
+{
+ globalPluginViewInterfaceNumber++;
+ myPluginViewInterfaceNumber = globalPluginViewInterfaceNumber;
+}
+
+PluginViewInterface::~PluginViewInterface()
+{
+}
+
+unsigned int PluginViewInterface::pluginViewInterfaceNumber () const
+{
+ return myPluginViewInterfaceNumber;
+}
+
+Editor::Editor( QObject *parent, const char *name ) : KParts::ReadWritePart( parent, name )
+{
+ globalEditorNumber++;
+ myEditorNumber = globalEditorNumber;
+}
+
+Editor::~Editor()
+{
+}
+
+unsigned int Editor::editorNumber () const
+{
+ return myEditorNumber;
+}
+
+Editor *KTextEditor::createEditor ( const char* libname, QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name )
+{
+ return KParts::ComponentFactory::createPartInstanceFromLibrary<Editor>( libname, parentWidget, widgetName, parent, name );
+}
+
+Document *KTextEditor::createDocument ( const char* libname, QObject *parent, const char *name )
+{
+ return KParts::ComponentFactory::createPartInstanceFromLibrary<Document>( libname, 0, 0, parent, name );
+}
+
+Plugin *KTextEditor::createPlugin ( const char* libname, Document *document, const char *name )
+{
+ return KParts::ComponentFactory::createInstanceFromLibrary<Plugin>( libname, document, name );
+}
+
+PluginViewInterface *KTextEditor::pluginViewInterface (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<PluginViewInterface*>(plugin->qt_cast("KTextEditor::PluginViewInterface"));
+}
+
diff --git a/interfaces/ktexteditor/ktexteditor.desktop b/interfaces/ktexteditor/ktexteditor.desktop
new file mode 100644
index 000000000..586559e35
--- /dev/null
+++ b/interfaces/ktexteditor/ktexteditor.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KTextEditor/Document
+X-KDE-Derived=KParts/ReadWritePart
+Comment=Embeddable Text Editor Component (with Doc/View Separation)
+Comment[af]=Inlegbare Teks Redigeerder Komponent (met Dok/Besigtig Seperasie)
+Comment[ar]=مكوّن تحرير النصوص القابل للدمج )مع Doc/View Separation(
+Comment[az]=Hopdurula Bilən Mətn Editor Komponenti (Doc/Nümayiş Ayrımlı)
+Comment[be]=Унутраны тэкставы рэдактар (з падзелам Дакумент/Прагляд)
+Comment[bg]=Текстов редактор (с разделение между Doc/View)
+Comment[bn]=অভ্যন্তরীণ টেক্সট সম্পাদক কম্পোনেন্ট (পৃথক ডক/ভিউ সহ)
+Comment[bs]=Umetljiva komponenta za obradu teksta (sa odvojenim Doc/View)
+Comment[ca]=Component encastable de l'editor de text (amb separació Doc/Vista)
+Comment[cs]=Pohltitelná komponenta textového editoru (s oddělením Doc/View)
+Comment[csb]=Dzéł editora tekstu (do òbsôdzaniô, z paradygmatã Dokùment/Wëzdrzatk)
+Comment[cy]=Cydran Golygydd Testun Mewnadeiladwy (wrth Wahanu Dogfen/Golwg)
+Comment[da]=Teksteditorkomponent som kan indlejres (med dok./visning-adskillelse)
+Comment[de]=Einbettungsfähige Editorkomponente (mit Text/Ansicht-Aufteilung)
+Comment[el]=Ενσωματώσιμο στοιχείο επεξεργαστή κειμένου (με διαχωρισμό Doc/View)
+Comment[eo]=Enkorpigebla redaktilo (kun apartigo de dokumento kaj rigardo)
+Comment[es]=Componente incrustable de editor de textos (con separación Doc/Vista)
+Comment[et]=Põimitav tekstiredaktori komponent (dokument/vaade eraldamisega)
+Comment[eu]=Testu-editorearen kapsulatutako osagaia (Dok/Ikusi bereizketarekin)
+Comment[fa]=مولفۀ ویرایشگر متن نهفته )با سند/نمای مجزا(
+Comment[fi]=Upotettava tekstimuokkauskomponentti (Asiakirja/Näkymä-jaolla)
+Comment[fr]=Composant d'édition de texte intégrable (avec séparation doc / vue)
+Comment[fy]=Yn te sluten tekstbewurkerkomponint (mei skieding fan tekst/werjefte)
+Comment[ga]=Comhpháirt eagarthóireacht téacs inleabaithe (le deighilt idir cáipéis agus amharc)
+Comment[gl]=Compoñente incrustábel de Edición de Texto (cunha Separación Doc/Vista)
+Comment[he]=רכיב עורך טקסט בר הטבעה (עם הפרדה בין מסמך לתצוגה)
+Comment[hi]=अंतर्निहित किया जा सकने वाला पाठ संपादक (डाक/व्यू सेपरेशन के साथ)
+Comment[hr]=Ugradiva komponenta obrade teksta (s Doc/View razdvajanjem)
+Comment[hsb]=Komponenta za integrowane wobdźěłanje teksta
+Comment[hu]=Beágyazható szövegszerkesztő (dokumentum/nézet modellel)
+Comment[id]=Komponen Penyuntingan Teks Tersisipkan (dengan Pemisahan Doc/View)
+Comment[is]=Ívafinn textaritill (með skjal/sýn aðskilnaði)
+Comment[it]=Componente integrabile per l'elaborazione di testi (con separazione documento/vista)
+Comment[ja]=埋め込み可能なテキストエディタコンポーネント (Doc/View 分離)
+Comment[ka]=ტექსტის რედაქტირების ჩადგმადი კომპონენტი (დოკუმენტი/ჩვენება მოდელის მხარდაჭერით)
+Comment[kk]=Ендірілетін мәтін өңдеу компоненті (Құжат/көрініс үлгіні қолдайтын)
+Comment[km]=សមាសភាគ​កម្មវិធីនិពន្ធ​អត្ថបទដែល​អាចបង្កប់ (ដោយ​ប្រើ​ការ​បំបែក Doc/View)
+Comment[ko]=끼워넣는 글월 편집기 구성 요소 (Doc/View 나눔)
+Comment[lb]=Abettbar Texteditor-Komponent (mat Dokument/Usiicht Trennung)
+Comment[lt]=Įdedamas tekstų redaktoriaus komponentas (su Doc/View atskyrimu)
+Comment[lv]=Iegulstama tekstu redaktora komponente (ar Dok/Skatīt atdalīšanu)
+Comment[mk]=Вгнездлива компонента за уредување на текст (со Док/Приказ раздвојување)
+Comment[mn]=Суулгах боломж бүхий засварлагчийн бүрдэл хэсэг(Teкст/Харах-тусгаарлалттай)
+Comment[ms]=Komponen Penyunting Teks Boleh Selit (Dokumentasi/Pelihat berasingan)
+Comment[mt]=Komponent integrat editur tat-test (b'separazzjoni dokument/wiri)
+Comment[nb]=Innebyggbar tekstredigeringskomponent (med Doc/View-skille)
+Comment[nds]=Inbettbor Texteditor-Komponent (mit Dokment/Ansicht-Trennen)
+Comment[ne]=सम्मिलित पाठ सम्पादक अवयव (डक/दृश्य विभाजनसँग)
+Comment[nl]=Ingebed teksteditorcomponent (met scheiding van tekst/weergave)
+Comment[nn]=Inkluderbart komponent for tekstvising (med Doc/View-deling)
+Comment[nso]=Seripa seo se Robatsegago sa Mofetosi wa Sengwalwana (le Karogano ya Doc/Bona)
+Comment[pa]=ਸ਼ਾਮਿਲ ਹੋਣਯੋਗ ਪਾਠ ਸੰਪਾਦਕ ਭਾਗ (Doc/ਦਰਿਸ਼ ਵੱਖ ਕਰਨ ਨਾਲ)
+Comment[pl]=Składnik edytora tekstu (do osadzania, z paradygmatem Dokument/Widok)
+Comment[pt]=Componente Incorporado do Editor de Texto (com Separação entre Documentos)
+Comment[pt_BR]=Componente de edição de textos integrado (com separação de Documentação/Visualização)
+Comment[ro]=Componentă de editare text (cu separare Doc/Vizualizare)
+Comment[ru]=Встраиваемый элемент редактора текста (с поддержкой модели документ/вид)
+Comment[rw]=Inyangingo Muhinduzi y'Umwandiko Ishyirwamo (ifite itandukanya Inyandiko/Ukugaragaza)
+Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (Doc/View-sirremiin)
+Comment[sk]=Vložiteľný komponent textového editora (s oddelením Doc/View)
+Comment[sl]=Vgradljiva komponenta urejevalnika besedil (z ločevanjem pogleda in dokumenta)
+Comment[sq]=Komponenta e ngulshme e Tekst Editorit (me ndarje Dokument/Vështrues)
+Comment[sr]=Уградива компонента за уређивање текста (са „документ/приказ“ одвајањем)
+Comment[sr@Latn]=Ugradiva komponenta za uređivanje teksta (sa „dokument/prikaz“ odvajanjem)
+Comment[ss]=Incenye yesihleli sembhalo lenamatselekako (ne Doc/Bona kwehlukana)
+Comment[sv]=Inbäddningsbar texteditor (med dok/vyseparation)
+Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் பகுதி (ஆவண/காட்சி பிரிவுகளுடன்)
+Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన వున్నది)
+Comment[tg]=Қисми таҳриргари матни дарунсохт (бо вазифаи намоиши санад)
+Comment[th]=คอมโปเนนท์แก้ไขข้อความที่ฝังได้ (โดยแยก เอกสาร/แสดงผล)
+Comment[tr]=Gömülebilir Metin Düzenleyici Bileşeni (Doc/View ayrımı dahil)
+Comment[tt]=Mäten Üzgärtüçe Quşılma-Komponent (İstälek/Küreneş ayıru belän)
+Comment[uk]=Компонент редактора текстів, який можна вбудовувати (з розділенням документ/вигляд)
+Comment[uz]=Ichiga oʻrnatib boʻladigan matn tahrirchi komponenti (hujjat/koʻrinish imkoniyati bilan)
+Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган матн таҳрирчи компоненти (ҳужжат/кўриниш имконияти билан)
+Comment[ven]=Khomphonente ya musengulusi ya manwalwa (ina Doc/u khethekana ha u vhona)
+Comment[vi]=Thành phần Soạn thảo Văn bản có nhúng được (có khả năng phân cách tài liệu/khung xem)
+Comment[xh]=Inxenye Yomhleli Wombhalo Olungiselelweyo (ngo Xwebhu/Ulwahlulo Lwemboniselo)
+Comment[zh_CN]=可嵌入的文本编辑器部件(带 文档/查看 分离)
+Comment[zh_HK]=可嵌入的文字編輯器元件 (Doc/View 分開)
+Comment[zh_TW]=可嵌入的文字編輯器元件 (Doc/View 分開)
+Comment[zu]=IIunga Lomlungisi Wombhalo (Ngokuhlukana kwe-Doc/Umbukiso)
diff --git a/interfaces/ktexteditor/ktexteditoreditor.desktop b/interfaces/ktexteditor/ktexteditoreditor.desktop
new file mode 100644
index 000000000..45fdac8a4
--- /dev/null
+++ b/interfaces/ktexteditor/ktexteditoreditor.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KTextEditor/Editor
+X-KDE-Derived=KParts/ReadWritePart
+Comment=Embeddable Text Editor Component (without Doc/View Separation)
+Comment[af]=Inlegbare Teks Redigeerder Komponent (sonder om te Dok/Besigtig Seperasie)
+Comment[ar]=مكوّن تحرير النصوص القابل للدمج )مع Doc/View Separation(
+Comment[az]=Hopdurula Bilən Mətn Editor Komponenti (Doc/Nümayiş Ayrımsız)
+Comment[be]=Унутраны тэкставы рэдактар (без падзелу Дакумент/Прагляд)
+Comment[bg]=Текстов редактор (без разделение между Doc/View)
+Comment[bn]=অভ্যন্তরীণ টেক্সট সম্পাদক কম্পোনেন্ট (পৃথক ডক/ভিউ ছাড়া)
+Comment[bs]=Umetljiva komponenta za obradu teksta (bez odvojenog Doc/View)
+Comment[ca]=Component encastable de l'editor de text (sense separació Doc/Vista)
+Comment[cs]=Pohltitelná komponenta textového editoru (bez oddělení Doc/View)
+Comment[csb]=Dzéł editora tekstu (do òbsôdzaniô, bez paradygmatu Dokùment/Wëzdrzatk)
+Comment[cy]=Cydran Golygydd Testun Mewnadeiladwy (heb Wahanu Dogfen/Golwg)
+Comment[da]=Teksteditorkomponent som kan indlejres (uden dok./visning-adskillelse)
+Comment[de]=Einbettungsfähige Editorkomponente (ohne Text/Ansicht-Aufteilung)
+Comment[el]=Ενσωματώσιμο στοιχείο επεξεργαστή κειμένου (χωρίς διαχωρισμό Doc/View)
+Comment[eo]=Enkorpigebla redaktilo (sen apartigo de dokumento kaj rigardo)
+Comment[es]=Componente incrustable de editor de textos (sin separación Doc/Vista)
+Comment[et]=Põimitav tekstiredaktori komponent
+Comment[eu]=Testu-editorearen kapsulatutako osagaia (Dok/Ikusi bereizketarik gabe)
+Comment[fa]=مولفۀ ویرایشگر متن نهفته ) بدون سند/نمای مجزا(
+Comment[fi]=Upotettava tekstimuokkauskomponentti (ilman Asiakirja/Näkymä-jakoa)
+Comment[fr]=Composant d'édition de texte intégrable (sans séparation doc / vue)
+Comment[fy]=Yn te sluten tekstbewurkerkomponint (sûnder skieding fan tekst/werjefte)
+Comment[ga]=Comhpháirt eagarthóireacht téacs inleabaithe (gan deighilt idir cáipéis agus amharc)
+Comment[gl]=Compoñente incrustábel de Edición de Texto (sen Separación Doc/Vista)
+Comment[he]=רכיב עורך טקסט בר הטבעה (בלי הפרדה בין מסמך לתצוגה)
+Comment[hi]=अंतर्निहित किया जा सकने वाला पाठ संपादक (डाक/व्यू सेपरेशन के बगैर)
+Comment[hr]=Ugradiva komponenta obrade teksta (bez Doc/View razdvajanja)
+Comment[hsb]=Integrujomna komponenta za wobdźěłanje tekstow (bjez doc/view-separacije)
+Comment[hu]=Beágyazható szövegszerkesztő (dokumentum/nézet modell nélkül)
+Comment[id]=Komponen Penyuntingan Teks Tersisipkan (tanpa Pemisahan Doc/View)
+Comment[is]=Ívafinn textaritill (án skjal/sýn aðskilnaðar)
+Comment[it]=Componente integrabile per l'elaborazione di testi (senza separazione documento/vista)
+Comment[ja]=埋め込み可能なテキストエディタコンポーネント (Doc/View 分離なし)
+Comment[ka]=ტექსტის რედაქტირების ჩადგმადი კომპონენტი (დოკუმენტი/ჩვენება მოდელის მხარდაჭერის გარეშე)
+Comment[kk]=Ендірілетін мәтін өңдеу компоненті (Құжат/көрініс үлгіні қолдамайтын)
+Comment[km]=សមាសភាគ​កម្មវិធីនិពន្ធ​អត្ថបទ​ដែល​អាច​បង្កប់ (ដោយ​គ្មាន​ការបំបែក Doc/View)
+Comment[ko]=끼워넣는 글월 편집기 구성 요소 (Doc/View 나누지 않음)
+Comment[lb]=Abettbar Texteditor-Komponent (ouni Dokument/Usiicht Trennung)
+Comment[lt]=Įdedamas tekstų redaktoriaus komponentas (be Doc/View atskyrimo)
+Comment[lv]=Iegulstama tekstu redaktora komponente (bez Dok/Skatīt atdalīšanas)
+Comment[mk]=Вгнездлива компонента за уредување на текст (без Док/Приказ раздвојување)
+Comment[mn]=Суулгах боломж бүхий засварлагчийн бүрдэл хэсэг(Teкст/Харах-тусгаарлалтгүй)
+Comment[ms]=Komponen Penyunting Teks Boleh Selit (Dokumentasi/Pelihat tidak berasingan)
+Comment[mt]=Komponent integrat editur tat-test (mingħajr separazzjoni dokument/wiri)
+Comment[nb]=Innebyggbar tekstredigeringskomponent (uten Doc/View skille)
+Comment[nds]=Inbettbor Texteditor-Komponent (ahn Dokment/Ansicht-Trennen)
+Comment[ne]=सम्मिलित पाठ सम्पादक अवयव (डक/दृश्य विभाजनवाहेक)
+Comment[nl]=Ingebed teksteditorcomponent (zonder scheiding van tekst/weergave)
+Comment[nn]=Inkluderbart komponent for tekstvising (utan Doc/View-deling)
+Comment[nso]=Seripa seo se Robatsegago sa Mofetosi wa Sengwalwana (kantle le Karogano ya Doc/Bona)
+Comment[pa]=ਸ਼ਾਮਿਲ ਹੋਣਯੋਗ ਪਾਠ ਸੰਪਾਦਕ ਭਾਗ (Doc/ਦਰਿਸ਼ ਵੱਖ ਕਰਨ ਬਿਨਾਂ)
+Comment[pl]=Składnik edytora tekstu (do osadzania, bez paradygmatu Dokument/Widok)
+Comment[pt]=Componente Incorporado do Editor de Texto (sem Separação entre Documentos)
+Comment[pt_BR]=Componente de edição de textos integrado (sem separação de Documentação/Visualização)
+Comment[ro]=Componentă de editare text (fără separare Doc/Vizualizare)
+Comment[ru]=Встраиваемый элемент редактора текста (без поддержки модели документ/вид)
+Comment[rw]=Inyangingo Muhinduzi y'Umwandiko Ishyirwamo (nta tandukanya Inyandiko/Ukugaragaza)
+Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (almmá Doc/View-sirrema)
+Comment[sk]=Vložiteľný komponent textového editora (bez oddelenia Doc/View)
+Comment[sl]=Vgradljiva komponenta urejevalnika besedil (brez ločevanja pogleda in dokumenta)
+Comment[sq]=Komponenta e ngulshme e Tekst Editorit (pa ndarje Dokument/Vështrues)
+Comment[sr]=Уградива компонента за уређивање текста (без „документ/приказ“ одвајања)
+Comment[sr@Latn]=Ugradiva komponenta za uređivanje teksta (bez „dokument/prikaz“ odvajanja)
+Comment[ss]=Incenye yesihleli sembhalo lenamatselekako (ngaphandle kwe Doc/Bona kwehlukana)
+Comment[sv]=Inbäddningsbar texteditor (utan dok/vyseparation)
+Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் கூறு (ஆவண/காட்சி பிரிவுகளற்ற)
+Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన లేకుండా)
+Comment[tg]=Қисми таҳриргари матни дарунсохт (бе вазифаи намоиши санад)
+Comment[th]=คอมโปเนนท์แก้ไขข้อความที่ฝังได้ (โดยไม่แยก เอกสาร/แสดงผล)
+Comment[tr]=Gömülebilir Metin Düzenleyici Bileşeni (Doc/View ayrımı yok)
+Comment[tt]=Mäten Üzgärtüçe Quşılma-Komponent (İstälek/Küreneş ayıru belän tügel)
+Comment[uk]=Компонент редактора текстів, який можна вбудовувати (без розділення документ/вигляд)
+Comment[uz]=Ichiga oʻrnatib boʻladigan matn tahrirchi komponenti (hujjat/koʻrinish imkoniyatsiz)
+Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган матн таҳрирчи компоненти (ҳужжат/кўриниш имкониятсиз)
+Comment[ven]=Khomphonente ya musengulusi wa manwalwa (i sina Doc/U khethekana hau vhona)
+Comment[vi]=Thành phần Soạn thảo Văn bản có nhúng được (không có khả năng phân cách tài liệu/khung xem)
+Comment[xh]=Ingxenye Yomhleli Wombhalo Olungiselekayo (ngaphandle Koxwebhu/Ulwahlulo Lwemboniselo)
+Comment[zh_CN]=可嵌入的文本编辑器部件(不带 文档/查看 分离)
+Comment[zh_HK]=可嵌入的文字編輯器元件 (Doc/View 不分開)
+Comment[zh_TW]=可嵌入的文字編輯器元件 (Doc/View 不分開)
+Comment[zu]=Ilunga Lomlungisi Wombhalo (ngaphandle Kokuhlukana kwe-Doc/Umbukiso)
diff --git a/interfaces/ktexteditor/ktexteditorplugin.desktop b/interfaces/ktexteditor/ktexteditorplugin.desktop
new file mode 100644
index 000000000..8c61a642d
--- /dev/null
+++ b/interfaces/ktexteditor/ktexteditorplugin.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KTextEditor/Plugin
+X-KDE-Derived=
+Comment=KTextEditor Plugin
+Comment[af]=KTextEditor Inprop Module
+Comment[ar]=مساعد برنامج KTextEditor
+Comment[az]=KTextEditor Əlavəsi
+Comment[be]=Модуль KTextEditor
+Comment[bg]=Приставка KTextEditor
+Comment[bn]=কে-টেক্সট-এডিটর প্লাগ-ইন
+Comment[br]=Lugent KTextEditor
+Comment[bs]=Dodatak za KTextEditor
+Comment[ca]=Connector del KTextEditor
+Comment[cs]=Modul textového editoru
+Comment[csb]=Plugins editora tekstu
+Comment[cy]=Atodyn KTextEditor
+Comment[da]=KTextEditor-plugin
+Comment[de]=KTextEditor-Erweiterung
+Comment[el]=Πρόσθετο KTextEditor
+Comment[eo]=Ktekstredaktila kromaĵeto
+Comment[es]=Plugin de KTextEditor
+Comment[et]=KTextEditori plugin
+Comment[eu]=KTextEditor plugin-a
+Comment[fa]=وصلۀ KTextEditor
+Comment[fi]=KTextEditor-lisäosa
+Comment[fr]=Module externe KTextEditor
+Comment[fy]=KTextFerwurker-plugin
+Comment[ga]=Breiseán KTextEditor
+Comment[gl]=Plugin KTextEditor
+Comment[he]=תוסף KTextEditor
+Comment[hi]=के-टेक्स्ट-एडिटर प्लगइन
+Comment[hr]=KTextEditor dodatak
+Comment[hu]=KTextEditor-bővítőmodul
+Comment[id]=Plugin KTextEditor
+Comment[is]=KTextEditor-íforrit
+Comment[it]=Plugin KTextEditor
+Comment[ja]=KTextEditor プラグイン
+Comment[ka]=KTextEditor მოდული
+Comment[kk]=KTextEditor модулі
+Comment[km]=កម្មវិធី​ជំនួយ​ខាង​ក្នុង KTextEditor
+Comment[ko]=K글월편집기 플러그인
+Comment[lb]=KTextEditor-Plugin
+Comment[lt]=KTextEditor priedas
+Comment[lv]=KTextEditor spraudnis
+Comment[mk]=KTextEditor приклучок
+Comment[mn]=Текст засварлагч
+Comment[ms]=Plugmasuk KTextEditor
+Comment[mt]=Plagin KTextEditor
+Comment[nb]=KTextEditor-programtillegg
+Comment[nds]=KTextEditor-Plugin
+Comment[ne]=KTextEditor प्लगइन
+Comment[nl]=KTextEditor-plugin
+Comment[nn]=KDE-skriveprogramtillegg
+Comment[nso]=Tsenyo ya Mofetosi wa Sengwalwana sa K
+Comment[pa]=ਕੇ ਪਾਠਸੰਪਾਦਕ ਪਲੱਗਿੰਨ
+Comment[pl]=Wtyczka edytora tekstu
+Comment[pt]='Plugin' do KTextEditor
+Comment[pt_BR]=Plug-in do Editor de Texto
+Comment[ro]=Modul editor de text
+Comment[ru]=Модуль KTextEditor
+Comment[rw]=Icomeka KMuhinduziUmwandiko
+Comment[se]=KDE-čállinprográmma lassemoduvla
+Comment[sk]=Modul KTextEditor
+Comment[sl]=Vstavek KTextEditor
+Comment[sq]=Shtojca KTextEditor
+Comment[sr]=KTextEditor прикључак
+Comment[sr@Latn]=KTextEditor priključak
+Comment[ss]=I-plugini ye KTextEditor
+Comment[sv]=Insticksprogram för texteditor
+Comment[ta]=கேஉரைதொகுப்பி சொருகுப்பொருள்
+Comment[te]=కెటెక్స్ట్ ఎడిటర్ ప్లగిన్
+Comment[tg]=Пуркунандаи KTextEditor
+Comment[th]=ปลักอิน KTextEditor
+Comment[tr]=KTextEditor Eklentisi
+Comment[tt]=KTextEditor Östämäse
+Comment[uk]=Втулок KTextEditor
+Comment[uz]=KTextEditor plagini
+Comment[uz@cyrillic]=KTextEditor плагини
+Comment[ven]=Pulagini ya musengulusi wa manwalwa a K
+Comment[vi]=Bộ cầm phít Soạn thảo Văn bản
+Comment[wa]=Tchôke-divins KTextEditor
+Comment[xh]=KTextEditor ye Plagi efakiweyo
+Comment[zh_CN]=KTextEditor 插件
+Comment[zh_HK]=KTextEditor 外掛程式
+Comment[zh_TW]=KTextEditor 外掛程式
+Comment[zu]= Ukungena ngaphakathi kwe-KTextEditor
diff --git a/interfaces/ktexteditor/markinterface.cpp b/interfaces/ktexteditor/markinterface.cpp
new file mode 100644
index 000000000..4b1127d9e
--- /dev/null
+++ b/interfaces/ktexteditor/markinterface.cpp
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "markinterface.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivateMarkInterface
+{
+ public:
+ PrivateMarkInterface() {}
+ ~PrivateMarkInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int MarkInterface::globalMarkInterfaceNumber = 0;
+
+MarkInterface::MarkInterface()
+{
+ globalMarkInterfaceNumber++;
+ myMarkInterfaceNumber = globalMarkInterfaceNumber++;
+
+ d = new PrivateMarkInterface();
+}
+
+MarkInterface::~MarkInterface()
+{
+ delete d;
+}
+
+unsigned int MarkInterface::markInterfaceNumber () const
+{
+ return myMarkInterfaceNumber;
+}
+
+void MarkInterface::setMarkInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("MarkInterface#"+suffix);
+}
+
+MarkInterface *KTextEditor::markInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<MarkInterface*>(doc->qt_cast("KTextEditor::MarkInterface"));
+}
+
+int MarkInterface::reservedMarkersCount()
+{
+ return 7;
+}
diff --git a/interfaces/ktexteditor/markinterface.h b/interfaces/ktexteditor/markinterface.h
new file mode 100644
index 000000000..84e1a6758
--- /dev/null
+++ b/interfaces/ktexteditor/markinterface.h
@@ -0,0 +1,171 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_markinterface_h__
+#define __ktexteditor_markinterface_h__
+
+#include <qptrlist.h>
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+class Mark
+{
+ public:
+ uint line;
+ uint type;
+};
+
+/**
+* This is an interface to enable marks to be made in the iconborder of the Document class.
+*/
+class KTEXTEDITOR_EXPORT MarkInterface
+{
+ friend class PrivateMarkInterface;
+
+ public:
+ MarkInterface ();
+ virtual ~MarkInterface ();
+
+ unsigned int markInterfaceNumber () const;
+
+ protected:
+ void setMarkInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ * @return a uint representing the marks set in @p line OR'ed togeather.
+ */
+ virtual uint mark (uint line) = 0;
+
+ /**
+ * Adds a mark of type @p markType to @p line.
+ * Has no effect if the line allready contains a mark of that type.
+ */
+ virtual void setMark (uint line, uint markType) = 0;
+ /**
+ * Clears all marks set in @p line.
+ */
+ virtual void clearMark (uint line) = 0;
+
+ virtual void addMark (uint line, uint markType) = 0;
+ /**
+ * Removes any mark of type @p markType from @p line.
+ */
+ virtual void removeMark (uint line, uint markType) = 0;
+
+ /**
+ * @return a list of all marks in the document
+ */
+ virtual QPtrList<KTextEditor::Mark> marks () = 0;
+ /**
+ * Clears all marks in the document.
+ */
+ virtual void clearMarks () = 0;
+
+ /**
+ * get the number of predefined marker types we have so far.
+ * @note If you change this you have to make sure katepart supports the new size!
+ * @return number of reserved marker types
+ * @since 3.3
+ */
+ static int reservedMarkersCount();
+
+ /**
+ * Pre-defined mark types.
+ *
+ * To create a non-standard mark type, use MarkInterfaceExtension.
+ * To add a new standard mark type, edit this interface to document the type.
+ */
+ enum MarkTypes
+ {
+ /** Bookmark */
+ markType01= 0x1,
+ /** Breakpoint active */
+ markType02= 0x2,
+ /** Breakpoint reached */
+ markType03= 0x4,
+ /** Breakpoint disabled */
+ markType04= 0x8,
+ /** Execution mark */
+ markType05= 0x10,
+ /** Warning */
+ markType06= 0x20,
+ /** Error */
+ markType07= 0x40,
+
+ markType08= 0x80,
+ markType09= 0x100,
+ markType10= 0x200,
+ markType11= 0x400,
+ markType12= 0x800,
+ markType13= 0x1000,
+ markType14= 0x2000,
+ markType15= 0x4000,
+ markType16= 0x8000,
+ markType17= 0x10000,
+ markType18= 0x20000,
+ markType19= 0x40000,
+ markType20= 0x80000,
+ markType21= 0x100000,
+ markType22= 0x200000,
+ markType23= 0x400000,
+ markType24= 0x800000,
+ markType25= 0x1000000,
+ markType26= 0x2000000,
+ markType27= 0x4000000,
+ markType28= 0x8000000,
+ markType29= 0x10000000,
+ markType30= 0x20000000,
+ markType31= 0x40000000,
+ markType32= 0x80000000,
+ /* reserved marks */
+ Bookmark = markType01,
+ BreakpointActive = markType02,
+ BreakpointReached = markType03,
+ BreakpointDisabled = markType04,
+ Execution = markType05,
+ Warning = markType06,
+ Error = markType07
+ };
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void marksChanged () = 0;
+
+ private:
+ class PrivateMarkInterface *d;
+ static unsigned int globalMarkInterfaceNumber;
+ unsigned int myMarkInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT MarkInterface *markInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/markinterfaceextension.cpp b/interfaces/ktexteditor/markinterfaceextension.cpp
new file mode 100644
index 000000000..73f429fe8
--- /dev/null
+++ b/interfaces/ktexteditor/markinterfaceextension.cpp
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "markinterfaceextension.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivateMarkInterfaceExtension
+{
+ public:
+ PrivateMarkInterfaceExtension() {}
+ ~PrivateMarkInterfaceExtension() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int MarkInterfaceExtension::globalMarkInterfaceExtensionNumber = 0;
+
+MarkInterfaceExtension::MarkInterfaceExtension()
+{
+ globalMarkInterfaceExtensionNumber++;
+ myMarkInterfaceExtensionNumber = globalMarkInterfaceExtensionNumber++;
+
+ d = new PrivateMarkInterfaceExtension();
+}
+
+MarkInterfaceExtension::~MarkInterfaceExtension()
+{
+ delete d;
+}
+
+unsigned int MarkInterfaceExtension::markInterfaceExtensionNumber () const
+{
+ return myMarkInterfaceExtensionNumber;
+}
+
+void MarkInterfaceExtension::setMarkInterfaceExtensionDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("MarkInterfaceExtension#"+suffix);
+}
+
+MarkInterfaceExtension *KTextEditor::markInterfaceExtension (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<MarkInterfaceExtension*>(doc->qt_cast("KTextEditor::MarkInterfaceExtension"));
+}
diff --git a/interfaces/ktexteditor/markinterfaceextension.h b/interfaces/ktexteditor/markinterfaceextension.h
new file mode 100644
index 000000000..cebe150f3
--- /dev/null
+++ b/interfaces/ktexteditor/markinterfaceextension.h
@@ -0,0 +1,83 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_markinterface_extension_h__
+#define __ktexteditor_markinterface_extension_h__
+
+#include <qptrlist.h>
+#include <qpixmap.h>
+#include <qstring.h>
+#include "markinterface.h"
+
+class QCString;
+
+namespace KTextEditor
+{
+
+
+/**
+* This is an interface for custom extensions of the MarkInterface.
+* It allows the developer to set pixmaps for custom marks and to indicate which
+* marks are settable by the user, for example (in kate), as actions in the iconborder's popup menu.
+*/
+class KTEXTEDITOR_EXPORT MarkInterfaceExtension
+{
+ friend class PrivateMarkInterfaceExtension;
+
+ public:
+ MarkInterfaceExtension ();
+ virtual ~MarkInterfaceExtension ();
+
+ unsigned int markInterfaceExtensionNumber () const;
+
+ protected:
+ void setMarkInterfaceExtensionDCOPSuffix (const QCString &suffix);
+
+ public:
+ virtual void setPixmap(MarkInterface::MarkTypes, const QPixmap &)=0;
+ virtual void setDescription(MarkInterface::MarkTypes, const QString &)=0;
+ virtual void setMarksUserChangable(uint markMask)=0;
+
+ enum MarkChangeAction {
+ MarkAdded=0,
+ MarkRemoved=1
+ };
+ //
+ // slots !!!
+ //
+ public:
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void markChanged (KTextEditor::Mark mark,
+ KTextEditor::MarkInterfaceExtension::MarkChangeAction action) = 0;
+
+ private:
+ class PrivateMarkInterfaceExtension *d;
+ static unsigned int globalMarkInterfaceExtensionNumber;
+ unsigned int myMarkInterfaceExtensionNumber;
+};
+
+KTEXTEDITOR_EXPORT MarkInterfaceExtension *markInterfaceExtension (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/plugin.h b/interfaces/ktexteditor/plugin.h
new file mode 100644
index 000000000..f96e50ddd
--- /dev/null
+++ b/interfaces/ktexteditor/plugin.h
@@ -0,0 +1,88 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_plugin_h__
+#define __ktexteditor_plugin_h__
+
+#include <qobject.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+class Document;
+class View;
+
+/**
+ * Basic KTextEditor plugin class.
+ * This plugin will be bound to a Document.
+ */
+class KTEXTEDITOR_EXPORT Plugin : public QObject
+{
+ friend class PrivatePlugin;
+
+ Q_OBJECT
+
+ public:
+ Plugin ( Document *document = 0, const char *name = 0 );
+ virtual ~Plugin ();
+
+ unsigned int pluginNumber () const;
+
+ Document *document () const;
+
+ private:
+ class PrivatePlugin *d;
+ static unsigned int globalPluginNumber;
+ unsigned int myPluginNumber;
+};
+
+KTEXTEDITOR_EXPORT Plugin *createPlugin ( const char* libname, Document *document = 0, const char *name = 0 );
+
+/**
+ * View plugin class.
+ * This plugin will be bound to a View
+ */
+class KTEXTEDITOR_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 (View *) = 0;
+ virtual void removeView (View *) = 0;
+
+ private:
+ class PrivatePluginViewInterface *d;
+ static unsigned int globalPluginViewInterfaceNumber;
+ unsigned int myPluginViewInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/popupmenuinterface.cpp b/interfaces/ktexteditor/popupmenuinterface.cpp
new file mode 100644
index 000000000..30fe4303f
--- /dev/null
+++ b/interfaces/ktexteditor/popupmenuinterface.cpp
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "popupmenuinterface.h"
+#include "view.h"
+
+namespace KTextEditor
+{
+
+class PrivatePopupMenuInterface
+{
+ public:
+ PrivatePopupMenuInterface() {}
+ ~PrivatePopupMenuInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int PopupMenuInterface::globalPopupMenuInterfaceNumber = 0;
+
+PopupMenuInterface::PopupMenuInterface()
+{
+ globalPopupMenuInterfaceNumber++;
+ myPopupMenuInterfaceNumber = globalPopupMenuInterfaceNumber++;
+
+ d = new PrivatePopupMenuInterface();
+}
+
+PopupMenuInterface::~PopupMenuInterface()
+{
+ delete d;
+}
+
+unsigned int PopupMenuInterface::popupMenuInterfaceNumber () const
+{
+ return myPopupMenuInterfaceNumber;
+}
+
+void PopupMenuInterface::setPopupMenuInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("PopupMenuInterface#"+suffix);
+}
+
+PopupMenuInterface *KTextEditor::popupMenuInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<PopupMenuInterface*>(view->qt_cast("KTextEditor::PopupMenuInterface"));
+}
diff --git a/interfaces/ktexteditor/popupmenuinterface.h b/interfaces/ktexteditor/popupmenuinterface.h
new file mode 100644
index 000000000..f1d07b806
--- /dev/null
+++ b/interfaces/ktexteditor/popupmenuinterface.h
@@ -0,0 +1,66 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_popupmenuinterface_h__
+#define __ktexteditor_popupmenuinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+class QPopupMenu;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to provide custom popup menus for a View.
+*/
+class KTEXTEDITOR_EXPORT PopupMenuInterface
+{
+ friend class PrivatePopupMenuInterface;
+
+ public:
+ PopupMenuInterface ();
+ virtual ~PopupMenuInterface ();
+
+ unsigned int popupMenuInterfaceNumber () const;
+
+ protected:
+ void setPopupMenuInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // normal methodes
+ //
+ public:
+ /**
+ Install a Popup Menu. The Popup Menu will be activated on
+ a right mouse button press event.
+ */
+ virtual void installPopup (QPopupMenu *rmb_Menu) = 0;
+
+ private:
+ class PrivatePopupMenuInterface *d;
+ static unsigned int globalPopupMenuInterfaceNumber;
+ unsigned int myPopupMenuInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT PopupMenuInterface *popupMenuInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/printdcopinterface.cpp b/interfaces/ktexteditor/printdcopinterface.cpp
new file mode 100644
index 000000000..3b9eddfe9
--- /dev/null
+++ b/interfaces/ktexteditor/printdcopinterface.cpp
@@ -0,0 +1,30 @@
+#include "printdcopinterface.h"
+#include "printinterface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+PrintDCOPInterface::PrintDCOPInterface( PrintInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+PrintDCOPInterface::~PrintDCOPInterface()
+{
+
+}
+
+uint PrintDCOPInterface::printInterfaceNumber ()
+{
+ return m_parent->printInterfaceNumber();
+}
+bool PrintDCOPInterface::printDialog ()
+{
+ return m_parent->printDialog();
+}
+bool PrintDCOPInterface::print ()
+{
+ return m_parent->print();
+}
+
diff --git a/interfaces/ktexteditor/printdcopinterface.h b/interfaces/ktexteditor/printdcopinterface.h
new file mode 100644
index 000000000..420def4cc
--- /dev/null
+++ b/interfaces/ktexteditor/printdcopinterface.h
@@ -0,0 +1,46 @@
+#ifndef Print_DCOP_INTERFACE_H
+#define Print_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+//#include "editdcopinterface.moc"
+namespace KTextEditor
+{
+ class PrintInterface;
+ /**
+ This is the main interface to the PrintInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to PrintInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT PrintDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent PrintInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ PrintDCOPInterface( PrintInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~PrintDCOPInterface();
+ k_dcop:
+ uint printInterfaceNumber () ;
+ bool printDialog ();
+ bool print ();
+
+ private:
+ PrintInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/printinterface.cpp b/interfaces/ktexteditor/printinterface.cpp
new file mode 100644
index 000000000..655e610bb
--- /dev/null
+++ b/interfaces/ktexteditor/printinterface.cpp
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "printinterface.h"
+#include "printdcopinterface.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivatePrintInterface
+{
+ public:
+ PrivatePrintInterface() {interface=0;}
+ ~PrivatePrintInterface() {}
+ PrintDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int PrintInterface::globalPrintInterfaceNumber = 0;
+
+PrintInterface::PrintInterface()
+{
+ globalPrintInterfaceNumber++;
+ myPrintInterfaceNumber = globalPrintInterfaceNumber++;
+
+ d = new PrivatePrintInterface();
+ QString name = "PrintInterface#" + QString::number(myPrintInterfaceNumber);
+ d->interface = new PrintDCOPInterface(this, name.latin1());
+}
+
+PrintInterface::~PrintInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int PrintInterface::printInterfaceNumber () const
+{
+ return myPrintInterfaceNumber;
+}
+
+void PrintInterface::setPrintInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("PrintInterface#"+suffix);
+}
+
+PrintInterface *KTextEditor::printInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<PrintInterface*>(doc->qt_cast("KTextEditor::PrintInterface"));
+}
diff --git a/interfaces/ktexteditor/printinterface.h b/interfaces/ktexteditor/printinterface.h
new file mode 100644
index 000000000..a2af1d0c4
--- /dev/null
+++ b/interfaces/ktexteditor/printinterface.h
@@ -0,0 +1,63 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_printinterface_h__
+#define __ktexteditor_printinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to printing functions of a Document.
+*/
+class KTEXTEDITOR_EXPORT PrintInterface
+{
+ friend class PrivatePrintInterface;
+
+ public:
+ PrintInterface ();
+ virtual ~PrintInterface ();
+
+ unsigned int printInterfaceNumber () const;
+
+ protected:
+ void setPrintInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ virtual bool printDialog () = 0;
+ virtual bool print () = 0;
+
+ private:
+ class PrivatePrintInterface *d;
+ static unsigned int globalPrintInterfaceNumber;
+ unsigned int myPrintInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT PrintInterface *printInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/searchdcopinterface.cpp b/interfaces/ktexteditor/searchdcopinterface.cpp
new file mode 100644
index 000000000..ce4fe516d
--- /dev/null
+++ b/interfaces/ktexteditor/searchdcopinterface.cpp
@@ -0,0 +1,95 @@
+#include "searchdcopinterface.h"
+#include "searchinterface.h"
+
+#include <dcopclient.h>
+#include <qregexp.h>
+
+using namespace KTextEditor;
+
+SearchDCOPInterface::SearchDCOPInterface( SearchInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+ m_currentcol = 0;
+ m_currentrow = 0;
+ m_currentmatchlen = 0;
+}
+
+SearchDCOPInterface::~SearchDCOPInterface()
+{
+
+}
+
+bool SearchDCOPInterface::findFirstString( QString text, bool caseSensitive)
+{
+ return m_parent->searchText(0, 0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive);
+}
+bool SearchDCOPInterface::findNextString( QString text, bool caseSensitive)
+{
+ return m_parent->searchText(m_currentrow, m_currentcol+1, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive);
+}
+
+bool SearchDCOPInterface::findPreviousString( QString text, bool caseSensitive)
+{
+ if( m_currentcol == 0)
+ m_currentrow--;
+ else
+ m_currentcol--;
+ return m_parent->searchText(m_currentrow, m_currentcol, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true);
+}
+
+bool SearchDCOPInterface::findLastString( QString text, bool caseSensitive)
+{
+ return m_parent->searchText(0,0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true);
+}
+
+bool SearchDCOPInterface::findStringAt( uint row, uint col, QString text, bool caseSensitive)
+{
+ return m_parent->searchText(row,col, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive);
+
+}
+
+bool SearchDCOPInterface::findFirstRegExp( QString regexp)
+{
+ return m_parent->searchText( 0,0, QRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen);
+}
+
+bool SearchDCOPInterface::findNextRegExp( QString regexp)
+{
+ return m_parent->searchText( m_currentrow, m_currentcol+1, QRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen);
+}
+
+bool SearchDCOPInterface::findPreviousRegExp( QString regexp)
+{
+ if( m_currentcol == 0)
+ m_currentrow--;
+ else
+ m_currentcol--;
+ return m_parent->searchText( m_currentrow, m_currentcol, QRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true);
+
+}
+
+bool SearchDCOPInterface::findLastRegExp(QString regexp)
+{
+ return m_parent->searchText( 0,0, QRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true);
+}
+
+bool SearchDCOPInterface::findRegExpAt( uint row, uint col, QString regexp)
+{
+ return m_parent->searchText( row, col, QRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, false);
+}
+
+uint SearchDCOPInterface::currentMatchLine()
+{
+ return m_currentrow;
+}
+uint SearchDCOPInterface::currentMatchCol()
+{
+ return m_currentcol;
+}
+uint SearchDCOPInterface::currentMatchLength()
+{
+ return m_currentmatchlen;
+}
+
+
diff --git a/interfaces/ktexteditor/searchdcopinterface.h b/interfaces/ktexteditor/searchdcopinterface.h
new file mode 100644
index 000000000..a16af1bd6
--- /dev/null
+++ b/interfaces/ktexteditor/searchdcopinterface.h
@@ -0,0 +1,59 @@
+#ifndef SEARCH_DCOP_INTERFACE_H
+#define SEARCH_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+
+namespace KTextEditor
+{
+ class SearchInterface;
+ /**
+ This is the main interface to the SearchInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to SearchInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT SearchDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent SearchInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ SearchDCOPInterface( SearchInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ **/
+ virtual ~SearchDCOPInterface();
+ k_dcop:
+ bool findFirstString(QString text, bool caseSensitive);
+ bool findNextString(QString text, bool caseSensitive);
+ bool findPreviousString( QString text, bool caseSensitive);
+ bool findLastString(QString text, bool caseSensitive);
+ bool findStringAt( uint row, uint col, QString text, bool caseSensitive);
+
+ bool findFirstRegExp( QString regexp);
+ bool findNextRegExp( QString regexp);
+ bool findPreviousRegExp( QString regexp);
+ bool findLastRegExp( QString regexp);
+ bool findRegExpAt( uint row, uint col, QString regexp);
+
+ uint currentMatchLine();
+ uint currentMatchCol();
+ uint currentMatchLength();
+
+ private:
+ SearchInterface *m_parent;
+ uint m_currentcol;
+ uint m_currentrow;
+ uint m_currentmatchlen;
+ };
+}
+#endif
diff --git a/interfaces/ktexteditor/searchinterface.cpp b/interfaces/ktexteditor/searchinterface.cpp
new file mode 100644
index 000000000..738567e87
--- /dev/null
+++ b/interfaces/ktexteditor/searchinterface.cpp
@@ -0,0 +1,55 @@
+#include "searchinterface.h"
+#include "searchdcopinterface.h"
+#include "document.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateSearchInterface
+ {
+ public:
+ PrivateSearchInterface()
+ {
+ interface = 0;
+ }
+ ~PrivateSearchInterface(){}
+ // Data Members
+ SearchDCOPInterface *interface;
+ };
+
+}
+
+unsigned int SearchInterface::globalSearchInterfaceNumber = 0;
+
+SearchInterface::SearchInterface()
+{
+ d = new PrivateSearchInterface();
+ globalSearchInterfaceNumber++;
+ mySearchInterfaceNumber=globalSearchInterfaceNumber;
+ QString name = "SearchInterface#" + QString::number(mySearchInterfaceNumber);
+ d->interface = new SearchDCOPInterface(this, name.latin1());
+}
+SearchInterface::~SearchInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int SearchInterface::searchInterfaceNumber () const
+{
+ return mySearchInterfaceNumber;
+}
+
+void SearchInterface::setSearchInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("SearchInterface#"+suffix);
+}
+
+SearchInterface *KTextEditor::searchInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<SearchInterface*>(doc->qt_cast("KTextEditor::SearchInterface"));
+}
diff --git a/interfaces/ktexteditor/searchinterface.h b/interfaces/ktexteditor/searchinterface.h
new file mode 100644
index 000000000..1fd6823d3
--- /dev/null
+++ b/interfaces/ktexteditor/searchinterface.h
@@ -0,0 +1,65 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_searchinterface_h__
+#define __ktexteditor_searchinterface_h__
+
+#include <kdelibs_export.h>
+
+class QRegExp;
+class QString;
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to allow searching of a Document.
+*/
+class KTEXTEDITOR_EXPORT SearchInterface
+{
+ friend class PrivateSearchInterface;
+
+ public:
+ SearchInterface();
+ virtual ~SearchInterface();
+
+ unsigned int searchInterfaceNumber () const;
+
+ protected:
+ void setSearchInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ virtual bool searchText (unsigned int startLine, unsigned int startCol, const QString &text, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool casesensitive = true, bool backwards = false) = 0;
+ virtual bool searchText (unsigned int startLine, unsigned int startCol, const QRegExp &regexp, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool backwards = false) = 0;
+
+ private:
+ class PrivateSearchInterface *d;
+ static unsigned int globalSearchInterfaceNumber;
+ unsigned int mySearchInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT SearchInterface *searchInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/selectiondcopinterface.cpp b/interfaces/ktexteditor/selectiondcopinterface.cpp
new file mode 100644
index 000000000..c1405ae16
--- /dev/null
+++ b/interfaces/ktexteditor/selectiondcopinterface.cpp
@@ -0,0 +1,64 @@
+#include "selectiondcopinterface.h"
+#include "selectioninterface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+SelectionDCOPInterface::SelectionDCOPInterface( SelectionInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+SelectionDCOPInterface::~SelectionDCOPInterface()
+{
+
+}
+
+ /**
+ * @return set the selection from line_start,col_start to line_end,col_end
+ */
+ bool SelectionDCOPInterface::setSelection ( uint startLine, uint startCol, uint endLine, uint endCol )
+ {
+ return m_parent->setSelection ( startLine, startCol, endLine, endCol );
+ }
+
+ /**
+ * removes the current Selection (not Text)
+ */
+ bool SelectionDCOPInterface::clearSelection ()
+ {
+ return m_parent->clearSelection();
+ }
+
+ /**
+ * @return true if there is a selection
+ */
+ bool SelectionDCOPInterface::hasSelection ()
+ {
+ return m_parent->hasSelection();
+ }
+
+ /**
+ * @return a QString for the selected text
+ */
+ QString SelectionDCOPInterface::selection ()
+ {
+ return m_parent->selection();
+ }
+
+ /**
+ * removes the selected Text
+ */
+ bool SelectionDCOPInterface::removeSelectedText ()
+ {
+ return m_parent->removeSelectedText();
+ }
+
+ /**
+ * select the whole text
+ */
+ bool SelectionDCOPInterface::selectAll ()
+ {
+ return m_parent->selectAll();
+ }
diff --git a/interfaces/ktexteditor/selectiondcopinterface.h b/interfaces/ktexteditor/selectiondcopinterface.h
new file mode 100644
index 000000000..87efc1918
--- /dev/null
+++ b/interfaces/ktexteditor/selectiondcopinterface.h
@@ -0,0 +1,72 @@
+#ifndef SELECTION_DCOP_INTERFACE_H
+#define SELECTION_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+
+namespace KTextEditor
+{
+ class SelectionInterface;
+ /**
+ This is the main interface to the SelectionInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to SelectionInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT SelectionDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent SelectionInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ SelectionDCOPInterface( SelectionInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ **/
+ virtual ~SelectionDCOPInterface();
+ k_dcop:
+ /**
+ * @return set the selection from line_start,col_start to line_end,col_end
+ */
+ bool setSelection ( uint startLine, uint startCol, uint endLine, uint endCol );
+
+ /**
+ * removes the current Selection (not Text)
+ */
+ bool clearSelection ();
+
+ /**
+ * @return true if there is a selection
+ */
+ bool hasSelection ();
+
+ /**
+ * @return a QString for the selected text
+ */
+ QString selection ();
+
+ /**
+ * removes the selected Text
+ */
+ bool removeSelectedText ();
+
+ /**
+ * select the whole text
+ */
+ bool selectAll ();
+
+ private:
+ SelectionInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/selectionextdcopinterface.h b/interfaces/ktexteditor/selectionextdcopinterface.h
new file mode 100644
index 000000000..65e7529ab
--- /dev/null
+++ b/interfaces/ktexteditor/selectionextdcopinterface.h
@@ -0,0 +1,57 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Anders Lund <anders@alweb.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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.
+
+ $Id$
+*/
+
+#ifndef _SELECTION_EXT_DCOP_INTERFACE_H_
+#define _SELECTION_EXT_DCOP_INTERFACE_H_
+
+#include "selectioninterfaceext.h"
+
+#include <qstring.h>
+#include <dcopobject.h>
+#include <dcopref.h>
+
+namespace KTextEditor {
+/**
+ DCOP interface for the SelectionInterfaceExt.
+ @author Anders Lund <anders@alweb.dk>
+*/
+class KTEXTEDITOR_EXPORT SelectionExtDCOPInterface : virtual public DCOPObject
+{
+ K_DCOP
+ public:
+ SelectionExtDCOPInterface( SelectionInterfaceExt *parent, const char *name );
+ virtual ~SelectionExtDCOPInterface();
+ k_dcop:
+ /** The selection start line number */
+ int selStartLine();
+ /** The selection start col */
+ int selStartCol();
+ /** The selection end line */
+ int selEndLine();
+ /** The selection end col */
+ int selEndCol();
+ private:
+ SelectionInterfaceExt *m_parent;
+};
+
+} // namespace KTextEditor
+
+#endif // _SELECTION_EXT_DCOP_INTERFACE_H_
diff --git a/interfaces/ktexteditor/selectioninterface.cpp b/interfaces/ktexteditor/selectioninterface.cpp
new file mode 100644
index 000000000..d568881d4
--- /dev/null
+++ b/interfaces/ktexteditor/selectioninterface.cpp
@@ -0,0 +1,65 @@
+#include "selectioninterface.h"
+#include "selectiondcopinterface.h"
+#include "document.h"
+#include "view.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateSelectionInterface
+ {
+ public:
+ PrivateSelectionInterface()
+ {
+ interface = 0;
+ }
+ ~PrivateSelectionInterface(){}
+ // Data Members
+ SelectionDCOPInterface *interface;
+ };
+
+}
+
+unsigned int SelectionInterface::globalSelectionInterfaceNumber = 0;
+
+SelectionInterface::SelectionInterface()
+{
+ d = new PrivateSelectionInterface();
+ globalSelectionInterfaceNumber++;
+ mySelectionInterfaceNumber = globalSelectionInterfaceNumber;
+ QString name = "SelectionInterface#" + QString::number(mySelectionInterfaceNumber);
+ d->interface = new SelectionDCOPInterface(this, name.latin1());
+}
+SelectionInterface::~SelectionInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int SelectionInterface::selectionInterfaceNumber () const
+{
+ return mySelectionInterfaceNumber;
+}
+
+void SelectionInterface::setSelectionInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("SelectionInterface#"+suffix);
+}
+
+SelectionInterface *KTextEditor::selectionInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<SelectionInterface*>(doc->qt_cast("KTextEditor::SelectionInterface"));
+}
+
+SelectionInterface *KTextEditor::selectionInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<SelectionInterface*>(view->qt_cast("KTextEditor::SelectionInterface"));
+}
+
diff --git a/interfaces/ktexteditor/selectioninterface.h b/interfaces/ktexteditor/selectioninterface.h
new file mode 100644
index 000000000..48931a02b
--- /dev/null
+++ b/interfaces/ktexteditor/selectioninterface.h
@@ -0,0 +1,100 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_selectioninterface_h__
+#define __ktexteditor_selectioninterface_h__
+
+#include <qstring.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to text selection for the Document class.
+*/
+class KTEXTEDITOR_EXPORT SelectionInterface
+{
+ friend class PrivateSelectionInterface;
+
+ public:
+ SelectionInterface();
+ virtual ~SelectionInterface();
+
+ unsigned int selectionInterfaceNumber () const;
+
+ protected:
+ void setSelectionInterfaceDCOPSuffix (const QCString &suffix);
+
+ /*
+ * slots !!!
+ */
+ public:
+ /**
+ * @return set the selection from line_start,col_start to line_end,col_end
+ */
+ virtual bool setSelection ( unsigned int startLine, unsigned int startCol, unsigned int endLine, unsigned int endCol ) = 0;
+
+ /**
+ * removes the current Selection (not Text)
+ */
+ virtual bool clearSelection () = 0;
+
+ /**
+ * @return true if there is a selection
+ */
+ virtual bool hasSelection () const = 0;
+
+ /**
+ * @return a QString for the selected text
+ */
+ virtual QString selection () const = 0;
+
+ /**
+ * removes the selected Text
+ */
+ virtual bool removeSelectedText () = 0;
+
+ /**
+ * select the whole text
+ */
+ virtual bool selectAll () = 0;
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void selectionChanged () = 0;
+
+ private:
+ class PrivateSelectionInterface *d;
+ static unsigned int globalSelectionInterfaceNumber;
+ unsigned int mySelectionInterfaceNumber;
+};
+
+class Document;
+class View;
+
+KTEXTEDITOR_EXPORT SelectionInterface *selectionInterface (Document *doc);
+KTEXTEDITOR_EXPORT SelectionInterface *selectionInterface (View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/selectioninterfaceext.cpp b/interfaces/ktexteditor/selectioninterfaceext.cpp
new file mode 100644
index 000000000..471cfad65
--- /dev/null
+++ b/interfaces/ktexteditor/selectioninterfaceext.cpp
@@ -0,0 +1,115 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Anders Lund <anders@alweb.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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.
+
+ $Id$
+*/
+
+#include "selectioninterfaceext.h"
+#include "selectionextdcopinterface.h"
+#include "document.h"
+#include "view.h"
+#include <dcopclient.h>
+
+using namespace KTextEditor;
+
+//BEGIN KTextEditor::SelectionInterfaceExt
+class KTextEditor::PrivateSelectionInterfaceExt {
+ public:
+ PrivateSelectionInterfaceExt() : interface( 0 ) {}
+ ~PrivateSelectionInterfaceExt() {}
+
+ SelectionExtDCOPInterface *interface;
+};
+
+unsigned int SelectionInterfaceExt::globalSelectionInterfaceExtNumber = 0;
+
+SelectionInterfaceExt::SelectionInterfaceExt()
+ : d ( new PrivateSelectionInterfaceExt )
+{
+ globalSelectionInterfaceExtNumber++;
+ mySelectionInterfaceExtNumber = globalSelectionInterfaceExtNumber;
+ QString name = "SelectionInterfaceExt#" + QString::number(mySelectionInterfaceExtNumber);
+ d->interface = new SelectionExtDCOPInterface(this, name.latin1());
+}
+
+SelectionInterfaceExt::~SelectionInterfaceExt()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int SelectionInterfaceExt::selectionInterfaceExtNumber () const
+{
+ return mySelectionInterfaceExtNumber;
+}
+
+void SelectionInterfaceExt::setSelectionInterfaceExtDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("SelectionInterfaceExt#"+suffix);
+}
+
+SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<SelectionInterfaceExt*>(doc->qt_cast("KTextEditor::SelectionInterfaceExt"));
+}
+
+SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<SelectionInterfaceExt*>(view->qt_cast("KTextEditor::SelectionInterfaceExt"));
+}
+
+//END KTextEditor::SelectionInterfaceExt
+
+//BEGIN KTextEditor::SelectionExtDCOPInterface
+SelectionExtDCOPInterface::SelectionExtDCOPInterface(
+ SelectionInterfaceExt *parent, const char* name )
+ : DCOPObject( name ),
+ m_parent( parent )
+{
+}
+
+SelectionExtDCOPInterface::~SelectionExtDCOPInterface()
+{
+}
+
+int SelectionExtDCOPInterface::selStartLine()
+{
+ return m_parent->selStartLine();
+}
+
+int SelectionExtDCOPInterface::selStartCol()
+{
+ return m_parent->selStartCol();
+}
+
+int SelectionExtDCOPInterface::selEndLine()
+{
+ return m_parent->selEndLine();
+}
+
+int SelectionExtDCOPInterface::selEndCol()
+{
+ return m_parent->selEndCol();
+}
+//END KTextEditor::SelectionExtDCOPInterface
diff --git a/interfaces/ktexteditor/selectioninterfaceext.h b/interfaces/ktexteditor/selectioninterfaceext.h
new file mode 100644
index 000000000..6b033ff34
--- /dev/null
+++ b/interfaces/ktexteditor/selectioninterfaceext.h
@@ -0,0 +1,74 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Anders Lund <anders@alweb.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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.
+
+ $Id$
+*/
+
+#ifndef __ktexteditor_selectioninterface_ext_h__
+#define __ktexteditor_selectioninterface_ext_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+ Provide access to seleciton positions.
+ This is an interface for the Document class.
+ Mainly here for dcop and the sake of scripting.
+ @author Anders Lund <anders@alweb.dk>
+*/
+class KTEXTEDITOR_EXPORT SelectionInterfaceExt
+{
+ friend class PrivateSelectionInterfaceExt;
+
+ public:
+ SelectionInterfaceExt();
+ virtual ~SelectionInterfaceExt();
+
+ unsigned int selectionInterfaceExtNumber () const;
+
+ protected:
+ void setSelectionInterfaceExtDCOPSuffix (const QCString &suffix);
+
+ public:
+ /** The selection start line number */
+ virtual int selStartLine()=0;
+ /** The selection start col */
+ virtual int selStartCol()=0;
+ /** The selection end line */
+ virtual int selEndLine()=0;
+ /** The selection end col */
+ virtual int selEndCol()=0;
+
+ private:
+ class PrivateSelectionInterfaceExt *d;
+ static unsigned int globalSelectionInterfaceExtNumber;
+ unsigned int mySelectionInterfaceExtNumber;
+};
+
+class Document;
+class View;
+
+KTEXTEDITOR_EXPORT SelectionInterfaceExt *selectionInterfaceExt (Document *doc);
+KTEXTEDITOR_EXPORT SelectionInterfaceExt *selectionInterfaceExt (View *view);
+
+} // namespace KTextEditor
+#endif
diff --git a/interfaces/ktexteditor/sessionconfiginterface.cpp b/interfaces/ktexteditor/sessionconfiginterface.cpp
new file mode 100644
index 000000000..be159bb4d
--- /dev/null
+++ b/interfaces/ktexteditor/sessionconfiginterface.cpp
@@ -0,0 +1,88 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "sessionconfiginterface.h"
+
+#include "document.h"
+#include "view.h"
+#include "plugin.h"
+
+namespace KTextEditor
+{
+
+class PrivateSessionConfigInterface
+{
+ public:
+ PrivateSessionConfigInterface() {}
+ ~PrivateSessionConfigInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int SessionConfigInterface::globalSessionConfigInterfaceNumber = 0;
+
+SessionConfigInterface::SessionConfigInterface()
+{
+ globalSessionConfigInterfaceNumber++;
+ mySessionConfigInterfaceNumber = globalSessionConfigInterfaceNumber++;
+
+ d = new PrivateSessionConfigInterface();
+}
+
+SessionConfigInterface::~SessionConfigInterface()
+{
+ delete d;
+}
+
+unsigned int SessionConfigInterface::configInterfaceNumber () const
+{
+ return mySessionConfigInterfaceNumber;
+}
+
+void SessionConfigInterface::setSessionConfigInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("SessionConfigInterface#"+suffix);
+}
+
+SessionConfigInterface *KTextEditor::sessionConfigInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<SessionConfigInterface*>(doc->qt_cast("KTextEditor::SessionConfigInterface"));
+}
+
+SessionConfigInterface *KTextEditor::sessionConfigInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<SessionConfigInterface*>(view->qt_cast("KTextEditor::SessionConfigInterface"));
+}
+
+SessionConfigInterface *KTextEditor::sessionConfigInterface (Plugin *plugin)
+{
+ if (!plugin)
+ return 0;
+
+ return static_cast<SessionConfigInterface*>(plugin->qt_cast("KTextEditor::SessionConfigInterface"));
+}
diff --git a/interfaces/ktexteditor/sessionconfiginterface.h b/interfaces/ktexteditor/sessionconfiginterface.h
new file mode 100644
index 000000000..fe392559b
--- /dev/null
+++ b/interfaces/ktexteditor/sessionconfiginterface.h
@@ -0,0 +1,71 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_sessionconfiginterface_h__
+#define __ktexteditor_sessionconfiginterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+class KConfig;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to session-specific configuration of the
+* Document, Plugin and PluginViewInterface classes.
+*/
+class KTEXTEDITOR_EXPORT SessionConfigInterface
+{
+ friend class PrivateSessionConfigInterface;
+
+ public:
+ SessionConfigInterface();
+ virtual ~SessionConfigInterface();
+
+ unsigned int configInterfaceNumber () const;
+
+ protected:
+ void setSessionConfigInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ * Read/Write session config of only this document/view/plugin
+ * In case of the document, that means for example it should reload the file,
+ * restore all marks, ...
+ */
+ virtual void readSessionConfig (KConfig *) = 0;
+ virtual void writeSessionConfig (KConfig *) = 0;
+
+ private:
+ class PrivateSessionConfigInterface *d;
+ static unsigned int globalSessionConfigInterfaceNumber;
+ unsigned int mySessionConfigInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class Document *doc);
+KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class View *view);
+KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class Plugin *plugin);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/templateinterface.cpp b/interfaces/ktexteditor/templateinterface.cpp
new file mode 100644
index 000000000..3a96a8d5a
--- /dev/null
+++ b/interfaces/ktexteditor/templateinterface.cpp
@@ -0,0 +1,197 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004 Joseph Wenninger <jowenn@kde.org>
+
+ 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 "templateinterface.h"
+#include "document.h"
+#include <stdaddressbook.h>
+#include <addressee.h>
+#include <addresseedialog.h>
+#include <qstring.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <qdatetime.h>
+#include <qregexp.h>
+#include <kmessagebox.h>
+#include <kcalendarsystem.h>
+#include <unistd.h>
+
+#include <kdebug.h>
+
+using namespace KTextEditor;
+
+unsigned int TemplateInterface::globalTemplateInterfaceNumber = 0;
+
+TemplateInterface::TemplateInterface()
+{
+ myTemplateInterfaceNumber = globalTemplateInterfaceNumber++;
+}
+
+TemplateInterface::~TemplateInterface()
+{}
+
+uint TemplateInterface::templateInterfaceNumber () const
+{
+ return myTemplateInterfaceNumber;
+}
+
+void TemplateInterface::setTemplateInterfaceDCOPSuffix ( const QCString &suffix )
+{}
+
+#define INITKABC do { \
+ if (addrBook==0) { \
+ addrBook=KABC::StdAddressBook::self(); \
+ userAddress=addrBook->whoAmI(); \
+ if (userAddress.isEmpty()) { \
+ if ( KMessageBox::questionYesNo(parentWindow, \
+ i18n( "This template uses personal data that is stored in the KDE addressbook, but you have not selected a personal entry. You can still use the template without one, but you will have to type personal data. Would you like to select one now?" ), \
+ "Personal data requested", \
+ KStdGuiItem::yes(), KStdGuiItem::no(), "select personal data entry") == KMessageBox::Yes ) { \
+ userAddress = KABC::AddresseeDialog::getAddressee(parentWindow); \
+ if ( ! userAddress.isEmpty() ) \
+ KABC::StdAddressBook::self()->setWhoAmI( userAddress ); \
+ }\
+ /*return false;//no, why??*/ \
+ } \
+ } \
+} while(false)
+
+bool TemplateInterface::expandMacros( QMap<QString, QString> &map, QWidget *parentWindow )
+{
+ KABC::StdAddressBook *addrBook = 0;
+ KABC::Addressee userAddress;
+ QDateTime datetime = QDateTime::currentDateTime();
+ QDate date = datetime.date();
+ QTime time = datetime.time();
+
+ QMap<QString,QString>::Iterator it;
+ for ( it = map.begin(); it != map.end(); ++it )
+ {
+ QString placeholder = it.key();
+ if ( map[ placeholder ].isEmpty() )
+ {
+ if ( placeholder == "index" ) map[ placeholder ] = "i";
+ else if ( placeholder == "loginname" )
+ {}
+ else if ( placeholder == "firstname" )
+ {
+ INITKABC;
+ if ( !userAddress.isEmpty() )
+ map[ placeholder ] = userAddress.givenName();
+ }
+ else if ( placeholder == "lastname" )
+ {
+ INITKABC;
+ if ( !userAddress.isEmpty() )
+ map[ placeholder ] = userAddress.familyName();
+ }
+ else if ( placeholder == "fullname" )
+ {
+ INITKABC;
+ if ( !userAddress.isEmpty() )
+ map[ placeholder ] = userAddress.assembledName();
+ }
+ else if ( placeholder == "email" )
+ {
+ INITKABC;
+ if ( !userAddress.isEmpty() )
+ map[ placeholder ] = userAddress.preferredEmail();
+ }
+ else if ( placeholder == "date" )
+ {
+ map[ placeholder ] = KGlobal::locale() ->formatDate( date, true );
+ }
+ else if ( placeholder == "time" )
+ {
+ map[ placeholder ] = KGlobal::locale() ->formatTime( time, true, false );
+ }
+ else if ( placeholder == "year" )
+ {
+ map[ placeholder ] = KGlobal::locale() ->calendar() ->yearString( date, false );
+ }
+ else if ( placeholder == "month" )
+ {
+ map[ placeholder ] = QString::number( KGlobal::locale() ->calendar() ->month( date ) );
+ }
+ else if ( placeholder == "day" )
+ {
+ map[ placeholder ] = QString::number( KGlobal::locale() ->calendar() ->day( date ) );
+ }
+ else if ( placeholder == "hostname" )
+ {
+ char hostname[ 256 ];
+ hostname[ 0 ] = 0;
+ gethostname( hostname, 255 );
+ hostname[ 255 ] = 0;
+ map[ placeholder ] = QString::fromLocal8Bit( hostname );
+ }
+ else if ( placeholder == "cursor" )
+ {
+ map[ placeholder ] = "|";
+ }
+ else map[ placeholder ] = placeholder;
+ }
+ }
+ return true;
+}
+
+bool TemplateInterface::insertTemplateText ( uint line, uint column, const QString &templateString, const QMap<QString, QString> &initialValues, QWidget *parentWindow )
+{
+ QMap<QString, QString> enhancedInitValues( initialValues );
+
+ QRegExp rx( "[$%]\\{([^}\\s]+)\\}" );
+ rx.setMinimal( true );
+ int pos = 0;
+ int opos = 0;
+
+ while ( pos >= 0 )
+ {
+ pos = rx.search( templateString, pos );
+
+ if ( pos > -1 )
+ {
+ if ( ( pos - opos ) > 0 )
+ {
+ if ( templateString[ pos - 1 ] == '\\' )
+ {
+ pos = opos = pos + 1;
+ continue;
+ }
+ }
+ QString placeholder = rx.cap( 1 );
+ if ( ! enhancedInitValues.contains( placeholder ) )
+ enhancedInitValues[ placeholder ] = "";
+
+ pos += rx.matchedLength();
+ opos = pos;
+ }
+ }
+
+ return expandMacros( enhancedInitValues, parentWindow )
+ && insertTemplateTextImplementation( line, column, templateString, enhancedInitValues, parentWindow );
+}
+
+
+
+TemplateInterface *KTextEditor::templateInterface ( KTextEditor::Document *doc )
+{
+ if ( !doc )
+ return 0;
+
+ return static_cast<TemplateInterface*>( doc->qt_cast( "KTextEditor::TemplateInterface" ) );
+}
+
diff --git a/interfaces/ktexteditor/templateinterface.h b/interfaces/ktexteditor/templateinterface.h
new file mode 100644
index 000000000..c4cbca6b7
--- /dev/null
+++ b/interfaces/ktexteditor/templateinterface.h
@@ -0,0 +1,131 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004 Joseph Wenninger <jowenn@kde.org>
+
+ 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 __ktexteditor_templateinterface_h__
+#define __ktexteditor_templateinterface_h__
+
+#include <qstring.h>
+#include <qmap.h>
+#include <qwidget.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+class Document;
+
+/**
+ * This is an interface for inserting template strings with user editable
+ * fields into a document.
+ */
+class KTEXTEDITOR_EXPORT TemplateInterface //should be named AbstractTemplateInterface, but for consistency with the other classes it is not (for the 3.x release series)
+{
+ friend class PrivateTemplateInterface;
+
+ public:
+ TemplateInterface();
+ virtual ~TemplateInterface();
+
+ /**
+ * Parses @p templateString for macros in the form [$%]{NAME} and finds
+ * the value corresponding to NAME if any. The NAME string may contain
+ * any non-whitespace character execpt '}'
+ * @param initialValues a map with the keys for the macros to expand.
+ * keys with a value are ignored.
+ * @param parentWindow is used if dialogs have to be shown
+ * @return true if all macros was sucessfully expanded
+ * @see insertTemplateText for a list of supported macros
+ */
+ static bool expandMacros( QMap<QString, QString> &initialValues, QWidget *parentWindow );
+
+ uint templateInterfaceNumber () const;
+
+ protected:
+ void setTemplateInterfaceDCOPSuffix (const QCString &suffix);
+
+ public:
+
+ /**
+ * Inserts an interactive ediable template text at line "line", column "col".
+ * @p parentWindow is used if dialogs have to be shown
+ * @return true if inserting the string succeeded
+ *
+ * Use insertTemplateText(numLines(), ...) to append text at end of document
+ * Template strings look like
+ * "for( int ${index}=0;${index}<10;${index}++) { ${cursor} };"
+ * or "%{date}"
+ *
+ * This syntax is somewhat similiar to the one found in the Eclipse editor.
+ *
+ * There are certain common placeholders (macros), which get assigned a
+ * default initialValue, If the second parameter does not a given value.
+ * For all others the initial value is the name of the placeholder.
+ *
+ * Placeholder names may only consist of a-zA-Z0-9_
+ * Common placeholders and values are
+ *
+ * - index: "i"
+ * - loginname: The current users's loginname
+ * - firstname: The current user's first name retrieved from kabc
+ * - lastname: The current user's last name retrieved from kabc
+ * - fullname: The current user's first and last name retrieved from kabc
+ * - email: The current user's primary email adress retrieved from kabc
+ * - date: current date
+ * - time: current time
+ * - year: current year
+ * - month: current month
+ * - day: current day
+ * - hostname: hostname of the computer
+ * - cursor: at this position the cursor will be after editing of the
+ * template has finished, this has to be taken care of by the actual
+ * implementation. The placeholder gets a value of "|" assigned.
+ *
+ * If a macro is started with a % (persent sign) like "%{date}" it isn't added
+ * to the list editable strings ( for example TAB key navigation) if a value
+ * differing from the macro name is found.
+ *
+ * If the editor supports some kind of smart indentation, the inserted code
+ * should be layouted by the indenter.
+ */
+ bool insertTemplateText ( uint line, uint column, const QString &templateString, const QMap<QString,QString> &initialValues, QWidget *parentWindow=0);
+
+protected:
+ /**
+ * You must implement this, it is called by insertTemplateText, after all
+ * default values are inserted. If you are implementing this interface,
+ * this method should work as described in the documentation for
+ * insertTemplateText above.
+ * @return true if any text was inserted.
+ */
+ virtual bool insertTemplateTextImplementation ( uint line, uint column, const QString &templateString, const QMap<QString,QString> &initialValues, QWidget *parentWindow=0 )=0;
+
+ /**
+ * only for the interface itself - REAL PRIVATE
+ */
+ private:
+ class PrivateTemplateInterface *d;
+ static uint globalTemplateInterfaceNumber;
+ uint myTemplateInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT TemplateInterface *templateInterface (Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/texthintinterface.cpp b/interfaces/ktexteditor/texthintinterface.cpp
new file mode 100644
index 000000000..079a1edda
--- /dev/null
+++ b/interfaces/ktexteditor/texthintinterface.cpp
@@ -0,0 +1,66 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ 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 "texthintinterface.h"
+#include "view.h"
+
+using namespace KTextEditor;
+
+namespace KTextEditor
+{
+ class PrivateTextHintInterface
+ {
+ public:
+ PrivateTextHintInterface() {}
+ ~PrivateTextHintInterface(){}
+
+ };
+
+unsigned int TextHintInterface::globalTextHintInterfaceNumber = 0;
+
+TextHintInterface::TextHintInterface()
+{
+ globalTextHintInterfaceNumber++;
+ myTextHintInterfaceNumber = globalTextHintInterfaceNumber++;
+
+ d = new PrivateTextHintInterface();
+}
+
+TextHintInterface::~TextHintInterface()
+{
+ delete d;
+}
+
+unsigned int TextHintInterface::textHintInterfaceNumber () const
+{
+ return myTextHintInterfaceNumber;
+}
+
+
+TextHintInterface *textHintInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<TextHintInterface*>(view->qt_cast("KTextEditor::TextHintInterface"));
+}
+
+
+}
+
diff --git a/interfaces/ktexteditor/texthintinterface.h b/interfaces/ktexteditor/texthintinterface.h
new file mode 100644
index 000000000..3b5f0476d
--- /dev/null
+++ b/interfaces/ktexteditor/texthintinterface.h
@@ -0,0 +1,79 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ 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 __ktexteditor_texthintinterface_h__
+#define __ktexteditor_texthintinterface_h__
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <kdelibs_export.h>
+
+namespace KTextEditor
+{
+
+/**
+ * This is an interface for the KTextEditor::View class.
+
+ */
+class KTEXTEDITOR_EXPORT TextHintInterface
+{
+ friend class PrivateTextHintInterface;
+public:
+ TextHintInterface();
+ virtual ~TextHintInterface();
+
+ /**
+ * enable Texthints. If they are enabled a signal needTextHint is emitted, if the mouse
+ * changed the position and a new character is beneath the mouse cursor. The signal is delayed
+ * for a certain time, specifiedin the timeout parameter.
+ */
+ virtual void enableTextHints(int timeout)=0;
+
+ /**
+ * Disable texthints. Per default they are disabled.
+ */
+ virtual void disableTextHints()=0;
+
+ /**
+ * This method returns a number, unique during one application run
+ *
+ */
+ unsigned int textHintInterfaceNumber () const;
+
+
+ //signals
+
+ /**
+ * emit this signal, if a tooltip text is needed for displaying.
+ * I you don't want a tooltip to be displayd set text to an emtpy string in a connected slot,
+ * otherwise set text to the string you want the editor to display
+ */
+ virtual void needTextHint(int line, int col, QString &text)=0;
+
+ private:
+ class PrivateTextHintInterface *d;
+ static unsigned int globalTextHintInterfaceNumber;
+ unsigned int myTextHintInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT TextHintInterface *textHintInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/undodcopinterface.cpp b/interfaces/ktexteditor/undodcopinterface.cpp
new file mode 100644
index 000000000..69eb2ebd5
--- /dev/null
+++ b/interfaces/ktexteditor/undodcopinterface.cpp
@@ -0,0 +1,57 @@
+#include "undodcopinterface.h"
+#include "undointerface.h"
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+UndoDCOPInterface::UndoDCOPInterface( UndoInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+UndoDCOPInterface::~UndoDCOPInterface()
+{
+
+}
+
+uint UndoDCOPInterface::undoInterfaceNumber ()
+{
+ return m_parent->undoInterfaceNumber();
+}
+void UndoDCOPInterface::undo ()
+{
+ m_parent->undo();
+}
+void UndoDCOPInterface::redo ()
+{
+ m_parent->redo();
+}
+void UndoDCOPInterface::clearUndo ()
+{
+ m_parent->clearUndo();
+}
+void UndoDCOPInterface::clearRedo ()
+{
+ m_parent->clearRedo();
+}
+uint UndoDCOPInterface::undoCount ()
+{
+ return m_parent->undoCount();
+}
+uint UndoDCOPInterface::redoCount ()
+{
+ return m_parent->redoCount();
+}
+uint UndoDCOPInterface::undoSteps ()
+{
+ return m_parent->undoSteps();
+}
+void UndoDCOPInterface::setUndoSteps ( uint steps )
+{
+ m_parent->setUndoSteps(steps);
+}
+void UndoDCOPInterface::undoChanged ()
+{
+ m_parent->undoChanged();
+}
diff --git a/interfaces/ktexteditor/undodcopinterface.h b/interfaces/ktexteditor/undodcopinterface.h
new file mode 100644
index 000000000..ff184fea4
--- /dev/null
+++ b/interfaces/ktexteditor/undodcopinterface.h
@@ -0,0 +1,54 @@
+#ifndef Undo_DCOP_INTERFACE_H
+#define Undo_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+//#include "editdcopinterface.moc"
+namespace KTextEditor
+{
+ class UndoInterface;
+ /**
+ This is the main interface to the UndoInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to UndoInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT UndoDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent UndoInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ UndoDCOPInterface( UndoInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~UndoDCOPInterface();
+ k_dcop:
+ uint undoInterfaceNumber ();
+ void undo ();
+ void redo () ;
+ void clearUndo () ;
+ void clearRedo () ;
+ uint undoCount () ;
+ uint redoCount ();
+ uint undoSteps () ;
+ void setUndoSteps ( uint steps );
+ void undoChanged ();
+
+
+ private:
+ UndoInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/undointerface.cpp b/interfaces/ktexteditor/undointerface.cpp
new file mode 100644
index 000000000..b0319f9c2
--- /dev/null
+++ b/interfaces/ktexteditor/undointerface.cpp
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "undointerface.h"
+#include "undodcopinterface.h"
+#include "document.h"
+
+namespace KTextEditor
+{
+
+class PrivateUndoInterface
+{
+ public:
+ PrivateUndoInterface() {interface = 0;}
+ ~PrivateUndoInterface() {}
+ UndoDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int UndoInterface::globalUndoInterfaceNumber = 0;
+
+UndoInterface::UndoInterface()
+{
+ globalUndoInterfaceNumber++;
+ myUndoInterfaceNumber = globalUndoInterfaceNumber++;
+
+ d = new PrivateUndoInterface();
+ QString name = "UndoInterface#" + QString::number(myUndoInterfaceNumber);
+ d->interface = new UndoDCOPInterface(this, name.latin1());
+}
+
+UndoInterface::~UndoInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int UndoInterface::undoInterfaceNumber () const
+{
+ return myUndoInterfaceNumber;
+}
+
+void UndoInterface::setUndoInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("UndoInterface#"+suffix);
+}
+
+UndoInterface *KTextEditor::undoInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<UndoInterface*>(doc->qt_cast("KTextEditor::UndoInterface"));
+}
diff --git a/interfaces/ktexteditor/undointerface.h b/interfaces/ktexteditor/undointerface.h
new file mode 100644
index 000000000..73146107e
--- /dev/null
+++ b/interfaces/ktexteditor/undointerface.h
@@ -0,0 +1,84 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_undointerface_h__
+#define __ktexteditor_undointerface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to undo functionality of a Document.
+*/
+class KTEXTEDITOR_EXPORT UndoInterface
+{
+ friend class PrivateUndoInterface;
+
+ public:
+ UndoInterface ();
+ virtual ~UndoInterface ();
+
+ unsigned int undoInterfaceNumber () const;
+
+ protected:
+ void setUndoInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ virtual void undo () = 0;
+
+ virtual void redo () = 0;
+
+ virtual void clearUndo () = 0;
+
+ virtual void clearRedo () = 0;
+
+ virtual unsigned int undoCount () const = 0;
+
+ virtual unsigned int redoCount () const = 0;
+
+ /**
+ returns the maximum of undo steps possible, 0 means no limit !
+ */
+ virtual unsigned int undoSteps () const = 0;
+
+ virtual void setUndoSteps ( unsigned int steps ) = 0;
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void undoChanged () = 0;
+
+ private:
+ class PrivateUndoInterface *d;
+ static unsigned int globalUndoInterfaceNumber;
+ unsigned int myUndoInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT UndoInterface *undoInterface (class Document *doc);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/variableinterface.cpp b/interfaces/ktexteditor/variableinterface.cpp
new file mode 100644
index 000000000..0ac55167e
--- /dev/null
+++ b/interfaces/ktexteditor/variableinterface.cpp
@@ -0,0 +1,48 @@
+/*
+ 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.
+
+ ---
+ Copyright (C) 2004, Anders Lund <anders@alweb.dk>
+*/
+
+#include "variableinterface.h"
+#include "document.h"
+
+using namespace KTextEditor;
+
+unsigned int VariableInterface::globalVariableInterfaceNumber = 0;
+
+VariableInterface::VariableInterface()
+{
+ globalVariableInterfaceNumber++;
+ myVariableInterfaceNumber = globalVariableInterfaceNumber++;
+}
+
+VariableInterface::~VariableInterface()
+{
+}
+
+unsigned int VariableInterface::variableInterfaceNumber()
+{
+ return myVariableInterfaceNumber;
+}
+
+VariableInterface *KTextEditor::variableInterface( Document *doc )
+{
+ if ( ! doc )
+ return 0;
+
+ return static_cast<VariableInterface*>(doc->qt_cast("KTextEditor::VariableInterface"));
+}
diff --git a/interfaces/ktexteditor/variableinterface.h b/interfaces/ktexteditor/variableinterface.h
new file mode 100644
index 000000000..84ed6013e
--- /dev/null
+++ b/interfaces/ktexteditor/variableinterface.h
@@ -0,0 +1,72 @@
+/*
+ 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.
+
+ ---
+ Copyright (C) 2004, Anders Lund <anders@alweb.dk>
+*/
+#ifndef _KTEXTEDITOR_VARIABLE_INTERFACE_H_
+#define _KTEXTEDITOR_VARIABLE_INTERFACE_H_
+
+#include <kdelibs_export.h>
+
+class QString;
+
+namespace KTextEditor {
+
+/**
+ * This interface is designed to provide access to "document variables",
+ * for example variables defined in files like "kate: variable value;"
+ * or the emacs style "-*- variable: value -*-".
+ *
+ * The purpose is to allow KTE plugins to use variables.
+ * A document implementing this interface should return values for variable
+ * that it does not otherwise know how to use, since they could be of interrest
+ * to plugins. A document implementing this interface must emit the variableChanged()
+ * signal whenever a variable is set that it will return a value for.
+ *
+ * @short KTextEditor interface to Document Variables
+ */
+class KTEXTEDITOR_EXPORT VariableInterface
+{
+ public:
+ VariableInterface();
+ virtual ~VariableInterface();
+
+ unsigned int variableInterfaceNumber();
+
+ /**
+ * @return the value of the variable @p name, or an empty string if the
+ * variable is not set or has no value.
+ */
+ virtual QString variable( const QString &name ) const = 0;
+
+ //
+ // signals!!
+ //
+ public:
+ /**
+ * Signal: emitted when a variable is set
+ */
+ virtual void variableChanged( const QString &variable, const QString &value ) = 0;
+
+ private:
+ static unsigned int globalVariableInterfaceNumber;
+ unsigned int myVariableInterfaceNumber;
+};
+
+
+KTEXTEDITOR_EXPORT VariableInterface *variableInterface( class Document * );
+} // namespace KTextEditor
+#endif //_KTEXTEDITOR_VARIABLE_INTERFACE_H_
diff --git a/interfaces/ktexteditor/view.h b/interfaces/ktexteditor/view.h
new file mode 100644
index 000000000..e05dac5c7
--- /dev/null
+++ b/interfaces/ktexteditor/view.h
@@ -0,0 +1,68 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_view_h__
+#define __ktexteditor_view_h__
+
+#include <qwidget.h>
+#include <kxmlguiclient.h>
+
+namespace KTextEditor
+{
+
+/**
+ * The View class represents a single view of a Document .
+ */
+
+class KTEXTEDITOR_EXPORT View : public QWidget, public KXMLGUIClient
+{
+ friend class PrivateView;
+
+ Q_OBJECT
+
+ public:
+ /**
+ * Create a new view to the given document. The document must be non-null.
+ */
+ View ( class Document *, QWidget *parent, const char *name = 0 );
+ virtual ~View ();
+
+ /**
+ * Returns the number of this view
+ */
+ unsigned int viewNumber () const;
+
+ /**
+ * Returns the DCOP suffix to allow identification of this view's DCOP interface.
+ */
+ QCString viewDCOPSuffix () const;
+
+ /**
+ * Acess the parent Document.
+ */
+ virtual class Document *document () const = 0;
+
+ private:
+ class PrivateView *d;
+ static unsigned int globalViewNumber;
+ unsigned int myViewNumber;
+};
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/viewcursordcopinterface.cpp b/interfaces/ktexteditor/viewcursordcopinterface.cpp
new file mode 100644
index 000000000..e6235ac9a
--- /dev/null
+++ b/interfaces/ktexteditor/viewcursordcopinterface.cpp
@@ -0,0 +1,68 @@
+#include "viewcursordcopinterface.h"
+#include "viewcursorinterface.h"
+
+#include <qpoint.h>
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+ViewCursorDCOPInterface::ViewCursorDCOPInterface( ViewCursorInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+ViewCursorDCOPInterface::~ViewCursorDCOPInterface()
+{
+
+}
+
+uint ViewCursorDCOPInterface::viewCursorInterfaceNumber ()
+{
+ return m_parent->viewCursorInterfaceNumber ();
+}
+
+::QPoint ViewCursorDCOPInterface::cursorCoordinates ()
+{
+ return m_parent->cursorCoordinates ();
+}
+
+void ViewCursorDCOPInterface::cursorPosition (uint line, uint col)
+{
+ m_parent->cursorPosition (&line, &col);
+}
+
+void ViewCursorDCOPInterface::cursorPositionReal (uint line, uint col)
+{
+ m_parent->cursorPositionReal (&line, &col);
+}
+
+bool ViewCursorDCOPInterface::setCursorPosition (uint line, uint col)
+{
+ return m_parent->setCursorPosition ( line, col);
+}
+
+bool ViewCursorDCOPInterface::setCursorPositionReal (uint line, uint col)
+{
+ return m_parent->setCursorPositionReal ( line, col);
+}
+
+uint ViewCursorDCOPInterface::cursorLine ()
+{
+ return m_parent->cursorLine ();
+}
+
+uint ViewCursorDCOPInterface::cursorColumn ()
+{
+ return m_parent->cursorColumn ();
+}
+
+uint ViewCursorDCOPInterface::cursorColumnReal ()
+{
+ return m_parent->cursorColumnReal ();
+}
+
+void ViewCursorDCOPInterface::cursorPositionChanged ()
+{
+ m_parent->cursorPositionChanged ();
+}
diff --git a/interfaces/ktexteditor/viewcursordcopinterface.h b/interfaces/ktexteditor/viewcursordcopinterface.h
new file mode 100644
index 000000000..9dd974a7d
--- /dev/null
+++ b/interfaces/ktexteditor/viewcursordcopinterface.h
@@ -0,0 +1,74 @@
+#ifndef ViewCursor_DCOP_INTERFACE_H
+#define ViewCursor_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+//#include "editdcopinterface.moc"
+namespace KTextEditor
+{
+ class ViewCursorInterface;
+ /**
+ This is the main interface to the ViewCursorInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to ViewCursorInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT ViewCursorDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent ViewCursorInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ ViewCursorDCOPInterface( ViewCursorInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~ViewCursorDCOPInterface();
+ k_dcop:
+
+ uint viewCursorInterfaceNumber ();
+ /**
+ * Get the current cursor coordinates in pixels.
+ */
+ class QPoint cursorCoordinates ();
+
+ /**
+ * Get the cursor position
+ */
+ void cursorPosition (uint line, uint col);
+
+ /**
+ * Get the cursor position, calculated with 1 character per tab
+ */
+ void cursorPositionReal (uint line, uint col);
+
+ /**
+ * Set the cursor position
+ */
+ bool setCursorPosition (uint line, uint col);
+
+ /**
+ * Set the cursor position, use 1 character per tab
+ */
+ bool setCursorPositionReal (uint line, uint col);
+
+ uint cursorLine ();
+ uint cursorColumn ();
+ uint cursorColumnReal ();
+ void cursorPositionChanged ();
+
+ private:
+ ViewCursorInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/viewcursorinterface.cpp b/interfaces/ktexteditor/viewcursorinterface.cpp
new file mode 100644
index 000000000..5e9503984
--- /dev/null
+++ b/interfaces/ktexteditor/viewcursorinterface.cpp
@@ -0,0 +1,74 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "viewcursorinterface.h"
+#include "viewcursordcopinterface.h"
+#include "view.h"
+
+namespace KTextEditor
+{
+
+class PrivateViewCursorInterface
+{
+ public:
+ PrivateViewCursorInterface() {interface=0;}
+ ~PrivateViewCursorInterface() {}
+ ViewCursorDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int ViewCursorInterface::globalViewCursorInterfaceNumber = 0;
+
+ViewCursorInterface::ViewCursorInterface()
+{
+ globalViewCursorInterfaceNumber++;
+ myViewCursorInterfaceNumber = globalViewCursorInterfaceNumber++;
+
+ d = new PrivateViewCursorInterface();
+ QString name = "ViewCursorInterface#" + QString::number(myViewCursorInterfaceNumber);
+ d->interface = new ViewCursorDCOPInterface(this, name.latin1());
+}
+
+ViewCursorInterface::~ViewCursorInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int ViewCursorInterface::viewCursorInterfaceNumber () const
+{
+ return myViewCursorInterfaceNumber;
+}
+
+void ViewCursorInterface::setViewCursorInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("ViewCursorInterface#"+suffix);
+}
+
+ViewCursorInterface *KTextEditor::viewCursorInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<ViewCursorInterface*>(view->qt_cast("KTextEditor::ViewCursorInterface"));
+}
diff --git a/interfaces/ktexteditor/viewcursorinterface.h b/interfaces/ktexteditor/viewcursorinterface.h
new file mode 100644
index 000000000..05a427bae
--- /dev/null
+++ b/interfaces/ktexteditor/viewcursorinterface.h
@@ -0,0 +1,95 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_viewcursorinterface_h__
+#define __ktexteditor_viewcursorinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to access the text cursor of a View class.
+*/
+class KTEXTEDITOR_EXPORT ViewCursorInterface
+{
+ friend class PrivateViewCursorInterface;
+
+ public:
+ ViewCursorInterface ();
+ virtual ~ViewCursorInterface ();
+
+ unsigned int viewCursorInterfaceNumber () const;
+
+ protected:
+ void setViewCursorInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ /**
+ * Get the current cursor coordinates in pixels.
+ */
+ virtual class QPoint cursorCoordinates () = 0;
+
+ /**
+ * Get the cursor position
+ */
+ virtual void cursorPosition (unsigned int *line, unsigned int *col) = 0;
+
+ /**
+ * Get the cursor position, calculated with 1 character per tab
+ */
+ virtual void cursorPositionReal (unsigned int *line, unsigned int *col) = 0;
+
+ /**
+ * Set the cursor position
+ */
+ virtual bool setCursorPosition (unsigned int line, unsigned int col) = 0;
+
+ /**
+ * Set the cursor position, use 1 character per tab
+ */
+ virtual bool setCursorPositionReal (unsigned int line, unsigned int col) = 0;
+
+ virtual unsigned int cursorLine () = 0;
+ virtual unsigned int cursorColumn () = 0;
+ virtual unsigned int cursorColumnReal () = 0;
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void cursorPositionChanged () = 0;
+
+ private:
+ class PrivateViewCursorInterface *d;
+ static unsigned int globalViewCursorInterfaceNumber;
+ unsigned int myViewCursorInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT ViewCursorInterface *viewCursorInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp b/interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp
new file mode 100644
index 000000000..4cd2c6c2d
--- /dev/null
+++ b/interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp
@@ -0,0 +1,29 @@
+#include "viewstatusmsgdcopinterface.h"
+#include "viewstatusmsginterface.h"
+
+#include <qstring.h>
+
+#include <dcopclient.h>
+using namespace KTextEditor;
+
+ViewStatusMsgDCOPInterface::ViewStatusMsgDCOPInterface( ViewStatusMsgInterface *Parent, const char *name)
+ : DCOPObject(name)
+{
+ m_parent = Parent;
+}
+
+ViewStatusMsgDCOPInterface::~ViewStatusMsgDCOPInterface()
+{
+
+}
+
+uint ViewStatusMsgDCOPInterface::viewStatusMsgInterfaceNumber ()
+{
+ return m_parent->viewStatusMsgInterfaceNumber ();
+}
+
+void ViewStatusMsgDCOPInterface::viewStatusMsg (QString msg)
+{
+ m_parent->viewStatusMsg(msg);
+}
+
diff --git a/interfaces/ktexteditor/viewstatusmsgdcopinterface.h b/interfaces/ktexteditor/viewstatusmsgdcopinterface.h
new file mode 100644
index 000000000..45d5507d3
--- /dev/null
+++ b/interfaces/ktexteditor/viewstatusmsgdcopinterface.h
@@ -0,0 +1,45 @@
+#ifndef ViewStatusMsg_DCOP_INTERFACE_H
+#define ViewStatusMsg_DCOP_INTERFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+//#include "editdcopinterface.moc"
+namespace KTextEditor
+{
+ class ViewStatusMsgInterface;
+ /**
+ This is the main interface to the ViewStatusMsgInterface of KTextEdit.
+ This will provide a consistant dcop interface to all KDE applications that use it.
+ @short DCOP interface to ViewStatusMsgInterface.
+ @author Ian Reinhart Geiser <geiseri@kde.org>
+ */
+ class KTEXTEDITOR_EXPORT ViewStatusMsgDCOPInterface : virtual public DCOPObject
+ {
+ K_DCOP
+
+ public:
+ /**
+ Construct a new interface object for the text editor.
+ @param Parent the parent ViewStatusMsgInterface object
+ that will provide us with the functions for the interface.
+ @param name the QObject's name
+ */
+ ViewStatusMsgDCOPInterface( ViewStatusMsgInterface *Parent, const char *name );
+ /**
+ Destructor
+ Cleans up the object.
+ */
+ virtual ~ViewStatusMsgDCOPInterface();
+ k_dcop:
+ uint viewStatusMsgInterfaceNumber ();
+ void viewStatusMsg (class QString msg) ;
+
+ private:
+ ViewStatusMsgInterface *m_parent;
+ };
+}
+#endif
+
+
diff --git a/interfaces/ktexteditor/viewstatusmsginterface.cpp b/interfaces/ktexteditor/viewstatusmsginterface.cpp
new file mode 100644
index 000000000..d519678eb
--- /dev/null
+++ b/interfaces/ktexteditor/viewstatusmsginterface.cpp
@@ -0,0 +1,76 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "viewstatusmsginterface.h"
+#include "viewstatusmsgdcopinterface.h"
+#include "view.h"
+
+#include <qstring.h>
+
+namespace KTextEditor
+{
+
+class PrivateViewStatusMsgInterface
+{
+ public:
+ PrivateViewStatusMsgInterface() {interface=0;}
+ ~PrivateViewStatusMsgInterface() {}
+ ViewStatusMsgDCOPInterface *interface;
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int ViewStatusMsgInterface::globalViewStatusMsgInterfaceNumber = 0;
+
+ViewStatusMsgInterface::ViewStatusMsgInterface()
+{
+ globalViewStatusMsgInterfaceNumber++;
+ myViewStatusMsgInterfaceNumber = globalViewStatusMsgInterfaceNumber++;
+
+ d = new PrivateViewStatusMsgInterface();
+ ::QString name = "ViewStatusMsgInterface#" + ::QString::number(myViewStatusMsgInterfaceNumber);
+ d->interface = new ViewStatusMsgDCOPInterface(this, name.latin1());
+}
+
+ViewStatusMsgInterface::~ViewStatusMsgInterface()
+{
+ delete d->interface;
+ delete d;
+}
+
+unsigned int ViewStatusMsgInterface::viewStatusMsgInterfaceNumber () const
+{
+ return myViewStatusMsgInterfaceNumber;
+}
+
+void ViewStatusMsgInterface::setViewStatusMsgInterfaceDCOPSuffix (const QCString &suffix)
+{
+ d->interface->setObjId ("ViewStatusMsgInterface#"+suffix);
+}
+
+ViewStatusMsgInterface *KTextEditor::viewStatusMsgInterface (View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<ViewStatusMsgInterface*>(view->qt_cast("KTextEditor::ViewStatusMsgInterface"));
+}
diff --git a/interfaces/ktexteditor/viewstatusmsginterface.h b/interfaces/ktexteditor/viewstatusmsginterface.h
new file mode 100644
index 000000000..9c49cab1c
--- /dev/null
+++ b/interfaces/ktexteditor/viewstatusmsginterface.h
@@ -0,0 +1,63 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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 __ktexteditor_viewstatusmsginterface_h__
+#define __ktexteditor_viewstatusmsginterface_h__
+
+#include <kdelibs_export.h>
+
+class QString;
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface for retrieving status bar messages from the Document class.
+*/
+class KTEXTEDITOR_EXPORT ViewStatusMsgInterface
+{
+ friend class PrivateViewStatusMsgInterface;
+
+ public:
+ ViewStatusMsgInterface();
+ virtual ~ViewStatusMsgInterface();
+
+ unsigned int viewStatusMsgInterfaceNumber () const;
+
+ protected:
+ void setViewStatusMsgInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // signals !!!
+ //
+ public:
+ virtual void viewStatusMsg (const class QString &msg) = 0;
+
+
+ private:
+ class PrivateViewStatusMsgInterface *d;
+ static unsigned int globalViewStatusMsgInterfaceNumber;
+ unsigned int myViewStatusMsgInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT ViewStatusMsgInterface *viewStatusMsgInterface (class View *view);
+
+}
+
+#endif
diff --git a/interfaces/ktexteditor/wordwrapinterface.cpp b/interfaces/ktexteditor/wordwrapinterface.cpp
new file mode 100644
index 000000000..9bf01ecff
--- /dev/null
+++ b/interfaces/ktexteditor/wordwrapinterface.cpp
@@ -0,0 +1,70 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ 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.
+*/
+
+// $Id$
+
+#include "wordwrapinterface.h"
+#include "document.h"
+
+
+namespace KTextEditor
+{
+
+class PrivateWordWrapInterface
+{
+ public:
+ PrivateWordWrapInterface() {}
+ ~PrivateWordWrapInterface() {}
+};
+
+}
+
+using namespace KTextEditor;
+
+unsigned int WordWrapInterface::globalWordWrapInterfaceNumber = 0;
+
+WordWrapInterface::WordWrapInterface()
+{
+ globalWordWrapInterfaceNumber++;
+ myWordWrapInterfaceNumber = globalWordWrapInterfaceNumber++;
+
+ d = new PrivateWordWrapInterface();
+}
+
+WordWrapInterface::~WordWrapInterface()
+{
+ delete d;
+}
+
+unsigned int WordWrapInterface::wordWrapInterfaceNumber () const
+{
+ return myWordWrapInterfaceNumber;
+}
+
+void WordWrapInterface::setWordWrapInterfaceDCOPSuffix (const QCString &/*suffix*/)
+{
+ //d->interface->setObjId ("WordWrapInterface#"+suffix);
+}
+
+WordWrapInterface *KTextEditor::wordWrapInterface (Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<WordWrapInterface*>(doc->qt_cast("KTextEditor::WordWrapInterface"));
+}
diff --git a/interfaces/ktexteditor/wordwrapinterface.h b/interfaces/ktexteditor/wordwrapinterface.h
new file mode 100644
index 000000000..81fbb2efa
--- /dev/null
+++ b/interfaces/ktexteditor/wordwrapinterface.h
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ 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 __ktexteditor_wordwrapinterface_h__
+#define __ktexteditor_wordwrapinterface_h__
+
+#include <kdelibs_export.h>
+
+class QCString;
+
+namespace KTextEditor
+{
+
+/**
+* This is an interface to control fixed-column word-wrapping of a Document.
+*/
+class KTEXTEDITOR_EXPORT WordWrapInterface
+{
+ friend class PrivateWordWrapInterface;
+
+ public:
+ WordWrapInterface ();
+ virtual ~WordWrapInterface ();
+
+ unsigned int wordWrapInterfaceNumber () const;
+
+ protected:
+ void setWordWrapInterfaceDCOPSuffix (const QCString &suffix);
+
+ //
+ // slots !!!
+ //
+ public:
+ virtual void setWordWrap (bool) = 0;
+ virtual bool wordWrap () = 0;
+
+ virtual void setWordWrapAt (unsigned int ) = 0;
+ virtual unsigned int wordWrapAt () = 0;
+
+ private:
+ class PrivateWordWrapInterface *d;
+ static unsigned int globalWordWrapInterfaceNumber;
+ unsigned int myWordWrapInterfaceNumber;
+};
+
+KTEXTEDITOR_EXPORT WordWrapInterface *wordWrapInterface (class Document *doc);
+
+}
+
+#endif