kate Library API Documentation

katepluginmanager.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00004    Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef __KATE_PLUGINMANAGER_H__
00022 #define __KATE_PLUGINMANAGER_H__
00023 
00024 #include "katemain.h"
00025 #include "../interfaces/plugin.h"
00026 #include "../interfaces/pluginmanager.h"
00027 
00028 #include <qobject.h>
00029 #include <qvaluelist.h>
00030 #include <qptrlist.h>
00031 #include <ktrader.h>
00032 
00033 class KatePluginInfo
00034 {
00035   public:
00036     bool load;
00037     KService::Ptr service;
00038     Kate::Plugin *plugin;
00039 };
00040 
00041 typedef QPtrList<KatePluginInfo> KatePluginList;
00042 
00043 class KatePluginManager : public QObject
00044 {
00045   Q_OBJECT
00046 
00047   public:
00048     KatePluginManager(QObject *parent);
00049     ~KatePluginManager();
00050     
00051     static KatePluginManager *self();
00052 
00053     Kate::PluginManager *pluginManager () const { return m_pluginManager; };
00054 
00055     void loadAllEnabledPlugins ();
00056     void unloadAllPlugins ();
00057     
00058     void enableAllPluginsGUI (KateMainWindow *win);
00059     void disableAllPluginsGUI (KateMainWindow *win);
00060 
00061     void loadConfig ();
00062     void writeConfig ();
00063 
00064     void loadPlugin (KatePluginInfo *item);
00065     void unloadPlugin (KatePluginInfo *item);
00066     
00067     void enablePluginGUI (KatePluginInfo *item, KateMainWindow *win);
00068     void enablePluginGUI (KatePluginInfo *item);
00069     
00070     void disablePluginGUI (KatePluginInfo *item, KateMainWindow *win);
00071     void disablePluginGUI (KatePluginInfo *item);
00072 
00073     inline KatePluginList & pluginList () { return m_pluginList; };
00074 
00075     virtual Kate::Plugin *plugin(const QString &name);
00076     virtual bool pluginAvailable(const QString &name);
00077     virtual class Kate::Plugin *loadPlugin(const QString &name,bool permanent=true);
00078     virtual void unloadPlugin(const QString &name,bool permanent=true);
00079 
00080   private:
00081     Kate::PluginManager *m_pluginManager;
00082 
00083     void setupPluginList ();
00084 
00085     KatePluginList m_pluginList;
00086 };
00087 
00088 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 30 18:40:31 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003