plugin.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef __ktexteditor_plugin_h__
00020 #define __ktexteditor_plugin_h__
00021 
00022 #include <qobject.h>
00023 
00024 #include <kdelibs_export.h>
00025 
00026 namespace KTextEditor
00027 {
00028 
00029 class Document;
00030 class View;
00031 
00036 class KTEXTEDITOR_EXPORT Plugin : public QObject
00037 {
00038   friend class PrivatePlugin;
00039 
00040   Q_OBJECT
00041 
00042   public:
00043     Plugin ( Document *document = 0, const char *name = 0 );
00044     virtual ~Plugin ();
00045     
00046     unsigned int pluginNumber () const;
00047       
00048     Document *document () const;
00049     
00050   private:
00051     class PrivatePlugin *d;
00052     static unsigned int globalPluginNumber;
00053     unsigned int myPluginNumber;
00054 };
00055    
00056 KTEXTEDITOR_EXPORT Plugin *createPlugin ( const char* libname, Document *document = 0, const char *name = 0 );
00057 
00062 class KTEXTEDITOR_EXPORT PluginViewInterface
00063 {
00064   friend class PrivatePluginViewInterface;
00065 
00066   public:
00067     PluginViewInterface ();
00068     virtual ~PluginViewInterface ();
00069     
00070     unsigned int pluginViewInterfaceNumber () const;
00071   
00072     /*
00073      * will be called from the part to bound the plugin to a view
00074      */
00075     virtual void addView (View *) = 0;
00076     virtual void removeView (View *) = 0;
00077 
00078   private:
00079     class PrivatePluginViewInterface *d;
00080     static unsigned int globalPluginViewInterfaceNumber;
00081     unsigned int myPluginViewInterfaceNumber;
00082 };
00083 
00084 KTEXTEDITOR_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin);
00085 
00086 }
00087 
00088 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys