org.kde.koala

Class Plugin

public class Plugin extends QObject implements KXMLGUIClientInterface

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" (KDEDIR/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 PluginInfo

UNKNOWN: A plugin is the way to add actions to an existing KParts application, or to a Part.

Constructor Summary
protected Plugin(Class dummy)
Plugin(QObject parent, String name)
Construct a new KParts plugin.
Plugin(QObject parent)
Plugin()
Method Summary
KActionaction(String name)
Retrieves an action of the client by name.
KActionaction(QDomElement element)
Retrieves an action for a given QDomElement.
KActionCollectionactionCollection()
Retrieves the entire action collection for the GUI client.
voidaddStateActionDisabled(String state, String action)
voidaddStateActionEnabled(String state, String action)
voidbeginXMLPlug(QWidget arg1)
StringclassName()
KXMLGUIBuilderInterfaceclientBuilder()
Retrieves the client's GUI builder or null if no client specific builder has been assigned via setClientBuilder()
protected voidconserveMemory()
This function will attempt to give up some memory after the GUI is built.
QDomDocumentdomDocument()
voidendXMLPlug()
KXMLGUIFactoryfactory()
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return null if the client's GUI has not been built by a KXMLGUIFactory.
static StringfindMostRecentXMLFile(String[] files, StringBuffer doc)
voidinsertChildClient(KXMLGUIClientInterface child)
Use this method to make a client a child client of another client.
KInstanceInterfaceinstance()
protected static PluginloadPlugin(QObject parent, String libname)
static voidloadPlugins(QObject parent, KInstanceInterface instance)
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.
static voidloadPlugins(QObject parent, KXMLGUIClientInterface parentGUIClient, KInstanceInterface instance, boolean enableNewPluginsByDefault)
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 KConfig object of the given instance, to find out which plugins are enabled and which are disabled.
static voidloadPlugins(QObject parent, KXMLGUIClientInterface parentGUIClient, KInstanceInterface instance)
StringlocalXMLFile()
Reimplemented for internal reasons
QMetaObjectmetaObject()
KXMLGUIClientInterfaceparentClient()
KXMLGUIClients can form a simple child/parent object tree.
voidprepareXMLUnplug(QWidget arg1)
voidreloadXML()
Forces this client to re-read its XML resource file.
voidremoveChildClient(KXMLGUIClientInterface child)
Removes the given child from the client's children list.
voidsetClientBuilder(KXMLGUIBuilderInterface builder)
A client can have an own KXMLGUIBuilder.
protected voidsetDOMDocument(QDomDocument document, boolean merge)
Sets the Document for the part, describing the layout of the GUI.
protected voidsetDOMDocument(QDomDocument document)
voidsetFactory(KXMLGUIFactory factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.
protected voidsetInstance(KInstanceInterface instance)
Returns a list of plugin objects loaded for parent. This functions basically calls the queryList method of QObject to retrieve the list of child objects inheriting KParts.Plugin .
protected voidsetLocalXMLFile(String file)
protected voidsetXML(String document, boolean merge)
Sets the XML for the part.
protected voidsetXML(String document)
protected voidsetXMLFile(String file, boolean merge, boolean setXMLDoc)
Sets the name of the rc file containing the XML for the part.
protected voidsetXMLFile(String file, boolean merge)
protected voidsetXMLFile(String file)
voidsetXMLGUIBuildDocument(QDomDocument doc)
protected voidstateChanged(String newstate, int reverse)
Actions can collectively be assigned a "State".
protected voidstateChanged(String newstate)
voidunplugActionList(String name)
The complement of plugActionList() ...
StringxmlFile()
Reimplemented for internal reasons
QDomDocumentxmlguiBuildDocument()

Constructor Detail

Plugin

protected Plugin(Class dummy)

Plugin

public Plugin(QObject parent, String name)
Construct a new KParts plugin.

UNKNOWN: Construct a new KParts plugin.

Plugin

public Plugin(QObject parent)

Plugin

public Plugin()

Method Detail

action

public KAction action(String name)
Retrieves an action of the client by name. If not found, it looks in its child clients. This method is provided for convenience, as it uses actionCollection() to get the action object.

UNKNOWN: Retrieves an action of the client by name.

action

public KAction action(QDomElement element)
Retrieves an action for a given QDomElement. The default implementation uses the "name" attribute to query the action object via the other action() method.

UNKNOWN: Retrieves an action for a given QDomElement.

actionCollection

public KActionCollection actionCollection()
Retrieves the entire action collection for the GUI client. If you subclass KXMLGUIClient you should call KActionCollection.setWidget( QWidget ) with this object, or you will encounter subtle bugs with KAction keyboard shortcuts. This is not necessary if your KXMLGUIClient is a KMainWindow.

See Also: ( #kde#qt#QWidget*

UNKNOWN: Retrieves the entire action collection for the GUI client.

addStateActionDisabled

public void addStateActionDisabled(String state, String action)

addStateActionEnabled

public void addStateActionEnabled(String state, String action)

beginXMLPlug

public void beginXMLPlug(QWidget arg1)

className

public String className()

clientBuilder

public KXMLGUIBuilderInterface clientBuilder()
Retrieves the client's GUI builder or null if no client specific builder has been assigned via setClientBuilder()

UNKNOWN: Retrieves the client's GUI builder or 0L if no client specific builder has been assigned via setClientBuilder()

conserveMemory

protected void conserveMemory()
This function will attempt to give up some memory after the GUI is built. It should never be used in apps where the GUI may be rebuilt at some later time (components, for instance).

UNKNOWN: This function will attempt to give up some memory after the GUI is built.

domDocument

public QDomDocument domDocument()

Returns: The parsed XML in a QDomDocument, set by setXMLFile() or setXML(). This document describes the layout of the GUI.

UNKNOWN:

endXMLPlug

public void endXMLPlug()

factory

public KXMLGUIFactory factory()
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return null if the client's GUI has not been built by a KXMLGUIFactory.

UNKNOWN: Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0L if the client's GUI has not been built by a KXMLGUIFactory.

findMostRecentXMLFile

public static String findMostRecentXMLFile(String[] files, StringBuffer doc)

insertChildClient

public void insertChildClient(KXMLGUIClientInterface child)
Use this method to make a client a child client of another client. Usually you don't need to call this method, as it is called automatically when using the second constructor, which takes a parent argument.

UNKNOWN: Use this method to make a client a child client of another client.

instance

public KInstanceInterface instance()

Returns: The instance ( KInstance ) for this GUI client.

UNKNOWN:

loadPlugin

protected static Plugin loadPlugin(QObject parent, String libname)

Returns: The plugin created from the library libname

UNKNOWN:

loadPlugins

public static void loadPlugins(QObject parent, KInstanceInterface instance)
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.

UNKNOWN: Load the plugin libraries from the directories appropriate to instance and make the Plugin objects children of parent.

loadPlugins

public static void loadPlugins(QObject parent, KXMLGUIClientInterface parentGUIClient, KInstanceInterface instance, boolean enableNewPluginsByDefault)
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 KConfig 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-KDE-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() )
		 {
		   QPtrList plugins = KParts.Plugin.pluginObjects( this );
		   QPtrListIterator it( plugins );
		   KParts.Plugin  plugin;
		   while( ( plugin = it.current() ) != 0 )
		   {
		     ++it;
		     factory().addClient(  plugin );
		   }
		 }
		 

UNKNOWN: 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.

loadPlugins

public static void loadPlugins(QObject parent, KXMLGUIClientInterface parentGUIClient, KInstanceInterface instance)

localXMLFile

public String localXMLFile()
Reimplemented for internal reasons

UNKNOWN: Reimplemented for internal reasons

metaObject

public QMetaObject metaObject()

parentClient

public KXMLGUIClientInterface parentClient()
KXMLGUIClients can form a simple child/parent object tree. This method returns a pointer to the parent client or null if it has no parent client assigned.

UNKNOWN: KXMLGUIClients can form a simple child/parent object tree.

prepareXMLUnplug

public void prepareXMLUnplug(QWidget arg1)

reloadXML

public void reloadXML()
Forces this client to re-read its XML resource file. This is intended to be used when you know that the resource file has changed and you will soon be rebuilding the GUI. It has no useful effect with non-KParts GUIs, so don't bother using it unless your app is component based.

UNKNOWN: Forces this client to re-read its XML resource file.

removeChildClient

public void removeChildClient(KXMLGUIClientInterface child)
Removes the given child from the client's children list.

UNKNOWN: Removes the given child from the client's children list.

setClientBuilder

public void setClientBuilder(KXMLGUIBuilderInterface builder)
A client can have an own KXMLGUIBuilder. Use this method to assign your builder instance to the client (so that the KXMLGUIFactory can use it when building the client's GUI) Client specific guibuilders are useful if you want to create custom container widgets for your GUI.

UNKNOWN: A client can have an own KXMLGUIBuilder.

setDOMDocument

protected void setDOMDocument(QDomDocument document, boolean merge)
Sets the Document for the part, describing the layout of the GUI. Call this in the Part-inherited class constructor if you don't call setXMLFile or setXML .

UNKNOWN: Sets the Document for the part, describing the layout of the GUI.

setDOMDocument

protected void setDOMDocument(QDomDocument document)

setFactory

public void setFactory(KXMLGUIFactory factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.

UNKNOWN: This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.

setInstance

protected void setInstance(KInstanceInterface instance)
Returns a list of plugin objects loaded for parent. This functions basically calls the queryList method of QObject to retrieve the list of child objects inheriting KParts.Plugin .

UNKNOWN: Returns a list of plugin objects loaded for parent.

setLocalXMLFile

protected void setLocalXMLFile(String file)

setXML

protected void setXML(String document, boolean merge)
Sets the XML for the part. Call this in the Part-inherited class constructor if you don't call setXMLFile().

UNKNOWN: Sets the XML for the part.

setXML

protected void setXML(String document)

setXMLFile

protected void setXMLFile(String file, boolean merge, boolean setXMLDoc)
Sets the name of the rc file containing the XML for the part. Call this in the Part-inherited class constructor.

Parameters: file Either an absolute path for the file, or simply the filename, which will then be assumed to be installed in the "data" resource, under a directory named like the instance. merge Whether to merge with the global document. setXMLDoc Specify whether to call setXML. Default is true. and the DOM document at once.

UNKNOWN: Sets the name of the rc file containing the XML for the part.

setXMLFile

protected void setXMLFile(String file, boolean merge)

setXMLFile

protected void setXMLFile(String file)

setXMLGUIBuildDocument

public void setXMLGUIBuildDocument(QDomDocument doc)

UNKNOWN:

stateChanged

protected void stateChanged(String newstate, int reverse)
Actions can collectively be assigned a "State". To accomplish this the respective actions are tagged as \ or \ in a \ \ group of the XMLfile. During program execution the programmer can call stateChanged() to set actions to a defined state.

Parameters: newstate Name of a State in the XMLfile. reverse If the flag reverse is set to StateReverse, the State is reversed. (actions to be enabled will be disabled and action to be disabled will be enabled) Default is reverse=false.

UNKNOWN: Actions can collectively be assigned a "State".

stateChanged

protected void stateChanged(String newstate)

unplugActionList

public void unplugActionList(String name)
The complement of plugActionList() ...

UNKNOWN: The complement of plugActionList() .

xmlFile

public String xmlFile()
Reimplemented for internal reasons

UNKNOWN: Reimplemented for internal reasons

xmlguiBuildDocument

public QDomDocument xmlguiBuildDocument()

UNKNOWN: