kate
katepluginmanager.h
Go to the documentation of this file.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., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef __KATE_PLUGINMANAGER_H__ 00022 #define __KATE_PLUGINMANAGER_H__ 00023 00024 #include "katemain.h" 00025 00026 #include "../interfaces/plugin.h" 00027 #include "../interfaces/pluginmanager.h" 00028 00029 #include <ktrader.h> 00030 00031 #include <qobject.h> 00032 #include <qvaluelist.h> 00033 00034 class KatePluginInfo 00035 { 00036 public: 00037 bool load; 00038 KService::Ptr service; 00039 Kate::Plugin *plugin; 00040 }; 00041 00042 typedef QValueList<KatePluginInfo> KatePluginList; 00043 00044 class KatePluginManager : public QObject 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 KatePluginManager(QObject *parent); 00050 ~KatePluginManager(); 00051 00052 static KatePluginManager *self(); 00053 00054 Kate::PluginManager *pluginManager () const { return m_pluginManager; }; 00055 00056 void loadAllEnabledPlugins (); 00057 void unloadAllPlugins (); 00058 00059 void enableAllPluginsGUI (KateMainWindow *win); 00060 void disableAllPluginsGUI (KateMainWindow *win); 00061 00062 void loadConfig (); 00063 void writeConfig (); 00064 00065 void loadPlugin (KatePluginInfo *item); 00066 void unloadPlugin (KatePluginInfo *item); 00067 00068 void enablePluginGUI (KatePluginInfo *item, KateMainWindow *win); 00069 void enablePluginGUI (KatePluginInfo *item); 00070 00071 void disablePluginGUI (KatePluginInfo *item, KateMainWindow *win); 00072 void disablePluginGUI (KatePluginInfo *item); 00073 00074 inline KatePluginList & pluginList () { return m_pluginList; }; 00075 00076 Kate::Plugin *plugin (const QString &name); 00077 bool pluginAvailable (const QString &name); 00078 00079 Kate::Plugin *loadPlugin (const QString &name, bool permanent=true); 00080 void unloadPlugin (const QString &name, bool permanent=true); 00081 00082 private: 00083 Kate::PluginManager *m_pluginManager; 00084 00085 void setupPluginList (); 00086 00087 KatePluginList m_pluginList; 00088 }; 00089 00090 #endif