Plasma
pluginloader.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2010 by Ryan Rix <ry@n.rix.si> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program 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 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLUGIN_LOADER_H 00021 #define PLUGIN_LOADER_H 00022 00023 #include <plasma/plasma.h> 00024 #include <kplugininfo.h> 00025 00026 namespace Plasma { 00027 00028 class Applet; 00029 class DataEngine; 00030 class Service; 00031 class AbstractRunner; 00032 00033 class PluginLoaderPrivate; 00034 00035 //TODO: 00036 // * add support for ContainmentActions plugins 00037 // * add KPluginInfo listing support for Containments (already loaded via the applet loading code) 00038 00051 class PLASMA_EXPORT PluginLoader 00052 { 00053 public: 00054 PluginLoader(); 00055 00056 virtual ~PluginLoader(); 00057 00067 Applet *loadApplet(const QString &name, uint appletId = 0, 00068 const QVariantList &args = QVariantList()); 00069 00076 DataEngine *loadDataEngine(const QString &name); 00077 00083 AbstractRunner *loadRunner(const QString &name); 00084 00094 Service *loadService(const QString &name, const QVariantList &args, QObject *parent = 0); 00095 00113 KPluginInfo::List listAppletInfo(const QString &category, const QString &parentApp = QString()); 00114 00125 KPluginInfo::List listDataEngineInfo(const QString &parentApp = QString()); 00126 00137 KPluginInfo::List listRunnerInfo(const QString &parentApp = QString()); 00138 00145 static void setPluginLoader(PluginLoader* loader); 00146 00150 static PluginLoader* pluginLoader(); 00151 00152 protected: 00166 virtual Applet *internalLoadApplet(const QString &name, uint appletId = 0, 00167 const QVariantList &args = QVariantList()); 00168 00179 virtual AbstractRunner *internalLoadRunner(const QString &name); 00180 00191 virtual DataEngine *internalLoadDataEngine(const QString &name); 00192 00206 virtual Service *internalLoadService(const QString &name, const QVariantList &args, QObject *parent = 0); 00207 00225 virtual KPluginInfo::List internalAppletInfo(const QString &category) const; 00226 00233 virtual KPluginInfo::List internalDataEngineInfo() const; 00234 00240 virtual KPluginInfo::List internalRunnerInfo() const; 00241 00247 virtual KPluginInfo::List internalServiceInfo() const; 00248 00264 KPluginInfo::List standardInternalAppletInfo(const QString &category) const; 00265 00275 KPluginInfo::List standardInternalDataEngineInfo() const; 00276 00286 KPluginInfo::List standardInternalRunnerInfo() const; 00287 00297 KPluginInfo::List standardInternalServiceInfo() const; 00298 00299 private: 00300 PluginLoaderPrivate * const d; 00301 }; 00302 00303 } 00304 00305 Q_DECLARE_METATYPE(Plasma::PluginLoader*) 00306 00307 #endif
KDE 4.7 API Reference