kate Library API Documentation

plugin.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef _KATE_PLUGIN_INCLUDE_
00021 #define _KATE_PLUGIN_INCLUDE_
00022 
00023 #include <qwidget.h>
00024 #include <qpixmap.h>
00025 #include <kicontheme.h>
00026 
00027 #include <kurl.h>
00028 
00029 namespace Kate
00030 {
00031 
00032 class Application;
00033 class Project;
00034 class MainWindow;
00035 
00036 
00037 class Plugin : public QObject
00038 {
00039   friend class PrivatePlugin;
00040 
00041   Q_OBJECT
00042 
00043   public:
00044     Plugin (Application *application = 0, const char *name = 0 );
00045     virtual ~Plugin ();
00046 
00047     unsigned int pluginNumber () const;
00048 
00049     Application *application() const;
00050 
00051   private:
00052     class PrivatePlugin *d;
00053     static unsigned int globalPluginNumber;
00054     unsigned int myPluginNumber;
00055 };
00056 
00057 class ProjectPlugin : public Plugin
00058 {
00059   friend class PrivateProjectPlugin;
00060 
00061   Q_OBJECT
00062 
00063   public:
00064     ProjectPlugin (Project *project = 0, const char *name = 0 );
00065     virtual ~ProjectPlugin ();
00066 
00067     unsigned int projectPluginNumber () const;
00068 
00069     Project *project() const;
00070 
00071     // default implementations returns true of the following bool methodes
00072 
00073     virtual bool save ();
00074     virtual bool queryClose ();
00075     virtual bool close ();
00076 
00077     // default implementations don't modify the given list at all
00078 
00079     virtual void addDirs (const QString &dir, QStringList &dirs);
00080     virtual void removeDirs (const QString &dir, QStringList &dirs);
00081 
00082     virtual void addFiles (const QString &dir, QStringList &files);
00083     virtual void removeFiles (const QString &dir, QStringList &files);
00084 
00085   private:
00086     class PrivateProjectPlugin *d;
00087     static unsigned int globalProjectPluginNumber;
00088     unsigned int myProjectPluginNumber;
00089 };
00090 
00091 class InitPlugin : public Plugin
00092 {
00093   friend class PrivateInitPlugin;
00094 
00095   Q_OBJECT
00096 
00097   public:
00098 
00103     InitPlugin(Application *application=0, const char *name = 0);
00104     virtual ~InitPlugin();
00105 
00106     unsigned int initPluginNumber () const;
00107 
00108     /* This is called whenever a new config script should be opened */
00109     virtual void activate( const KURL &configScript=KURL());
00110 
00122     virtual int actionsKateShouldNotPerformOnRealStartup();
00123 
00129     virtual int initKate();
00130 
00131     const KURL configScript() const;
00132 
00133   private:
00134     class PrivateInitPlugin *d;
00135     static unsigned int globalInitPluginNumber;
00136     unsigned int myInitPluginNumber;
00137 };
00138 
00139 Plugin *createPlugin ( const char* libname, Application *application = 0, const char *name = 0,const QStringList &args = QStringList() );
00140 ProjectPlugin *createProjectPlugin ( const char* libname, Project *project = 0, const char *name = 0,const QStringList &args = QStringList() );
00141 
00142 /*
00143  * view plugin class
00144  * this plugin will be bound to a ktexteditor::view
00145  */
00146 class PluginViewInterface
00147 {
00148   friend class PrivatePluginViewInterface;
00149 
00150   public:
00151     PluginViewInterface ();
00152     virtual ~PluginViewInterface ();
00153 
00154     unsigned int pluginViewInterfaceNumber () const;
00155 
00156     /*
00157      * will be called from the part to bound the plugin to a view
00158      */
00159     virtual void addView (MainWindow *) = 0;
00160     virtual void removeView (MainWindow *) = 0;
00161 
00162   private:
00163     class PrivatePluginViewInterface *d;
00164     static unsigned int globalPluginViewInterfaceNumber;
00165     unsigned int myPluginViewInterfaceNumber;
00166 };
00167 
00168 PluginViewInterface *pluginViewInterface (Plugin *plugin);
00169 
00170 }
00171 
00172 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 5 04:41:11 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003