Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::Core::OPluginManager Class Reference

A class to manage order and activation of plugins. More...

#include </home/clem/local/src/opie/libopie2/opiecore/opluginloader.h>

Collaboration diagram for Opie::Core::OPluginManager:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QValueList< OPluginManager * > List

Public Member Functions

 OPluginManager (OGenericPluginLoader *)
 C'Tor using a OGenericPluginLoader The C'tor. Pass your OGenericPluginLoader to manage OGenericPluginLoader::allAvailable plugins.
 OPluginManager (const QString &name, const OPluginItem::List &, bool isSorted=false)
 Overloaded c'tor using a List of Plugins and a type name Overloaded Constructor to work with a 'Type' of plugins and a correspending list of those. In this case calling load is a no operation.
virtual ~OPluginManager ()
 A simple d'tor.
OPluginItem crashedPlugin () const
 Return the OPluginItem where loading is likely to have crashed on.
OPluginItem::List managedPlugins () const
 Return a list of plugins that are managed by this OPluginManager.
void setPosition (const OPluginItem &)
 Set the position of the items.
void enable (const OPluginItem &)
 Enable the item specified as argument.
void disable (const OPluginItem &)
 disable the Item.
void setEnabled (const OPluginItem &, bool=true)
 Enable or disable the OPluginItem. Depending on the value of the parameter this will either disable or enable the pluginitem. Beside that same as in.
virtual void load ()
 Load necessary information after constructing the object If you speified a OGenericPluginLoader you need to call this method so that this manager knows what to manage and have a right value for.
virtual void save ()
 Save the values and this way make it available.

Protected Member Functions

QString configName () const
void replace (const OPluginItem &)

Private Attributes

OGenericPluginLoaderm_loader
QString m_cfgName
OPluginItem::List m_plugins
OPluginItem m_crashed
bool m_isSorted: 1

Detailed Description

A class to manage order and activation of plugins.

Manage order and activation. This is used by the Opie::Ui::OPluginConfig This class controls the activation and order of plugins depending on the OPluginLoader you supply. You must call load() and save after construnction an instance

See also:
Opie::Ui::OPluginConfig

Definition at line 157 of file opluginloader.h.


Member Typedef Documentation

typedef QValueList<OPluginManager*> Opie::Core::OPluginManager::List
 

Definition at line 159 of file opluginloader.h.


Constructor & Destructor Documentation

Opie::Core::OPluginManager::OPluginManager OGenericPluginLoader loader  ) 
 

C'Tor using a OGenericPluginLoader The C'tor. Pass your OGenericPluginLoader to manage OGenericPluginLoader::allAvailable plugins.

Parameters:
loader A Pointer to your OGenericPluginLoader

Definition at line 685 of file opluginloader.cpp.

Opie::Core::OPluginManager::OPluginManager const QString name,
const OPluginItem::List lst,
bool  isSorted = false
 

Overloaded c'tor using a List of Plugins and a type name Overloaded Constructor to work with a 'Type' of plugins and a correspending list of those. In this case calling load is a no operation.

Parameters:
name The name of your plugin ('today','inputmethods','applets')
lst A List with plugins of your type to manage
isSorted If the List should be treated sorted

Definition at line 700 of file opluginloader.cpp.

Opie::Core::OPluginManager::~OPluginManager  )  [virtual]
 

A simple d'tor.

Definition at line 708 of file opluginloader.cpp.


Member Function Documentation

QString Opie::Core::OPluginManager::configName  )  const [protected]
 

For internal use only.

Definition at line 879 of file opluginloader.cpp.

References m_cfgName, m_loader, Opie::Core::OGenericPluginLoader::name(), and str.

Referenced by load(), and save().

OPluginItem Opie::Core::OPluginManager::crashedPlugin  )  const
 

Return the OPluginItem where loading is likely to have crashed on.

Return the Item that made the OGenericPluginLoader crash the returned OPluginItem could be empty if no crash occured which should apply most of the time. It could also be empty if the crashed plugin is not in the current list of available/managed plugins

See also:
OPluginItem::isEmpty
Returns:
OPluginItem that crashed the loader

Definition at line 722 of file opluginloader.cpp.

References m_crashed.

Referenced by TheNSResources::findAvailableNetNodes(), and Today::loadPluginWidgets().

void Opie::Core::OPluginManager::disable const OPluginItem item  ) 
 

disable the Item.

Disable the OPluginItem. Same applies as in

See also:
setPosition and

enable

Parameters:
item Item to disable

Definition at line 773 of file opluginloader.cpp.

References setEnabled().

void Opie::Core::OPluginManager::enable const OPluginItem item  ) 
 

Enable the item specified as argument.

