Source Code (Use browser search to find items of interest.)

Class Index

kdelibs'Plugin (./kdelibs/kparts/plugin.h:47)

class Plugin : public QObject, public KXMLGUIClient
{
    Q_OBJECT
public:
    /**
     * Constructs a new KParts plugin.
     */
    Plugin( QObject* parent = 0, const char* name = 0 );
    /**
     * Destructor
     */
    virtual ~Plugin();

    /**
     * Load the plugin libraries from the directories appropriate
     * to @p instance and make the Plugin objects children of @p parent .
     */
    static void loadPlugins( QObject *parent, const KInstance * instance );

    /**
     * Load the plugin libraries specified by the list @p docs and make the
     * Plugin objects children of @p parent .
     */
    static void loadPlugins( QObject *parent, const QValueList<QDomDocument> &docs );

    /**
     * Returns a list of plugin objects loaded for @p parent . This functions basically
     * calls the @ref queryList method of @ref QObject to retrieve the list of child objects
     * inheritting @ref KParts::Plugin .
     */
    static QValueList<KXMLGUIClient *> pluginClients( QObject *parent );

protected:
    /**
     * Look for plugins in the @p instance's "data" directory (+"/kpartplugins")
     * @return A list of @ref QDomDocument s, containing the parsed xml documents returned by plugins.
     */
    static const QValueList<QDomDocument> pluginDocuments( const KInstance * instance );

    /**
     * @internal
     * @return The plugin created from the library @p libname
     */
    static Plugin* loadPlugin( QObject * parent, const char* libname );

private:
    class PluginPrivate;
    PluginPrivate *d;
};

};

kdelibs'Plugin::pluginClients() (./kdelibs/kparts/plugin.cpp:138)

QValueList<KXMLGUIClient *> Plugin::pluginClients( QObject *parent )
{
  QValueList<KXMLGUIClient *> clients;

  if (!parent )
    return clients;

  QObjectList *plugins = parent->queryList( "KParts::Plugin", 0, false, false );

  QObjectListIt it( *plugins );
  while( it.current() )
  {
    clients.append( (KXMLGUIClient *)((Plugin *)it.current()) );
    ++it;
  }

  return clients;
}