• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/libkopete

  • Kopete
  • PluginManager
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
Kopete::PluginManager Class Reference

#include <kopetepluginmanager.h>

Inheritance diagram for Kopete::PluginManager:
Inheritance graph
[legend]

Public Types

enum  PluginLoadMode { LoadSync, LoadAsync }
 

Public Slots

void loadAllPlugins ()
 
Plugin * loadPlugin (const QString &pluginId, PluginLoadMode mode=LoadSync)
 
bool unloadPlugin (const QString &pluginName)
 

Signals

void allPluginsLoaded ()
 
void pluginLoaded (Kopete::Plugin *plugin)
 
void pluginUnloaded (const QString &pluginName)
 
void protocolLoaded (Kopete::Protocol *protocol)
 

Public Member Functions

QList< KPluginInfo > availablePlugins (const QString &category=QString()) const
 
bool isAllPluginsLoaded () const
 
PluginList loadedPlugins (const QString &category=QString()) const
 
Plugin * plugin (const QString &pluginName) const
 
KPluginInfo pluginInfo (const Kopete::Plugin *plugin) const
 
bool setPluginEnabled (const QString &name, bool enabled=true)
 
void shutdown ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Static Public Member Functions

static PluginManager * self ()
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Author
Duncan Mac-Vicar Prett dunca.nosp@m.n@kd.nosp@m.e.org
Martijn Klingens kling.nosp@m.ens@.nosp@m.kde.o.nosp@m.rg

Definition at line 40 of file kopetepluginmanager.h.

Member Enumeration Documentation

enum Kopete::PluginManager::PluginLoadMode

Plugin loading mode.

Used by loadPlugin(). Code that doesn't want to block the GUI and/or lot a lot of plugins at once should use asynchronous loading (LoadAsync). The default is synchronous loading (LoadSync).

Enumerator
LoadSync 
LoadAsync 

Definition at line 129 of file kopetepluginmanager.h.

Member Function Documentation

void Kopete::PluginManager::allPluginsLoaded ( )
signal

All plugins have been loaded by the plugin manager.

This signal is emitted exactly ONCE, when the plugin manager has emptied its plugin queue for the first time. This means that if you call an async loadPlugin() before loadAllPlugins() this signal is probably emitted after the initial call completes, unless you are quick enough to fill the queue before it completes, which is a dangerous race you shouldn't count upon :)

The signal is delayed one event loop iteration through a singleShot timer, but that is not guaranteed to be enough for account instantiation. You may need an additional timer for it in the code if you want to programmatically act on it.

If you use the signal for enabling/disabling GUI objects there is little chance a user is able to activate them in the short while that's remaining, the slow part of the code is over now and the remaining processing time is neglectable for the user.

QList< KPluginInfo > Kopete::PluginManager::availablePlugins ( const QString &  category = QString()) const

Returns a list of all available plugins for the given category.

Currently there are two categories, "Plugins" and "Protocols", but you can add your own categories if you want.

If you pass an empty string you get the complete list of ALL plugins.

You can query all information on the plugins through the KPluginInfo interface.

Definition at line 122 of file kopetepluginmanager.cpp.

bool Kopete::PluginManager::isAllPluginsLoaded ( ) const

This method check if all the plugins are loaded.

Returns
true if all the plugins are loaded.

Definition at line 500 of file kopetepluginmanager.cpp.

void Kopete::PluginManager::loadAllPlugins ( )
slot

Loads all the enabled plugins.

Also used to reread the config file when the configuration has changed.

Definition at line 258 of file kopetepluginmanager.cpp.

PluginList Kopete::PluginManager::loadedPlugins ( const QString &  category = QString()) const

Returns a list of all plugins that are actually loaded.

If you omit the category you get all, otherwise it's a filtered list. See also availablePlugins().

Definition at line 138 of file kopetepluginmanager.cpp.

Plugin * Kopete::PluginManager::loadPlugin ( const QString &  pluginId,
PluginLoadMode  mode = LoadSync 
)
slot

Load a single plugin by plugin name.

Returns an existing plugin if one is already loaded in memory.

If mode is set to Async, the plugin will be queued and loaded in the background. This method will return a null pointer. To get the loaded plugin you can track the pluginLoaded() signal.

See also plugin().

Definition at line 340 of file kopetepluginmanager.cpp.

Plugin * Kopete::PluginManager::plugin ( const QString &  pluginName) const

Search by plugin name.

This is the key used as X-KDE-PluginInfo-Name in the .desktop file, e.g. "kopete_jabber"

Returns
The Kopete::Plugin object found by the search, or a null pointer if the plugin is not loaded.

If you want to also load the plugin you can better use loadPlugin, which returns the pointer to the plugin if it's already loaded.

Definition at line 444 of file kopetepluginmanager.cpp.

KPluginInfo Kopete::PluginManager::pluginInfo ( const Kopete::Plugin *  plugin) const
Returns
the KPluginInfo for the specified plugin

Definition at line 153 of file kopetepluginmanager.cpp.

void Kopete::PluginManager::pluginLoaded ( Kopete::Plugin *  plugin)
signal

Signals a new plugin has just been loaded.

void Kopete::PluginManager::pluginUnloaded ( const QString &  pluginName)
signal

Signals a plugin has just been unloaded.

void Kopete::PluginManager::protocolLoaded ( Kopete::Protocol *  protocol)
signal

Signals a new protocol has just been loaded.

Note
pluginLoaded is also emitted before this signal
PluginManager * Kopete::PluginManager::self ( )
static

Retrieve the plugin loader instance.

Definition at line 104 of file kopetepluginmanager.cpp.

bool Kopete::PluginManager::setPluginEnabled ( const QString &  name,
bool  enabled = true 
)

Enable a plugin.

This marks a plugin as enabled in the config file, so loadAll() can pick it up later.

This method does not actually load a plugin, it only edits the config file.

Parameters
nameis the name of the plugin as it is listed in the .desktop file in the X-KDE-Library field.
enabledsets whether or not the plugin is enabled

Returns false when no appropriate plugin can be found.

Definition at line 481 of file kopetepluginmanager.cpp.

void Kopete::PluginManager::shutdown ( )

Shuts down the plugin manager on Kopete shutdown, but first unloads all plugins asynchronously.

After 3 seconds all plugins should be removed; what's still left by then is unloaded through a hard delete instead.

Note that this call also derefs the plugin manager from the event loop, so do NOT call this method when not terminating Kopete!

Definition at line 164 of file kopetepluginmanager.cpp.

bool Kopete::PluginManager::unloadPlugin ( const QString &  pluginName)
slot

Unload the plugin specified by pluginName.

Definition at line 405 of file kopetepluginmanager.cpp.


The documentation for this class was generated from the following files:
  • kopetepluginmanager.h
  • kopetepluginmanager.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal