LibreOffice: SetElement Service Reference

LibreOffice LibreOffice 7.6 SDK API Reference

Loading...
Searching...
No Matches
Included Services | Exported Interfaces | List of all members
SetElement Service Referencepublished

provides information about a dynamic element that can be inserted into a homogeneous set of elements within a hierarchy. More...

Inheritance diagram for SetElement:

## Included Services
service | HierarchyElement
| is the basic service for accessing information about an element in the hierarchy.

## Exported Interfaces
interface | com::sun::star::container::XChild
| provides access to the containing set object.
interface | com::sun::star::lang::XComponent
| allows controlling or observing the lifetime of the object.
interface | com::sun::star::configuration::XTemplateInstance
| provides information about the type of the element.
Exported Interfaces inherited from HierarchyElement
interface | com::sun::star::container::XHierarchicalName
| provides the complete hierarchical name of this element within the hierarchy tree.
interface | com::sun::star::container::XNamed
| provides the local name of this element within its parent.
interface | com::sun::star::beans::XProperty
| provides a property descriptor for this element.
interface | com::sun::star::beans::XPropertyWithState
| provides access to the default state of this element.
interface | com::sun::star::container::XChild
| provides access to the parent of this element [optional].

## Additional Inherited Members
Public Member Functions inherited from XHierarchicalName
string | getHierarchicalName ()
string | composeHierarchicalName ([in] string aRelativeName) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::NoSupportException )
| builds the hierarchical name of an object, given a relative name
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.
Public Member Functions inherited from XNamed
string | getName ()
void | setName ([in] string aName)
| sets the programmatic name of the object.
Public Member Functions inherited from XComponent
void | dispose ()
| The owner of an object calls this method to explicitly free all resources kept by this object and thus break cyclic references.
void | addEventListener ([in] XEventListener xListener)
| adds an event listener to the object.
void | removeEventListener ([in] XEventListener aListener)
| removes an event listener from the listener list.
Public Member Functions inherited from XTemplateInstance
string | getTemplateName ()
| retrieves the name of the template
Protected Member Functions inherited from XProperty
com::sun::star::beans::Property | getAsProperty ()
Protected Member Functions inherited from XPropertyWithState
com::sun::star::beans::PropertyState | getStateAsProperty ()
void | setToDefaultAsProperty () raises ( com::sun::star::lang::WrappedTargetException )
| sets this to its default value.
com::sun::star::uno::XInterface | getDefaultAsProperty () raises ( com::sun::star::lang::WrappedTargetException )
Protected Member Functions inherited from XChild
com::sun::star::uno::XInterface | getParent ()
| grants access to the object containing this content.
void | setParent ([in] com::sun::star::uno::XInterface Parent) raises ( com::sun::star::lang::NoSupportException )
| sets the parent to this object.

## Detailed Description

provides information about a dynamic element that can be inserted into a homogeneous set of elements within a hierarchy.

Provides information about the element. Provides access to its containing set object. Allows controlling the lifetime of the element.

Set elements may be added to and removed from the hierarchy at runtime. They bear user-defined names. They may exist independently, outside any container.

New set element instances generally are created through members of com::sun::star::lang::XSingleServiceFactory or, if supported, com::sun::star::lang::XMultiServiceFactory on an implementation of SetUpdate. Initially, they are not contained in a set object and have no meaningful name.

While an instance is not contained in a set object, it is owned by the client and can be disposed by calling com::sun::star::lang::XComponent::dispose(). The name of the object can freely be changed in that situation though without persistent effect.

When the instance is inserted into a set (this includes replacing an existing element), ownership is transferred to the container. While it is contained in the container, clients must not dispose the object. When inserted, the name of the object is fixed and is used to identify it within the container. An implementation may support com::sun::star::container::XNamed::setName() even in this case. If it does, changing the name has the same effect of removing the object (under the old name) and then reinserting it into the same container (using the new name).

When an instance is removed from a set (this includes being replaced by a new element), ownership is transferred to the client again. It can then be disposed or reinserted into a container. An instance can only be inserted into a container, if it was obtained from the same hierarchy.

When a set element is removed from its set from outside the hierarchy, the container disposes of the object. This occurrence can be detected by registering a com::sun::star::lang::XEventListener with the object.

If an implementation is part of a read-only view of the hierarchy, changing the name or parent is not supported (the object can't be removed from its container anyway).

See also
  com::sun::star::configuration::SetAccess Parent objects of this service generally implement service SetAccess.
  com::sun::star::configuration::GroupElement A complementary service for elements of a static heterogeneous collection.
  com::sun::star::configuration::AccessRootElement A complementary service for the root element of a hierarchy.

## Exported Interfaces

## ◆ HierarchyElement

service HierarchyElement

is the basic service for accessing information about an element in the hierarchy.

## Exported Interfaces

## ◆ com::sun::star::configuration::XTemplateInstance

interface com::sun::star::configuration::XTemplateInstance

provides information about the type of the element.

Set elements have a predetermined structure (their type), that is described by and can be generated from a template.

If the object was created using interface com::sun::star::lang::XSingleServiceFactory on an implementation of SetUpdate, this interface describes the same template as interface XTemplateContainer on that SetUpdate.

If the object was created using interface com::sun::star::lang::XMultiServiceFactory on an implementation of SetUpdate, this interface describes the template whose name was used as a service identifier for the factory method.

Otherwise, the semantics of the information provided about the template depends on the implementation.

See also
  com::sun::star::configuration::XTemplateContainer

## ◆ com::sun::star::container::XChild

interface com::sun::star::container::XChild

provides access to the containing set object.

In this service, this interface is mandatory

com::sun::star::container::XChild::getParent() returns `NULL`, if the object is currently not contained in a container.

An implementation may also support com::sun::star::container::XChild::setParent(). If it does, changing the parent has the effect of first removing the object from its old parent (if any) and then inserting it into the new parent (unless that is `NULL`) under the same name. The new parent must be part of the same hierarchy as the old one. The name of the object must have been set before.

## ◆ com::sun::star::lang::XComponent

interface com::sun::star::lang::XComponent

allows controlling or observing the lifetime of the object.

Clients may dispose of the object using com::sun::star::lang::XComponent::dispose(), only if the object is currently not contained in a container ( com::sun::star::container::XChild::getParent() returns `NULL`).

Clients may register a com::sun::star::lang::XEventListener to be notified, if the object is removed from its container by an outside source.

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

- com/sun/star/configuration/SetElement.idl