#include </home/clem/local/src/opie/qmake/include/private/qpluginmanager_p.h>
Inheritance diagram for QPluginManager< Type >:


Public Member Functions | |
| QPluginManager (const QUuid &id, const QStringList &paths=QString::null, const QString &suffix=QString::null, bool cs=TRUE) | |
| QRESULT | queryInterface (const QString &feature, Type **iface) const |
For internal use only.
A common usage of components is to extend the existing functionality in an application using plugins. The application defines interfaces that abstract a certain group of functionality, and a plugin provides a specialized implementation of one or more of those interfaces.
The QPluginManager template has to be instantiated with an interface definition and the IID for this interface.
QPluginManager<MyPluginInterface> *manager = new QPluginManager<MyPluginInterface>( IID_MyPluginInterface );
It searches a specified directory for all shared libraries, queries for components that implement the specific interface and reads information about the features the plugin wants to add to the application. The component can provide the set of features provided by implementing either the QFeatureListInterface or the QComponentInformationInterface. The strings returned by the implementations of
or
respectively, can then be used to access the component that provides the requested feature:
MyPluginInterface *iface; manager->queryInterface( "feature", &iface ); if ( iface ) iface->execute( "feature" );
The application can use a QPluginManager instance to create parts of the user interface based on the list of features found in plugins:
QPluginManager<MyPluginInterface> *manager = new QPluginManager<MyPluginInterface>( IID_ImageFilterInterface ); manager->addLibraryPath(...); QStringList features = manager->featureList(); for ( QStringList::Iterator it = features.begin(); it != features.end(); ++it ) { MyPluginInterface *iface; manager->queryInterface( *it, &iface ); // use QAction to provide toolbuttons and menuitems for each feature... }
Definition at line 60 of file qpluginmanager_p.h.
|
||||||||||||||||||||||||
|
Creates an QPluginManager for interfaces id that will load all shared library files in the paths + suffix. If cs is FALSE the manager will handle feature strings case insensitive.
Definition at line 63 of file qpluginmanager_p.h. |
|
||||||||||||||||
|
Sets iface to point to the interface providing feature.
Definition at line 65 of file qpluginmanager_p.h. References QGPluginManager::queryUnknownInterface(). |
1.4.2