/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef __com_sun_star_configuration_SetElement_idl__ #define __com_sun_star_configuration_SetElement_idl__ #ifndef __com_sun_star_configuration_HierarchyElement_idl__ #include #endif #ifndef __com_sun_star_container_XChild_idl__ #include #endif #ifndef __com_sun_star_lang_XComponent_idl__ #include #endif #ifndef __com_sun_star_configuration_XTemplateInstance_idl__ #include #endif //============================================================================= module com { module sun { module star { module configuration { //============================================================================= /** 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 XSingleServiceFactory or, if supported, 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 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 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 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 com::sun::star::configuration::SetAccess Parent objects of this service generally implement service SetAccess. @see com::sun::star::configuration::GroupElement A complementary service for elements of a static heterogeneous collection. @see com::sun::star::configuration::AccessRootElement A complementary service for the root element of a hierarchy. */ published service SetElement { /** is the basic service for accessing information about an element in the hierarchy. */ service HierarchyElement; /** provides access to the containing set object.

In this service, this interface is mandatory

XChild::getParent() returns , if the object is currently not contained in a container.

An implementation may also support 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 ) 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.

*/ interface com::sun::star::container::XChild; /** allows controlling or observing the lifetime of the object.

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

Clients may register an XEventListener to be notified, if the object is removed from its container by an outside source.

*/ interface com::sun::star::lang::XComponent; /** 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 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 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 com::sun::star::configuration::XTemplateContainer */ interface com::sun::star::configuration::XTemplateInstance; }; //============================================================================= }; }; }; }; #endif