#include <plugin.h>
Classes | |
struct | PluginInfo |
Public Member Functions | |
Plugin (TQObject *parent=0, const char *name=0) | |
virtual | ~Plugin () |
virtual TQString | xmlFile () const |
virtual TQString | localXMLFile () const |
Public Member Functions inherited from KXMLGUIClient | |
KXMLGUIClient (KXMLGUIClient *parent) | |
TDEAction * | action (const char *name) const |
virtual TDEAction * | action (const TQDomElement &element) const |
virtual TDEActionCollection * | actionCollection () const |
virtual TDEInstance * | instance () const |
virtual TQDomDocument | domDocument () const |
void | setXMLGUIBuildDocument (const TQDomDocument &doc) |
TQDomDocument | xmlguiBuildDocument () const |
void | setFactory (KXMLGUIFactory *factory) |
KXMLGUIFactory * | factory () const |
KXMLGUIClient * | parentClient () const |
void | insertChildClient (KXMLGUIClient *child) |
void | removeChildClient (KXMLGUIClient *child) |
const TQPtrList< KXMLGUIClient > * | childClients () |
void | setClientBuilder (KXMLGUIBuilder *builder) |
KXMLGUIBuilder * | clientBuilder () const |
void | reloadXML () |
void | plugActionList (const TQString &name, const TQPtrList< TDEAction > &actionList) |
void | unplugActionList (const TQString &name) |
void | beginXMLPlug (TQWidget *) |
void | endXMLPlug () |
void | prepareXMLUnplug (TQWidget *) |
Static Public Member Functions | |
static void | loadPlugins (TQObject *parent, const TDEInstance *instance) |
static void | loadPlugins (TQObject *parent, const TQValueList< PluginInfo > &pluginInfos) |
static void | loadPlugins (TQObject *parent, const TQValueList< PluginInfo > &pluginInfos, const TDEInstance *instance) |
static void | loadPlugins (TQObject *parent, KXMLGUIClient *parentGUIClient, TDEInstance *instance, bool enableNewPluginsByDefault=true) |
static TQPtrList< Plugin > | pluginObjects (TQObject *parent) |
Protected Member Functions | |
virtual void | setInstance (TDEInstance *instance) |
Protected Member Functions inherited from KXMLGUIClient | |
virtual void | setXMLFile (const TQString &file, bool merge=false, bool setXMLDoc=true) |
virtual void | setXML (const TQString &document, bool merge=false) |
virtual void | setDOMDocument (const TQDomDocument &document, bool merge=false) |
virtual void | conserveMemory () |
virtual void | stateChanged (const TQString &newstate, ReverseStateChange reverse=StateNoReverse) |
Static Protected Member Functions | |
static TQValueList< Plugin::PluginInfo > | pluginInfos (const TDEInstance *instance) |
static Plugin * | loadPlugin (TQObject *parent, const char *libname) |
Detailed Description
A plugin is the way to add actions to an existing KParts application, or to a Part.
The XML of those plugins looks exactly like of the shell or parts, with one small difference: The document tag should have an additional attribute, named "library", and contain the name of the library implementing the plugin.
If you want this plugin to be used by a part, you need to install the rc file under the directory "data" (TDEDIR/share/apps usually)+"/instancename/kpartplugins/" where instancename is the name of the part's instance.
You should also install a "plugin info" .desktop file with the same name.
- See also
- PluginInfo
Constructor & Destructor Documentation
◆ Plugin()
Plugin::Plugin | ( | TQObject * | parent = 0 , |
const char * | name = 0 |
||
) |
Construct a new KParts plugin.
Definition at line 52 of file plugin.cpp.
◆ ~Plugin()
|
virtual |
Destructor.
Definition at line 59 of file plugin.cpp.
Member Function Documentation
◆ loadPlugins() [1/4]
|
static |
Load the plugin libraries from the directories appropriate to instance
and make the Plugin objects children of parent
.
It is recommended to use the last loadPlugins method instead, to support enabling and disabling of plugins.
Definition at line 141 of file plugin.cpp.
◆ loadPlugins() [2/4]
|
static |
Load the plugin libraries specified by the list docs
and make the Plugin objects children of parent
.
It is recommended to use the last loadPlugins method instead, to support enabling and disabling of plugins.
Definition at line 170 of file plugin.cpp.
◆ loadPlugins() [3/4]
|
static |
Load the plugin libraries specified by the list pluginInfos
, make the Plugin objects children of parent
, and use the given instance
.
It is recommended to use the last loadPlugins method instead, to support enabling and disabling of plugins.
Definition at line 146 of file plugin.cpp.
◆ loadPlugins() [4/4]
|
static |
Load the plugin libraries for the given instance
, make the Plugin objects children of parent
, and insert the plugin as a child GUI client of parentGUIClient
.
This method uses the TDEConfig object of the given instance, to find out which plugins are enabled and which are disabled. What happens by default (i.e. for new plugins that are not in that config file) is controlled by enableNewPluginsByDefault
. It can be overridden by the plugin if it sets the X-TDE-PluginInfo-EnabledByDefault key in the .desktop file (with the same name as the .rc file)
If a disabled plugin is already loaded it will be removed from the GUI factory and deleted.
This method is automatically called by KParts::Plugin and by KParts::MainWindow.
If you call this method in an already constructed GUI (like when the user has changed which plugins are enabled) you need to add the new plugins to the KXMLGUIFactory:
Definition at line 227 of file plugin.cpp.
◆ localXMLFile()
|
virtual |
Reimplemented for internal reasons.
Definition at line 76 of file plugin.cpp.
◆ pluginInfos()
|
staticprotected |
Look for plugins in the instance's
"data" directory (+"/kpartplugins")
- Returns
- A list of TQDomDocument s, containing the parsed xml documents returned by plugins.
Definition at line 89 of file plugin.cpp.
◆ pluginObjects()
|
static |
Returns a list of plugin objects loaded for parent
.
This functions basically calls the queryList method of TQObject to retrieve the list of child objects inheriting KParts::Plugin .
Definition at line 185 of file plugin.cpp.
◆ xmlFile()
|
virtual |
Reimplemented for internal reasons.
Reimplemented from KXMLGUIClient.
Definition at line 64 of file plugin.cpp.
The documentation for this class was generated from the following files: