kparts Library API Documentation

plugin.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
00003              (C) 1999 David Faure <faure@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 as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
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 #ifndef PLUGIN_H
00021 #define PLUGIN_H
00022 
00023 #include <qobject.h>
00024 #include <kaction.h>
00025 #include <kxmlguiclient.h>
00026 
00027 class KInstance;
00028 
00029 namespace KParts
00030 {
00031 
00049 class KPARTS_EXPORT Plugin : public QObject, virtual public KXMLGUIClient
00050 {
00051     Q_OBJECT
00052 public:
00053     struct PluginInfo
00054     {
00055         QString m_relXMLFileName; // relative filename, i.e. kpartplugins/name
00056         QString m_absXMLFileName; // full path of most recent filename matching the relative
00057                                   // filename
00058         QDomDocument m_document;
00059     };
00060 
00064     Plugin( QObject* parent = 0, const char* name = 0 );
00068     virtual ~Plugin();
00069 
00073     virtual QString xmlFile() const;
00074 
00078     virtual QString localXMLFile() const;
00079 
00087     static void loadPlugins( QObject *parent, const KInstance * instance );
00088 
00096     static void loadPlugins( QObject *parent, const QValueList<PluginInfo> &pluginInfos );
00097 
00105     static void loadPlugins( QObject *parent, const QValueList<PluginInfo> &pluginInfos, const KInstance * instance );
00106 
00141     static void loadPlugins( QObject *parent, KXMLGUIClient* parentGUIClient, KInstance* instance, bool enableNewPluginsByDefault = true );
00142 
00149     static QPtrList<Plugin> pluginObjects( QObject *parent );
00150 
00151 protected:
00157     static QValueList<Plugin::PluginInfo> pluginInfos( const KInstance * instance );
00158 
00163     static Plugin* loadPlugin( QObject * parent, const char* libname );
00164 
00165     virtual void setInstance( KInstance *instance );
00166 
00167 private:
00168     static bool hasPlugin( QObject* parent, const QString& library );
00169     class PluginPrivate;
00170     PluginPrivate *d;
00171 };
00172 
00173 }
00174 
00175 #endif
KDE Logo
This file is part of the documentation for kparts Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 15 10:54:06 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003