27 #include <tdeaction.h> 28 #include <tdeparts/factory.h> 29 #include <tdeparts/componentfactory.h> 31 #include "document.moc" 78 class PrivatePluginViewInterface
81 PrivatePluginViewInterface ()
85 ~PrivatePluginViewInterface ()
103 unsigned int Document::globalDocumentNumber = 0;
104 unsigned int View::globalViewNumber = 0;
105 unsigned int Plugin::globalPluginNumber = 0;
106 unsigned int PluginViewInterface::globalPluginViewInterfaceNumber = 0;
107 unsigned int Editor::globalEditorNumber = 0;
109 Document::Document( TQObject *parent,
const char *name ) :
KTextEditor::
Editor (parent, name )
111 globalDocumentNumber++;
112 myDocumentNumber = globalDocumentNumber;
113 myDocumentListPosition = -1;
116 Document::~Document()
120 unsigned int Document::documentNumber ()
const 122 return myDocumentNumber;
125 long Document::documentListPosition ()
const 127 return myDocumentListPosition;
130 void Document::setDocumentListPosition (
long pos)
132 myDocumentListPosition = pos;
135 TQCString Document::documentDCOPSuffix ()
const 138 num.setNum (documentNumber());
143 View::View(
Document *, TQWidget *parent,
const char *name ) : TQWidget( parent, name )
146 myViewNumber = globalViewNumber;
160 TQCString num1, num2;
162 num2.setNum (
document()->documentNumber());
164 return num2 +
"-" + num1;
167 Plugin::Plugin(
Document *
document,
const char *name ) : TQObject (document, name )
169 globalPluginNumber++;
170 myPluginNumber = globalPluginNumber;
171 d =
new PrivatePlugin ();
180 unsigned int Plugin::pluginNumber ()
const 182 return myPluginNumber;
190 PluginViewInterface::PluginViewInterface()
192 globalPluginViewInterfaceNumber++;
193 myPluginViewInterfaceNumber = globalPluginViewInterfaceNumber;
196 PluginViewInterface::~PluginViewInterface()
200 unsigned int PluginViewInterface::pluginViewInterfaceNumber ()
const 202 return myPluginViewInterfaceNumber;
207 globalEditorNumber++;
208 myEditorNumber = globalEditorNumber;
215 unsigned int Editor::editorNumber ()
const 217 return myEditorNumber;
220 Editor *KTextEditor::createEditor (
const char* libname, TQWidget *parentWidget,
const char *widgetName, TQObject *parent,
const char *name )
222 return KParts::ComponentFactory::createPartInstanceFromLibrary<Editor>( libname, parentWidget, widgetName, parent, name );
225 Document *KTextEditor::createDocument (
const char* libname, TQObject *parent,
const char *name )
227 return KParts::ComponentFactory::createPartInstanceFromLibrary<Document>( libname, 0, 0, parent, name );
230 Plugin *KTextEditor::createPlugin (
const char* libname,
Document *document,
const char *name )
232 return KParts::ComponentFactory::createInstanceFromLibrary<Plugin>( libname, document, name );
TQCString viewDCOPSuffix() const
Returns the DCOP suffix to allow identification of this view's DCOP interface.
Editor(TQObject *parent=0, const char *name=0)
Create a new editor widget.
The main class representing a text document.
KTextEditor is KDE's standard text editing KPart interface.
virtual class Document * document() const =0
Acess the parent Document.
Basic KTextEditor plugin class.
unsigned int viewNumber() const
Returns the number of this view.
This is a simplfied version of the Document & View classes Usage: Load it, merge it's gui + be happy Exte...