KParts
plugin.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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:
00056 struct PluginInfo
00057 {
00058 QString m_relXMLFileName;
00059 QString m_absXMLFileName;
00060 QDomDocument m_document;
00061 };
00062
00066 Plugin( QObject* parent = 0, const char* name = 0 );
00070 virtual ~Plugin();
00071
00075 virtual QString xmlFile() const;
00076
00080 virtual QString localXMLFile() const;
00081
00089 static void loadPlugins( QObject *parent, const KInstance * instance );
00090
00098 static void loadPlugins( QObject *parent, const QValueList<PluginInfo> &pluginInfos );
00099
00107 static void loadPlugins( QObject *parent, const QValueList<PluginInfo> &pluginInfos, const KInstance * instance );
00108
00143 static void loadPlugins( QObject *parent, KXMLGUIClient* parentGUIClient, KInstance* instance, bool enableNewPluginsByDefault = true );
00144
00151 static QPtrList<Plugin> pluginObjects( QObject *parent );
00152
00153 protected:
00159 static QValueList<Plugin::PluginInfo> pluginInfos( const KInstance * instance );
00160
00165 static Plugin* loadPlugin( QObject * parent, const char* libname );
00166
00167 virtual void setInstance( KInstance *instance );
00168
00169 private:
00170 static bool hasPlugin( QObject* parent, const QString& library );
00171 class PluginPrivate;
00172 PluginPrivate *d;
00173 };
00174
00175 }
00176
00177 #endif