#include </home/clem/local/src/opie/libopie2/opiecore/opluginloader.h>
Inheritance diagram for Opie::Core::OGenericPluginLoader:


Public Types | |
| typedef OPluginItem::List | List |
Public Member Functions | |
| OGenericPluginLoader (const QString &name, bool isSorted=false) | |
| create a PluginLoader | |
| virtual | ~OGenericPluginLoader () |
| simple d'tor that cleans up depending on autoDelete | |
| void | setAutoDelete (bool) |
| Enable or disable autoDelete on destruction. | |
| bool | autoDelete () const |
| See if autoDelete is enabled. | |
| void | clear () |
| unload all loaded Plugins | |
| QString | name () const |
| The name of the plugins. | |
| bool | isSorted () const |
| bool | isInSafeMode () const |
| See if loading of a plugin segfaulted This tells you if by previous tries to load, loading crashed your application. If isInSafeMode you can use the GUI to configure the plugins prior to loading. | |
| List | allAvailable (bool sorted=false) const |
| Return all Plugins found in the plugins dirs. Return the list of all available plugins. This will go through all plugin directories and search for your type of plugins ( by subdir ). | |
| List | filtered (bool sorted=false) const |
| Return only the enabled plugins Return only activated plugins. | |
| virtual QUnknownInterface * | load (const OPluginItem &item, const QUuid &) |
| Load a OPluginItem for the specified interface This will open the resource of the OPluginItem::path() and then will query if the Interface specified in the uuid is available and then will manage the resource and Interface. | |
| virtual void | unload (QUnknownInterface *) |
| unload the Plugin and the accompanied Resources. | |
Protected Member Functions | |
| void | readConfig () |
| virtual List | plugins (const QString &dir, bool sorted, bool disabled) const |
| method to return available plugins. Internal and for reeimplementations | |
| void | setPluginDirs (const QStringList &) |
| void | setPluginDir (const QString &) |
| void | setSafeMode (const QString &app=QString::null, bool b=false) |
Static Protected Member Functions | |
| static QString | unlibify (const QString &str) |
Private Member Functions | |
| QStringList | languageList () |
| void | installTranslators (const QString &type) |
Private Attributes | |
| QString | m_dir |
| QStringList | m_plugDirs |
| QStringList | m_languages |
| bool | m_autoDelete: 1 |
| bool | m_isSafeMode: 1 |
| bool | m_isSorted: 1 |
| QPtrDict< QLibrary > | m_library |
| Private * | d |
Friends | |
| class | OPluginManager |
This is the generic non sepcialised loader for plugins. Normally you would prefer using the OPluginLoader directly. This class exists to minimize the application binary size due the usage of templates in the specialized API.
Definition at line 73 of file opluginloader.h.
|
|
Definition at line 75 of file opluginloader.h. |
|
||||||||||||
|
create a PluginLoader Create a PluginLoader autoDelete is set to false
Opie::Core::OGenericPluginLoader loader("myapp-plugin"); Opie::Core::OPluginItem::List lst = loader.filtered(); for(Opie::Core::OPluginItem::List::Iterator it = lst.begin(); it!=lst.end();++it){ MyIface* iface = static_cast<MyIface*>(loader.load(*it,IID_MyIface)); }
Opie::Core::OGenericPluginLoader loader("myapp-plugin"); Opie::Core::OPluginItem::List lst = loader.filtered(); for(Opie::Core::OPluginItem::List::Iterator it = lst.begin(); it!=lst.end();++it){ MyIface* iface = static_cast<MyIface*>(loader.load(*it,IID_MyIface)); } ... loader.clear();
Definition at line 281 of file opluginloader.cpp. References QPEApplication::qpeDir(), readConfig(), and setPluginDir(). |
|
|
simple d'tor that cleans up depending on autoDelete calls clear if autoDelete is true. This will release all interfaces and remove the library from this process if the refcount falls to zero Definition at line 296 of file opluginloader.cpp. References clear(), and m_autoDelete. |
|
|
Return all Plugins found in the plugins dirs. Return the list of all available plugins. This will go through all plugin directories and search for your type of plugins ( by subdir ).
Definition at line 379 of file opluginloader.cpp. References QValueList< T >::begin(), QValueList< T >::end(), m_plugDirs, plugins(), and qHeapSort(). Referenced by Opie::Core::OPluginManager::load(), main(), DateBookSettings::pluginItemClicked(), DateBookSettings::setPluginList(), and TodayConfig::writeConfig(). |
|
|
See if autoDelete is enabled.
Definition at line 316 of file opluginloader.cpp. References m_autoDelete. |
|
|
unload all loaded Plugins This will unload all returned QUnknownInterfaces by load. Unload will be called. Definition at line 326 of file opluginloader.cpp. References m_library, and unload(). Referenced by ~OGenericPluginLoader(). |
|
|
Return only the enabled plugins Return only activated plugins.
Definition at line 395 of file opluginloader.cpp. References QValueList< T >::begin(), QValueList< T >::end(), m_plugDirs, plugins(), and qHeapSort(). Referenced by DateBookHoliday::init(), Today::loadPluginWidgets(), and main(). |
|
|
For internal use only. Tries to install languages using the languageList for the type Definition at line 632 of file opluginloader.cpp. References QValueList< T >::begin(), QValueList< T >::end(), languageList(), qApp, and QPEApplication::qpeDir(). Referenced by load(). |
|
|
See if loading of a plugin segfaulted This tells you if by previous tries to load, loading crashed your application. If isInSafeMode you can use the GUI to configure the plugins prior to loading.
Definition at line 367 of file opluginloader.cpp. References m_isSafeMode. Referenced by Today::loadPluginWidgets(), and main(). |
|
|
For internal use only.
Definition at line 497 of file opluginloader.cpp. References m_isSorted. Referenced by Opie::Core::OPluginManager::load(), and Opie::Core::OPluginManager::save(). |
|
|
For internal use only. generate a list of languages from $LANG Definition at line 601 of file opluginloader.cpp. References QString::find(), QValueList< T >::isEmpty(), QString::left(), m_languages, pos, and str. Referenced by installTranslators(). |
|
||||||||||||
|
Load a OPluginItem for the specified interface This will open the resource of the OPluginItem::path() and then will query if the Interface specified in the uuid is available and then will manage the resource and Interface.
Reimplemented in Opie::Core::OPluginLoader. Definition at line 417 of file opluginloader.cpp. References installTranslators(), QString::isEmpty(), l, m_library, Opie::Core::OPluginItem::name(), Opie::Core::OPluginItem::path(), QS_OK, QLibrary::queryInterface(), Opie::Core::Internal::OPluginLibraryHolder::self(), and setSafeMode(). Referenced by Opie::Core::OPluginLoader::load(), and main(). |
|
|
The name of the plugins. Return the name/type you specified in the constructor. This is at least used by the OPluginManager to find the right config Definition at line 354 of file opluginloader.cpp. References m_dir. Referenced by Opie::Core::OPluginManager::configName(). |
|
||||||||||||||||
|
method to return available plugins. Internal and for reeimplementations
For internal use only. Return a List of Plugins for a dir and add positions and remove disabled. If a plugin is on the excluded list assign position -2
Definition at line 530 of file opluginloader.cpp. References QValueList< T >::append(), QValueList< T >::begin(), QMap< Key, T >::contains(), QValueList< T >::end(), QDir::entryList(), i, QMap< Key, T >::insert(), list, m_dir, pos, Config::readListEntry(), Opie::Core::OPluginItem::setEnabled(), Config::setGroup(), Opie::Core::OPluginItem::setPosition(), str, QString::toInt(), and unlibify(). Referenced by allAvailable(), and filtered(). |
|
|
For internal use only. and reads in the safe mode Definition at line 454 of file opluginloader.cpp. References m_dir, m_isSafeMode, Config::readBoolEntry(), and Config::setGroup(). Referenced by OGenericPluginLoader(). |
|
|
Enable or disable autoDelete on destruction. enable autoDelete. This will call clear on the d'tor
Definition at line 309 of file opluginloader.cpp. References m_autoDelete. Referenced by DateBookHoliday::DateBookHoliday(), TheNSResources::findAvailableNetNodes(), Today::loadPlugins(), and main(). |
|
|
For internal use only. Set the Plugin Dir to str. Str will be the only element in the list of plugin dirs Definition at line 488 of file opluginloader.cpp. References QValueList< T >::append(), QValueList< T >::clear(), and m_plugDirs. Referenced by OGenericPluginLoader(). |
|
|
For internal use only. Set the List of Plugin Dirs to lst. Currently only QPEApplication::qpeDir()+"plugins/"+mytype is used as plugin dir Definition at line 479 of file opluginloader.cpp. References m_plugDirs. |
|
||||||||||||
|
For internal use only. Enter or leave SafeMode Definition at line 466 of file opluginloader.cpp. References m_dir, Config::setGroup(), and Config::writeEntry(). Referenced by load(). |
|
|
For internal use only.
Definition at line 509 of file opluginloader.cpp. References QString::find(), QString::findRev(), QString::left(), and QString::mid(). Referenced by plugins(). |
|
|
unload the Plugin and the accompanied Resources. This will take the iface from the internal QPtrDict, Release it, and deref the libray used. The visibility depends on the QPtrDict.
Definition at line 340 of file opluginloader.cpp. References m_library, and Opie::Core::Internal::OPluginLibraryHolder::self(). Referenced by clear(). |
|
|
Definition at line 96 of file opluginloader.h. |
|
|
Definition at line 114 of file opluginloader.h. |
|
|
Definition at line 109 of file opluginloader.h. Referenced by autoDelete(), setAutoDelete(), and ~OGenericPluginLoader(). |
|
|
Definition at line 106 of file opluginloader.h. Referenced by name(), plugins(), readConfig(), and setSafeMode(). |
|
|
Definition at line 110 of file opluginloader.h. Referenced by isInSafeMode(), and readConfig(). |
|
|
Definition at line 111 of file opluginloader.h. Referenced by isSorted(). |
|
|
Definition at line 108 of file opluginloader.h. Referenced by languageList(). |
|
|
Definition at line 112 of file opluginloader.h. |
|
|
Definition at line 107 of file opluginloader.h. Referenced by allAvailable(), filtered(), setPluginDir(), and setPluginDirs(). |
1.4.2