• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeparts
 

tdeparts

  • KParts
  • Plugin
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
KParts::Plugin Class Reference

#include <plugin.h>

Inheritance diagram for KParts::Plugin:
KXMLGUIClient

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
 
virtual TQString xmlFile () 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 setInstance (TDEInstance *instance)
 
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

Definition at line 49 of file plugin.h.

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()

Plugin::~Plugin ( )
virtual

Destructor.

Definition at line 59 of file plugin.cpp.

Member Function Documentation

◆ loadPlugin()

Plugin * Plugin::loadPlugin ( TQObject *  parent,
const char *  libname 
)
staticprotected

Definition at line 176 of file plugin.cpp.

◆ loadPlugins() [1/4]

void Plugin::loadPlugins ( TQObject *  parent,
const TDEInstance *  instance 
)
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]

void Plugin::loadPlugins ( TQObject *  parent,
const TQValueList< PluginInfo > &  pluginInfos 
)
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]

void Plugin::loadPlugins ( TQObject *  parent,
const TQValueList< PluginInfo > &  pluginInfos,
const TDEInstance *  instance 
)
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]

void Plugin::loadPlugins ( TQObject *  parent,
KXMLGUIClient *  parentGUIClient,
TDEInstance *  instance,
bool  enableNewPluginsByDefault = true 
)
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:

if( factory() )
{
TQPtrList<KParts::Plugin> plugins = KParts::Plugin::pluginObjects( this );
TQPtrListIterator<KParts::Plugin> it( plugins );
KParts::Plugin * plugin;
while( ( plugin = it.current() ) != 0 )
{
++it;
factory()->addClient( plugin );
}
}
KParts::Plugin
A plugin is the way to add actions to an existing KParts application, or to a Part.
Definition: plugin.h:50
KParts::Plugin::pluginObjects
static TQPtrList< Plugin > pluginObjects(TQObject *parent)
Returns a list of plugin objects loaded for parent.
Definition: plugin.cpp:185
KXMLGUIClient::factory
KXMLGUIFactory * factory() const
KXMLGUIFactory::addClient
void addClient(KXMLGUIClient *client)

Definition at line 227 of file plugin.cpp.

◆ localXMLFile()

TQString Plugin::localXMLFile ( ) const
virtual

Reimplemented for internal reasons.

Definition at line 76 of file plugin.cpp.

◆ pluginInfos()

TQValueList< Plugin::PluginInfo > Plugin::pluginInfos ( const TDEInstance *  instance)
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()

TQPtrList< KParts::Plugin > Plugin::pluginObjects ( TQObject *  parent)
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.

◆ setInstance()

void Plugin::setInstance ( TDEInstance *  instance)
protectedvirtual

Reimplemented from KXMLGUIClient.

Definition at line 221 of file plugin.cpp.

◆ xmlFile()

TQString Plugin::xmlFile ( ) const
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:
  • plugin.h
  • plugin.cpp

tdeparts

Skip menu "tdeparts"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeparts

Skip menu "tdeparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeparts by doxygen 1.9.4
This website is maintained by Timothy Pearson.