|  | Home |

# QMailPluginManager Class Reference

The QMailPluginManager class is a helper class that simplifies plug-in loading for the Messaging framework. More...

        #include <QMailPluginManager>

Inherits QObject.

- List of all members, including inherited members

## Public Functions

| QMailPluginManager ( const QString & dir, QObject * parent = 0 )
| ~QMailPluginManager ()
QObject * | instance ( const QString & name )
QStringList | list () const

- 29 public functions inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 signal inherited from QObject
- 1 public type inherited from QObject
- 4 static public members inherited from QObject
- 7 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QMailPluginManager class is a helper class that simplifies plug-in loading for the Messaging framework.

The list() function returns a list of available plugins in the subdirectory specified in the constructor.

Plugin subdirectories are searched for from the directory specified by QMail::pluginPath().

In order to load a plugin, call the instance() function with the name of the plugin to load. qobject_cast() may then be used to query for the desired interface.

## Member Function Documentation

### QMailPluginManager::QMailPluginManager ( const QString & dir, QObject * parent = 0 )

Creates a QMailPluginManager for plugins located in the plugin subdirectory dir with the given parent.

The plugins must be installed in the QMail::pluginPath()/dir directory.

### QMailPluginManager::~QMailPluginManager ()

Destroys the QMailPluginManager and releases any resources allocated by the PluginManager.

### QObject * QMailPluginManager::instance ( const QString & name )

Load the plug-in specified by name.

Returns the plugin interface if found, otherwise 0.

        QObject *instance = pluginManager->instance("name");
        if (instance) {
            EffectsInterface *iface = 0;
            iface = qobject_cast<EffectsInterface*>(instance);
            if (iface) {
                // We have an instance of the desired type.
            }
        }

### QStringList QMailPluginManager::list () const

Returns the list of plugins that are available in the plugin subdirectory.