This will make sure that OPluginItem::setEnabled is called and then will replace the item with one that matches name and path internally.

See also:
setPosition
Parameters:
item the Item to enable

Definition at line 761 of file opluginloader.cpp.

References setEnabled().

void Opie::Core::OPluginManager::load  )  [virtual]
 

Load necessary information after constructing the object If you speified a OGenericPluginLoader you need to call this method so that this manager knows what to manage and have a right value for.

See also:
crashedPlugin For the name and the list of plugins this does only try to find out the crashed plugin

Definition at line 800 of file opluginloader.cpp.

References Opie::Core::OGenericPluginLoader::allAvailable(), QValueList< T >::begin(), configName(), QValueList< T >::end(), QString::isEmpty(), Opie::Core::OGenericPluginLoader::isSorted(), m_crashed, m_loader, m_plugins, Config::readEntry(), and Config::setGroup().

Referenced by DateBookHoliday::DateBookHoliday(), TheNSResources::findAvailableNetNodes(), and Today::loadPlugins().

OPluginItem::List Opie::Core::OPluginManager::managedPlugins  )  const
 

Return a list of plugins that are managed by this OPluginManager.

Return the list of managed plugins. This could either result from passing a OGenericPluginLoader and calling load or by giving name and a list of plugins.

Definition at line 733 of file opluginloader.cpp.

References m_plugins.

Referenced by TodayConfig::writeConfig().

void Opie::Core::OPluginManager::replace const OPluginItem item  )  [protected]
 

For internal use only.

.. replace in m_plugins by path... this is linear search O(n/2)

Definition at line 887 of file opluginloader.cpp.

References QValueList< T >::append(), QValueList< T >::begin(), QValueList< T >::end(), m_plugins, Opie::Core::OPluginItem::name(), Opie::Core::OPluginItem::path(), and QValueList< T >::remove().

Referenced by setEnabled(), and setPosition().

void Opie::Core::OPluginManager::save  )  [virtual]
 

Save the values and this way make it available.

Save the current set of data. A call to

See also:
OGenericPluginLoader::filtered now would return your saved changes.

Definition at line 828 of file opluginloader.cpp.

References QMap< Key, T >::begin(), QValueList< T >::begin(), configName(), QMap< Key, T >::contains(), QMap< Key, T >::end(), QValueList< T >::end(), Opie::Core::OPluginItem::isEnabled(), Opie::Core::OGenericPluginLoader::isSorted(), m_isSorted, m_loader, m_plugins, Opie::Core::OPluginItem::name(), QString::null, QString::number(), Opie::Core::OPluginItem::path(), Opie::Core::OPluginItem::position(), and Config::writeEntry().

Referenced by TodayConfig::writeConfig().

void Opie::Core::OPluginManager::setEnabled const OPluginItem _item,
bool  b = true
 

Enable or disable the OPluginItem. Depending on the value of the parameter this will either disable or enable the pluginitem. Beside that same as in.

See also:
disable,

enable,

setPosition applies.

Parameters:
_item The OPluginItem to enable or to disable.
b Enable or disable the plugin.

Definition at line 788 of file opluginloader.cpp.

References replace(), and Opie::Core::OPluginItem::setEnabled().

Referenced by disable(), enable(), DateBookSettings::pluginItemClicked(), and TodayConfig::writeConfig().

void Opie::Core::OPluginManager::setPosition const OPluginItem item  ) 
 

Set the position of the items.

Replace the OPluginItem with the name and path and this way apply the new position. The search is linear and this way O(n/2) You still need to call save() to make your changes effective. After saving a call to OGenericPluginLoader::filtered() returns the newly configured order and items

Parameters:
item The OPluginItem to be replaced internall

Definition at line 748 of file opluginloader.cpp.

References replace().


Member Data Documentation

QString Opie::Core::OPluginManager::m_cfgName [private]
 

Definition at line 181 of file opluginloader.h.

Referenced by configName().

OPluginItem Opie::Core::OPluginManager::m_crashed [private]
 

Definition at line 183 of file opluginloader.h.

Referenced by crashedPlugin(), and load().

bool Opie::Core::OPluginManager::m_isSorted [private]
 

Definition at line 184 of file opluginloader.h.

Referenced by save().

OGenericPluginLoader* Opie::Core::OPluginManager::m_loader [private]
 

Definition at line 180 of file opluginloader.h.

Referenced by configName(), load(), and save().

OPluginItem::List Opie::Core::OPluginManager::m_plugins [private]
 

Definition at line 182 of file opluginloader.h.

Referenced by load(), managedPlugins(), replace(), and save().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:00:49 2005 for OPIE by  doxygen 1.4.2