LibreOffice: XTreeControl Interface Reference

LibreOffice LibreOffice 7.2 SDK API Reference

Exported Interfaces | Public Member Functions | Public Attributes | List of all members
XTreeControl Interface Reference

An interface to a control that displays a set of hierarchical data as an outline. More...

`import"XTreeControl.idl";`

Inheritance diagram for XTreeControl:

## Exported Interfaces
interface | ::com::sun::star::view::XMultiSelectionSupplier
| This interfaces provides access to the selection of tree nodes for this control. More...

## Public Member Functions
boolean | isNodeExpanded ([in] XTreeNode Node) raises ( ::com::sun::star::lang::IllegalArgumentException )
| Returns `TRUE` if Node is currently expanded. More...
boolean | isNodeCollapsed ([in] XTreeNode Node) raises ( ::com::sun::star::lang::IllegalArgumentException )
| Returns `TRUE` if Node is currently collapsed. More...
void | makeNodeVisible ([in] XTreeNode Node) raises ( com::sun::star::lang::IllegalArgumentException, ExpandVetoException )
| Ensures that Node is currently visible. More...
boolean | isNodeVisible ([in] XTreeNode Node) raises ( com::sun::star::lang::IllegalArgumentException )
| Returns `TRUE` if Node is currently visible. More...
void | expandNode ([in] XTreeNode Node) raises ( com::sun::star::lang::IllegalArgumentException, ExpandVetoException )
| Ensures that Node is expanded and visible. More...
void | collapseNode ([in] XTreeNode Node) raises ( com::sun::star::lang::IllegalArgumentException, ExpandVetoException )
| Ensures that Node is collapsed. More...
void | addTreeExpansionListener ([in] XTreeExpansionListener Listener)
| Adds a listener for TreeExpansion events. More...
void | removeTreeExpansionListener ([in] XTreeExpansionListener Listener)
| Removes a listener for TreeExpansion events. More...
XTreeNode | getNodeForLocation ([in] long x, [in] long y)
| Returns the node at the specified location. More...
XTreeNode | getClosestNodeForLocation ([in] long x, [in] long y)
| Returns the node that is closest to x,y. More...
::com::sun::star::awt::Rectangle | getNodeRect ([in] XTreeNode Node) raises ( ::com::sun::star::lang::IllegalArgumentException )
| returns the rectangle occupied by the visual representation of the given node More...
boolean | isEditing ()
| Returns `TRUE` if one of tree's nodes is being currently edited. More...
boolean | stopEditing ()
| Ends the current editing session. More...
void | cancelEditing ()
| Cancels the current editing session. More...
void | startEditingAtNode ([in] XTreeNode Node) raises ( ::com::sun::star::lang::IllegalArgumentException )
| Selects Node and initiates editing. More...
void | addTreeEditListener ([in] XTreeEditListener Listener)
| Adds a XTreeEditListener. More...
void | removeTreeEditListener ([in] XTreeEditListener Listener)
| Removes a XTreeEditListener. More...
Public Member Functions inherited from XMultiSelectionSupplier
boolean | addSelection ([in] any Selection) raises ( com::sun::star::lang::IllegalArgumentException )
| adds the object or the objects represented by Selection to the selection of this XMultiSelectionSupplier. More...
void | removeSelection ([in] any Selection) raises ( com::sun::star::lang::IllegalArgumentException )
| remove the object or objects represented by Selection from the selection of this XMultiSelectionSupplier. More...
void | clearSelection ()
| clears the selection of this XMultiSelectionSupplier. More...
long | getSelectionCount ()
| returns the number of selected objects of this XMultiSelectionSupplier. More...
com::sun::star::container::XEnumeration | createSelectionEnumeration ()
com::sun::star::container::XEnumeration | createReverseSelectionEnumeration ()
Public Member Functions inherited from XSelectionSupplier
boolean | select ([in] any xSelection) raises ( com::sun::star::lang::IllegalArgumentException )
| selects the object represented by xSelection if it is known and selectable in this object. More...
any | getSelection ()
void | addSelectionChangeListener ([in] com::sun::star::view::XSelectionChangeListener xListener)
| registers an event listener, which is called when the selection changes. More...
void | removeSelectionChangeListener ([in] com::sun::star::view::XSelectionChangeListener xListener)
| unregisters an event listener which was registered with XSelectionSupplier::addSelectionChangeListener(). More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Public Attributes
string | DefaultExpandedGraphicURL
| If the given URL points to a loadable graphic, the graphic is rendered before expanded non leaf nodes. More...
string | DefaultCollapsedGraphicURL
| If the given URL points to a loadable graphic, the graphic is rendered before collapsed non leaf nodes. More...

## Detailed Description

An interface to a control that displays a set of hierarchical data as an outline.

See also
  TreeControl

## Exported Interfaces

## ◆ ::com::sun::star::view::XMultiSelectionSupplier

interface ::com::sun::star::view::XMultiSelectionSupplier

This interfaces provides access to the selection of tree nodes for this control.

valid selection values for this interface are XTreeNode or sequence<XTreeNode>.

com::sun::star::view::XSelectionSupplier::getSelection() returns an empty any for no selection, an any with XTreeNode for a single selection and a sequence<XTreeNode> for a multiselection.

## Member Function Documentation

## ◆ addTreeEditListener()

void addTreeEditListener | ( | [in] XTreeEditListener | Listener | ) |

Adds a XTreeEditListener.

Parameters

  Listener | a XTreeEditListener that will be notified before and after a tree node is edited.

## ◆ addTreeExpansionListener()

void addTreeExpansionListener | ( | [in] XTreeExpansionListener | Listener | ) |

Adds a listener for TreeExpansion events.

Parameters

  Listener | a XTreeExpansionListener that will be notified when a tree node is expanded or collapsed.

## ◆ cancelEditing()

void cancelEditing | ( |  | ) |

Cancels the current editing session.

Has no effect if the tree isn't being edited.

## ◆ collapseNode()

void collapseNode | ( | [in] XTreeNode | Node | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | ExpandVetoException
| ) |  |

Ensures that Node is collapsed.

Parameters

  Node | the XTreeNode identifying a node

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.
  ExpandVetoException | if collapsing Node failed because at least one of the registered XTreeExpansionListener raised an ExpandVetoException.

## ◆ expandNode()

void expandNode | ( | [in] XTreeNode | Node | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | ExpandVetoException
| ) |  |

Ensures that Node is expanded and visible.

If Node is a leaf node, this will have no effect.

Parameters

  Node | the XTreeNode identifying a node.

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.
  ExpandVetoException | if expanding Node failed because at least one of the registered XTreeExpansionListener raised an ExpandVetoException.

## ◆ getClosestNodeForLocation()

XTreeNode getClosestNodeForLocation | ( | [in] long | x,
|  | [in] long | y
| ) |  |

Returns the node that is closest to x,y.

If no nodes are currently viewable, or there is no model, returns null, otherwise it always returns a valid node. To test if the node is exactly at x, y, use getNodeForLocation().

Parameters

  x | an integer giving the number of pixels horizontally from the left edge of the controls display area
  y | an integer giving the number of pixels vertically from the top edge of the controls display area

Returns
  the XTreeNode for the node closest to that location, null if nothing is viewable or there is no model

## ◆ getNodeForLocation()

XTreeNode getNodeForLocation | ( | [in] long | x,
|  | [in] long | y
| ) |  |

Returns the node at the specified location.

Parameters

  x | an integer giving the number of pixels horizontally from the left edge of the controls display area
  y | an integer giving the number of pixels vertically from the top edge of the controls display area

Returns
  the XTreeNode for the node at that location, or 0 if there is no node at the given position

## ◆ getNodeRect()

::com::sun::star::awt::Rectangle getNodeRect | ( | [in] XTreeNode | Node | ) |
raises | ( | ::com::sun::star::lang::IllegalArgumentException
| ) |  |

returns the rectangle occupied by the visual representation of the given node

Parameters

  Node | the node whose geometry should be obtained

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the given node is `NULL`, or does not belong to the tree's data model

## ◆ isEditing()

boolean isEditing | ( |  | ) |

Returns `TRUE` if one of tree's nodes is being currently edited.

The node that is being edited can be obtained using com::sun::star::view::XSelectionSupplier::getSelection().

Returns
  `TRUE` if the user is currently editing a node

## ◆ isNodeCollapsed()

boolean isNodeCollapsed | ( | [in] XTreeNode | Node | ) |
raises | ( | ::com::sun::star::lang::IllegalArgumentException
| ) |  |

Returns `TRUE` if Node is currently collapsed.

Parameters

  Node | the XTreeNode specifying the node to check

Returns
  `TRUE` if Node or at least one of its parent nodes are collapsed, `FALSE` if Node and all of its parent nodes are expanded

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.

## ◆ isNodeExpanded()

boolean isNodeExpanded | ( | [in] XTreeNode | Node | ) |
raises | ( | ::com::sun::star::lang::IllegalArgumentException
| ) |  |

Returns `TRUE` if Node is currently expanded.

Parameters

  Node | the XTreeNode specifying the node to check.

Returns
  `FALSE` if Node or at least one of its parent nodes are collapsed, `TRUE` if Node and all of its parent nodes are expanded.

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.

## ◆ isNodeVisible()

boolean isNodeVisible | ( | [in] XTreeNode | Node | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException
| ) |  |

Returns `TRUE` if Node is currently visible.

Visible means it is either the root or all of its parents are expanded.

Returns
  `TRUE` if Node is visible, otherwise `FALSE`

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.

## ◆ makeNodeVisible()

void makeNodeVisible | ( | [in] XTreeNode | Node | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | ExpandVetoException
| ) |  |

Ensures that Node is currently visible.

This includes expanding all parent nodes and scroll the control so this node is visible in the controls display area.

Parameters

  Node | the XTreeNode specifying the node to make visible.

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.
  ExpandVetoException | if Nodecan't be made visible since at least one of the parent nodes are collapsed and expanding failed because at least one of the registered XTreeExpansionListener raised an ExpandVetoException.

## ◆ removeTreeEditListener()

void removeTreeEditListener | ( | [in] XTreeEditListener | Listener | ) |

Removes a XTreeEditListener.

Parameters

  Listener | the XTreeEditListener to remove

## ◆ removeTreeExpansionListener()

void removeTreeExpansionListener | ( | [in] XTreeExpansionListener | Listener | ) |

Removes a listener for TreeExpansion events.

Parameters

  Listener | the XTreeExpansionListener to remove.

## ◆ startEditingAtNode()

void startEditingAtNode | ( | [in] XTreeNode | Node | ) |
raises | ( | ::com::sun::star::lang::IllegalArgumentException
| ) |  |

Selects Node and initiates editing.

If TreeControlModel::Editable is `FALSE` or if there are no registered XTreeEditListener, this call has no effect.

Calling this method also ensures that Node will become visible.

Parameters

  Node | the XTreeNode identifying a node.

Exceptions

  com::sun::star::lang::IllegalArgumentException | if Node is not a valid node of the corresponding XTreeDataModel.

## ◆ stopEditing()

boolean stopEditing | ( |  | ) |

Ends the current editing session.

All registered XTreeEditListener are notified if an editing session was in progress

Has no effect if the tree isn't being edited.

Returns
  `TRUE` if editing was in progress and is now stopped, `FALSE` if editing was not in progress

## Member Data Documentation

## ◆ DefaultCollapsedGraphicURL

string DefaultCollapsedGraphicURL
| attribute

If the given URL points to a loadable graphic, the graphic is rendered before collapsed non leaf nodes.

This can be overridden for individual nodes by XTreeNode::getCollapsedGraphicURL()

## ◆ DefaultExpandedGraphicURL

string DefaultExpandedGraphicURL
| attribute

If the given URL points to a loadable graphic, the graphic is rendered before expanded non leaf nodes.

This can be overridden for individual nodes by XTreeNode::getExpandedGraphicURL()

The documentation for this interface was generated from the following file:

- com/sun/star/awt/tree/XTreeControl.idl