30 #ifndef INTERFACES_CORE_IPLUGINSMANAGER_H
31 #define INTERFACES_CORE_IPLUGINSMANAGER_H
32 #include <QStringList>
33 #include <QObjectList>
58 virtual QObjectList GetAllPlugins ()
const = 0;
69 template<
typename T> QObjectList
Filter (QObjectList source)
const
72 Q_FOREACH (QObject *sp, source)
73 if (qobject_cast<T> (sp))
89 return Filter<T> (GetAllPlugins ());
105 QObjectList roots = GetAllCastableRoots<T> ();
107 Q_FOREACH (QObject *root, roots)
108 result << qobject_cast<T> (root);
120 virtual QObject* GetPluginByID (
const QByteArray&
id)
const = 0;
138 virtual QString GetPluginLibraryPath (
const QObject*
object)
const = 0;
151 virtual void InjectPlugin (QObject *
object) = 0;
168 virtual void ReleasePlugin (QObject *
object) = 0;
177 virtual QObject* GetQObject () = 0;
186 virtual void OpenSettings (QObject *plugin) = 0;
QList< T > GetAllCastableTo() const
Similar to GetAlLCastableRoots() and provided for convenience.
QObjectList GetAllCastableRoots() const
This is the same as Filter (GetAllPlugins()).
Q_DECLARE_INTERFACE(IPluginsManager,"org.Deviant.LeechCraft.IPluginsManager/1.0")
This interface is used to represent LeechCraft's global plugin manager.
virtual ~IPluginsManager()
QObjectList Filter(QObjectList source) const
Filters the given list of plugins and returns only those that can be casted to the given template typ...