Public Slots | Signals | Public Member Functions

ShareUI::PluginLoader Class Reference

Class to handle ShareUI plugin management (loading/unloading). More...

#include <pluginloader.h>

List of all members.

Public Slots

bool loadPlugins ()
 Starts loading all valid plugins found in plugin path.

Signals

void allPluginsLoaded ()
 Signal emitted when all plugins have been loaded.
void methodVisible (ShareUI::MethodBase *method, bool visible)
 Signal to listen method visibility changes.
void newMethod (ShareUI::MethodBase *method)
 Signal emitted when method is activated after loading.

Public Member Functions

ShareUI::MethodBasemethod (int at)
 Get method with index.
int methodCount () const
 Number or methods loaded currently.
bool methodOrderingValues (ShareUI::MethodBase *method, int &order, int &suborder)
 Get ordering values for method.
QList< ShareUI::MethodBase * > methods () const
 Get current list of methods.
int pluginCount () const
 Number of plugin loaded currently.
 PluginLoader (QObject *parent=0)
 Create new PluginLoader instance.
QString pluginName (int at)
 Get filename for plugin instance.
QString pluginNameForMethod (ShareUI::MethodBase *method) const
 Get plugin name for method.
QString pluginPath () const
 Get current path used to load plugins.
void setPluginLoadingDelay (int delay)
 Sets how long delay there will be after calling loadPlugins before the plugin loading is actually started.
void setPluginPath (const QString &path)
 Change path where plugins are loaded.
void unload ()
 Unloads all plugins.

Detailed Description

Class to handle ShareUI plugin management (loading/unloading).

Author:
Jukka Tiihonen <jukka.t.tiihonen@nokia.com>

Constructor & Destructor Documentation

ShareUI::PluginLoader::PluginLoader ( QObject *  parent = 0  ) 

Create new PluginLoader instance.

Parameters:
parent QObject parent

Member Function Documentation

bool ShareUI::PluginLoader::loadPlugins (  )  [slot]

Starts loading all valid plugins found in plugin path.

If plugins are already loaded then this function will fail.

Returns:
true if plugin loading was started successfully
ShareUI::MethodBase* ShareUI::PluginLoader::method ( int  at  ) 

Get method with index.

Parameters:
at Index number of plugin. 0 .. (amount() - 1)
Returns:
Pointer to method class or null if at is out of range
int ShareUI::PluginLoader::methodCount (  )  const

Number or methods loaded currently.

Returns:
Number of methods loaded
bool ShareUI::PluginLoader::methodOrderingValues ( ShareUI::MethodBase method,
int &  order,
int &  suborder 
)

Get ordering values for method.

Parameters:
method Method which needs ordering values
order Main ordering value (bigger is before)
suborder Secondary ordering value (bigger is before)
Returns:
true if order values generated
QList<ShareUI::MethodBase *> ShareUI::PluginLoader::methods (  )  const

Get current list of methods.

Useful to call initial list of loaded methods at the beginning. Later use newMethod signal to do same calls to methods created later.

Returns:
List of methods
void ShareUI::PluginLoader::methodVisible ( ShareUI::MethodBase method,
bool  visible 
) [signal]

Signal to listen method visibility changes.

Better to use this than direct signal from ShareUI::MethodBase.

Parameters:
method Method which visibility state has changed
visible If true method should be presented to user. If false then it must be hidden from the user.
void ShareUI::PluginLoader::newMethod ( ShareUI::MethodBase method  )  [signal]

Signal emitted when method is activated after loading.

Parameters:
method Method activated
int ShareUI::PluginLoader::pluginCount (  )  const

Number of plugin loaded currently.

Returns:
Number of plugins loaded
QString ShareUI::PluginLoader::pluginName ( int  at  ) 

Get filename for plugin instance.

Parameters:
at Index of plugin
Returns:
Name of plugin or empty string if name not found
QString ShareUI::PluginLoader::pluginNameForMethod ( ShareUI::MethodBase method  )  const

Get plugin name for method.

Parameters:
method Method searched
Returns:
Plugin name for method
QString ShareUI::PluginLoader::pluginPath (  )  const

Get current path used to load plugins.

Returns:
Plugin path
void ShareUI::PluginLoader::setPluginLoadingDelay ( int  delay  ) 

Sets how long delay there will be after calling loadPlugins before the plugin loading is actually started.

Parameters:
delay Delay in milliseconds
void ShareUI::PluginLoader::setPluginPath ( const QString &  path  ) 

Change path where plugins are loaded.

This need to be done before loadPlugins is called.

Parameters:
path Path where plugins are loaded
void ShareUI::PluginLoader::unload (  ) 

Unloads all plugins.

Instances will be invalid after this.


The documentation for this class was generated from the following file: