1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SetElement.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_configuration_SetElement_idl__
31 #define __com_sun_star_configuration_SetElement_idl__
33 #ifndef __com_sun_star_configuration_HierarchyElement_idl__
34 #include
<com
/sun
/star
/configuration
/HierarchyElement.idl
>
37 #ifndef __com_sun_star_container_XChild_idl__
38 #include
<com
/sun
/star
/container
/XChild.idl
>
41 #ifndef __com_sun_star_lang_XComponent_idl__
42 #include
<com
/sun
/star
/lang
/XComponent.idl
>
45 #ifndef __com_sun_star_configuration_XTemplateInstance_idl__
46 #include
<com
/sun
/star
/configuration
/XTemplateInstance.idl
>
49 //=============================================================================
51 module com
{ module sun
{ module star
{ module configuration
{
53 //=============================================================================
54 /** provides information about a dynamic element that can be inserted into a
55 homogeneous set of elements within a hierarchy.
57 <p>Provides information about the element.
58 Provides access to its containing set object.
59 Allows controlling the lifetime of the element.
62 <p>Set elements may be added to and removed from the hierarchy at runtime.
63 They bear user-defined names. They may exist independently, outside any
67 <p>New set element instances generally are created through members of
68 <type scope="com::sun::star::lang">XSingleServiceFactory</type> or,
69 if supported, <type scope="com::sun::star::lang">XMultiServiceFactory</type>
70 on an implementation of <type>SetUpdate</type>. Initially, they are not
71 contained in a set object and have no meaningful name.
74 <p>While an instance is not contained in a set object, it is owned by
75 the client and can be disposed by calling
76 <member scope="com::sun::star::lang">XComponent::dispose()</member>. The name
77 of the object can freely be changed in that situation though without
81 <p>When the instance is inserted into a set (this includes replacing an
82 existing element), ownership is transferred to the container.
83 While it is contained in the container, clients must not dispose the
84 object. When inserted, the name of the object is fixed and is used to
85 identify it within the container. An implementation may support
86 <member scope="com::sun::star::container">XNamed::setName()</member> even in
87 this case. If it does, changing the name has the same effect of removing
88 the object (under the old name) and then reinserting it into the same
89 container (using the new name).
92 <p>When an instance is removed from a set (this includes being replaced by
93 a new element), ownership is transferred to the client again. It can then be
94 disposed or reinserted into a container. An instance can only be inserted
95 into a container, if it was obtained from the same hierarchy.
98 <p>When a set element is removed from its set from outside the hierarchy, the
99 container disposes of the object. This occurrence can be detected by registering
100 a <type scope="com::sun::star::lang">XEventListener</type> with the object.
103 <p>If an implementation is part of a <em>read-only</em> view of the hierarchy,
104 changing the name or parent is not supported (the object can't be removed from
105 its container anyway).
108 @see com::sun::star::configuration::SetAccess
109 Parent objects of this service generally implement service SetAccess.
111 @see com::sun::star::configuration::GroupElement
112 A complementary service for elements of a static heterogeneous collection.
114 @see com::sun::star::configuration::AccessRootElement
115 A complementary service for the root element of a hierarchy.
118 published service SetElement
120 /** is the basic service for accessing information about an element in the
123 service HierarchyElement
;
125 /** provides access to the containing set object.
127 <p>In this service, this interface is mandatory</p>
129 <p><member scope="com::sun::star::container">XChild::getParent()</member>
130 returns <NULL/>, if the object is currently not contained in a container.
133 <p>An implementation may also support
134 <member scope="com::sun::star::container">XChild::setParent()</member>.
135 If it does, changing the parent has the effect of first removing the object
136 from its old parent (if any) and then inserting it into the new parent
137 (unless that is <NULL/>) under the same name. The new parent must be part of
138 the same hierarchy as the old one. The name of the object must have been set
142 interface com
::sun
::star
::container
::XChild
;
144 /** allows controlling or observing the lifetime of the object.
146 <p>Clients may dispose of the object using
147 <member scope="com::sun::star::lang">XComponent::dispose()</member>, only if
148 the object is currently not contained in a container (
149 <member scope="com::sun::star::container">XChild::getParent()</member>
153 <p>Clients may register an <type scope="com::sun::star::lang">XEventListener</type>
154 to be notified, if the object is removed from its container by an outside source.
157 interface com
::sun
::star
::lang
::XComponent
;
159 /** provides information about the type of the element.
161 <p>Set elements have a predetermined structure (their <em>type</em>),
162 that is described by and can be generated from a <em>template</em>.
165 <p>If the object was created using interface
166 <type scope="com::sun::star::lang">XSingleServiceFactory</type>
167 on an implementation of <type>SetUpdate</type>, this interface describes the
168 same template as interface <type>XTemplateContainer</type> on that
169 <type>SetUpdate</type>.
171 <p>If the object was created using interface
172 <type scope="com::sun::star::lang">XMultiServiceFactory</type>
173 on an implementation of <type>SetUpdate</type>, this interface describes the
174 template whose name was used as a service identifier for the factory method.
176 <p>Otherwise, the semantics of the information provided about the template depends on the
180 @ see com::sun::star::configuration::XTemplateContainer
182 interface com
::sun
::star
::configuration
::XTemplateInstance
;
185 //=============================================================================