org.kde.koala

Class KXMLGUIClient

public class KXMLGUIClient extends Object implements QtSupport, KXMLGUIClientInterface

A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document, and can be dynamically merged with other KXMLGUIClients.

UNKNOWN:

Field Summary
static intStateNoReverse
static intStateReverse
Constructor Summary
protected KXMLGUIClient(Class dummy)
KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and an XML document, and which can be dynamically merged with other KXMLGUIClients.
KXMLGUIClient(KXMLGUIClientInterface parent)
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and an XML document, and which can be dynamically merged with other KXMLGUIClients.
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)
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.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
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.
protected voidfinalize()
Deletes the wrapped C++ instance
static StringfindMostRecentXMLFile(String[] files, StringBuffer doc)
voidinsertChildClient(KXMLGUIClientInterface child)
Use this method to make a client a child client of another client.
KInstanceInterfaceinstance()
booleanisDisposed()
Has the wrapped C++ instance been deleted?
StringlocalXMLFile()
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)
Sets the instance ( KInstance) for this part.
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()
This will return the name of the XML file as set by setXMLFile().
QDomDocumentxmlguiBuildDocument()

Field Detail

StateNoReverse

public static final int StateNoReverse

StateReverse

public static final int StateReverse

Constructor Detail

KXMLGUIClient

protected KXMLGUIClient(Class dummy)

KXMLGUIClient

public KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and an XML document, and which can be dynamically merged with other KXMLGUIClients.

UNKNOWN: Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and an XML document, and which can be dynamically merged with other KXMLGUIClients.

KXMLGUIClient

public KXMLGUIClient(KXMLGUIClientInterface parent)
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and an XML document, and which can be dynamically merged with other KXMLGUIClients. This constructor takes an additional parent argument, which makes the client a child client of the parent. Child clients are automatically added to the GUI if the parent is added.

UNKNOWN: Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and an XML document, and which can be dynamically merged with other KXMLGUIClients.

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)

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.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

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.

finalize

protected void finalize()
Deletes the wrapped C++ instance

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:

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

localXMLFile

public String localXMLFile()

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)
Sets the instance ( KInstance) for this part. Call this first in the inherited class constructor. (At least before setXMLFile().)

UNKNOWN: Sets the instance ( KInstance) for this part.

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()
This will return the name of the XML file as set by setXMLFile(). If setXML() is used directly, then this will return NULL. The filename that this returns is obvious for components as each component has exactly one XML file. In non-components, however, there are usually two: the global file and the local file. This function doesn't really care about that, though. It will always return the last XML file set. This, in almost all cases, will be the local XML file.

Returns: The name of the XML file or null

UNKNOWN: This will return the name of the XML file as set by setXMLFile().

xmlguiBuildDocument

public QDomDocument xmlguiBuildDocument()

UNKNOWN: