# class KXMLGUIFactory

###

Module | kdeui
Namespace |
Class | KXMLGUIFactory
Inherits | QObject

### methods

- KXMLGUIFactory (builder, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  builder | KXMLGUIBuilder |
  parent | QObject | 0

  Constructs a KXMLGUIFactory. The provided builder KXMLGUIBuilder will be called for creating and removing container widgets, when clients are added/removed from the GUI.

  Note that the ownership of the given KXMLGUIBuilder object won't be transferred to this KXMLGUIFactory, so you have to take care of deleting it properly.

- KXMLGUIFactory (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KXMLGUIBuilder |
  a1 | QObject | 0

- actionPropertiesElement (doc)

  returns QDomElement
  static

  Argument | Type | Default
  --- | --- | ---
  doc | QDomDocument |

  Internal Find or create the ActionProperties element, used when saving custom action properties

- addClient (client)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  client | KXMLGUIClient |

  Creates the GUI described by the QDomDocument of the client, using the client's actions, and merges it with the previously created GUI. This also means that the order in which clients are added to the factory is relevant; assuming that your application supports plugins, you should first add your application to the factory and then the plugin, so that the plugin's UI is merged into the UI of your application, and not the other way round.

- clientAdded (client)

  returns Nothing
  SIGNAL ("clientAdded (KXMLGUIClient*)")

  Argument | Type | Default
  --- | --- | ---
  client | KXMLGUIClient |

- clientRemoved (client)

  returns Nothing
  SIGNAL ("clientRemoved (KXMLGUIClient*)")

  Argument | Type | Default
  --- | --- | ---
  client | KXMLGUIClient |

- clients ( )

  returns QList<KXMLGUIClient

  Returns a list of all clients currently added to this factory

- configureShortcuts (bAllowLetterShortcuts, bSaveSettings)

  returns int

  Argument | Type | Default
  --- | --- | ---
  bAllowLetterShortcuts | bool | 1
  bSaveSettings | bool | 1

  Show a standard configure shortcut for every action in this factory.

  This slot can be connected directly to the action to configure shortcuts. This is very simple to do that by adding a single line

      KStandardAction.keyBindings( guiFactory(), SLOT( configureShortcuts() ), actionCollection() );

  bAllowLetterShortcuts - Set to false if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts.

  bSaveSettings - if true, the settings will also be saved back to the *uirc file which they were intially read from.

- container (containerName, client, useTagName)

  returns QWidget

  Argument | Type | Default
  --- | --- | ---
  containerName | QString |
  client | KXMLGUIClient |
  useTagName | bool | 0

  Use this method to get access to a container widget with the name specified with containerName and which is owned by the client. The container name is specified with a "name" attribute in the XML document.

  This function is particularly useful for getting hold of a popupmenu defined in an XMLUI file. For instance:

      QMenu *popup = static_cast<QMenu*>(guiFactory()->container("my_popup",this));

  where "my_popup" is the name of the menu in the XMLUI file, and "this" is XMLGUIClient which owns the popupmenu (e.g. the mainwindow, or the part, or the plugin...)

  containerName - Name of the container widget

  client - Owner of the container widget

  useTagName - Specifies whether to compare the specified name with the name attribute or the tag name.

  This method may return 0 if no container with the given name exists or is not owned by the client.

- containers (tagName)

  returns QList<QWidget

  Argument | Type | Default
  --- | --- | ---
  tagName | QString |

- findActionByName (elem, sName, create)

  returns QDomElement
  static

  Argument | Type | Default
  --- | --- | ---
  elem | QDomElement |
  sName | QString |
  create | bool |

  Internal Find or create the element for a given action, by name. Used when saving custom action properties

- plugActionList (client, name, actionList)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  client | KXMLGUIClient |
  name | QString |
  actionList | QList<QAction |

- readConfigFile (filename, componentData)

  returns QString
  static

  Argument | Type | Default
  --- | --- | ---
  filename | QString |
  componentData | KComponentData | KComponentData()

  Internal

- removeClient (client)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  client | KXMLGUIClient |

  Removes the GUI described by the client, by unplugging all provided actions and removing all owned containers (and storing container state information in the given client)

- reset ( )

  returns Nothing

  Use this method to free all memory allocated by the KXMLGUIFactory. This deletes the internal node tree and therefore resets the internal state of the class. Please note that the actual GUI is NOT touched at all, meaning no containers are deleted nor any actions unplugged. That is something you have to do on your own. So use this method only if you know what you are doing :-)

  (also note that this will call KXMLGUIClient.setFactory( 0 ) for all inserted clients)

- resetContainer (containerName, useTagName)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  containerName | QString |
  useTagName | bool | 0

  Use this method to free all memory allocated by the KXMLGUIFactory for a specific container, including all child containers and actions. This deletes the internal node subtree for the specified container. The actual GUI is not touched, no containers are deleted or any actions unplugged. Use this method only if you know what you are doing :-)

  (also note that this will call KXMLGUIClient.setFactory( 0 ) for all clients of the container)

- saveConfigFile (doc, filename, componentData)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  doc | QDomDocument |
  filename | QString |
  componentData | KComponentData | KComponentData()

  Internal

- unplugActionList (client, name)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  client | KXMLGUIClient |
  name | QString |