1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_configuration_SimpleSetUpdate_idl__
24cdf0e10cSrcweir#define __com_sun_star_configuration_SimpleSetUpdate_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_configuration_SimpleSetAccess_idl__
27cdf0e10cSrcweir#include <com/sun/star/configuration/SimpleSetAccess.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_container_XNameContainer_idl__
31cdf0e10cSrcweir#include <com/sun/star/container/XNameContainer.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_lang_XSingleServiceFactory_idl__
35cdf0e10cSrcweir#include <com/sun/star/lang/XSingleServiceFactory.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_lang_XMultiServiceFactory_idl__
39cdf0e10cSrcweir#include <com/sun/star/lang/XMultiServiceFactory.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir//=============================================================================
43cdf0e10cSrcweir
44cdf0e10cSrcweirmodule com { module sun { module star { module configuration {
45cdf0e10cSrcweir
46cdf0e10cSrcweir//=============================================================================
47cdf0e10cSrcweir/** provides write access to a dynamic, homogeneous, non-hierarchical set of
48cdf0e10cSrcweir values or objects.
49cdf0e10cSrcweir
50cdf0e10cSrcweir <p>Allows adding and removing elements.
51cdf0e10cSrcweir Helps create new elements to be added.
52cdf0e10cSrcweir </p>
53cdf0e10cSrcweir
54cdf0e10cSrcweir <p>This service extends <type>SimpleSetAccess</type> to support
55cdf0e10cSrcweir modifying the container. Any child objects shall in turn support
56cdf0e10cSrcweir modifying access.
57cdf0e10cSrcweir </p>
58cdf0e10cSrcweir*/
59cdf0e10cSrcweirpublished service SimpleSetUpdate
60cdf0e10cSrcweir{
61cdf0e10cSrcweir/** is the basic service providing read access to a (not necessarily
62cdf0e10cSrcweir hierarchical) <em>set</em>.
63cdf0e10cSrcweir*/
64cdf0e10cSrcweir	service SimpleSetAccess;
65cdf0e10cSrcweir
66cdf0e10cSrcweir/** allows inserting, removing, and replacing elements.
67cdf0e10cSrcweir
68cdf0e10cSrcweir <p>This interface extends the interface
69cdf0e10cSrcweir <type scope="com::sun::star::container">XNameAccess</type> supported
70cdf0e10cSrcweir by service <type>SimpleSetAccess</type> to allow modifying the container.
71cdf0e10cSrcweir </p>
72cdf0e10cSrcweir
73cdf0e10cSrcweir <p>If available, changes can be observed by registering a listener with interface
74cdf0e10cSrcweir <type scope="com::sun::star::container">XContainer</type>.
75cdf0e10cSrcweir </p>
76cdf0e10cSrcweir
77cdf0e10cSrcweir <p>If the elements of this set are of simple type (the type returned by
78cdf0e10cSrcweir <member scope="com::sun::star::container">XElementAccess::getElementType()</member>
79cdf0e10cSrcweir is not an interface type), then values of that type can directly be passed to
80cdf0e10cSrcweir <member scope="com::sun::star::container">XNameContainer::insertByName()</member>
81cdf0e10cSrcweir and
82cdf0e10cSrcweir <member scope="com::sun::star::container">XNameContainer::replaceByName()</member>.
83cdf0e10cSrcweir </p>
84cdf0e10cSrcweir
85cdf0e10cSrcweir <p>Otherwise new elements have to be constructed to match the type
86cdf0e10cSrcweir prescribed by the element template of this set. Such elements can be created
87cdf0e10cSrcweir using interfaces <type scope="com::sun::star::lang">XSingleServiceFactory</type>
88cdf0e10cSrcweir and, if supported, <type scope="com::sun::star::lang">XMultiServiceFactory</type>.
89cdf0e10cSrcweir </p>
90cdf0e10cSrcweir
91cdf0e10cSrcweir <p>Objects to be inserted must not be contained in any set at the time of
92cdf0e10cSrcweir insertion. <member scope="com::sun::star::container">XChild::getParent()</member>
93cdf0e10cSrcweir must return <NULL/>. If a name had been assigned to the object prior to insertion
94cdf0e10cSrcweir (using <member scope="com::sun::star::container">XNamed::setName()</member>
95cdf0e10cSrcweir or by other means), this name is ignored and will be lost.
96cdf0e10cSrcweir After insertion the name of the object is the name that was used as argument
97cdf0e10cSrcweir to <member scope="com::sun::star::container">XNameContainer::insertByName()</member>
98cdf0e10cSrcweir or <member scope="com::sun::star::container">XNameContainer::replaceByName()</member>.
99cdf0e10cSrcweir</p>
100cdf0e10cSrcweir
101cdf0e10cSrcweir
102cdf0e10cSrcweir <p>Objects that are removed using
103cdf0e10cSrcweir <member scope="com::sun::star::container">XNameContainer::removeByName()</member>
104cdf0e10cSrcweir or replaced using
105cdf0e10cSrcweir <member scope="com::sun::star::container">XNameContainer::replaceByName()</member>
106cdf0e10cSrcweir remain valid and can be reinserted into a set supporting the same template and
107cdf0e10cSrcweir even under a different name.
108cdf0e10cSrcweir </p>
109cdf0e10cSrcweir
110cdf0e10cSrcweir <p>An implementation need not support insertion of objects that were not
111cdf0e10cSrcweir obtained in one of the ways described above. If it does, the implementation
112cdf0e10cSrcweir must reject elements that do not have the correct structure as described
113cdf0e10cSrcweir by the template.
114cdf0e10cSrcweir </p>
115cdf0e10cSrcweir*/
116cdf0e10cSrcweir	interface com::sun::star::container::XNameContainer;
117cdf0e10cSrcweir
118cdf0e10cSrcweir/** allows creating an object that can be inserted into this set. [conditional]
119cdf0e10cSrcweir
120cdf0e10cSrcweir <p>This interface shall be implemented by an implementation,
121cdf0e10cSrcweir if and only if the element type of the set, as returned by
122cdf0e10cSrcweir <member scope="com::sun::star::container">XElementAccess::getElementType()</member>,
123cdf0e10cSrcweir is an object type, such as an interface.
124cdf0e10cSrcweir </p>
125cdf0e10cSrcweir
126cdf0e10cSrcweir <p>Using <member scope="com::sun::star::lang">XSingleServiceFactory::createInstance()</member>
127cdf0e10cSrcweir an instance of the element template of this set is created. If the set
128cdf0e10cSrcweir supports multiple templates or variations of the basic template, a default
129cdf0e10cSrcweir variant of the basic template is instantiated. If an implementation supports
130cdf0e10cSrcweir variations, they may be specified by passing arguments to
131cdf0e10cSrcweir <member scope="com::sun::star::lang">XSingleServiceFactory::createInstanceWithArguments()</member>.
132cdf0e10cSrcweir There are no predefined arguments for all versions of this service.
133cdf0e10cSrcweir </p>
134cdf0e10cSrcweir
135cdf0e10cSrcweir <p>The object created is not contained in the set and does not have a name yet.
136cdf0e10cSrcweir It may subsequently be inserted into the set and named using
137cdf0e10cSrcweir <member scope="com::sun::star::container">XNameContainer::insertByName()</member>
138cdf0e10cSrcweir or
139cdf0e10cSrcweir <member scope="com::sun::star::container">XNameContainer::replaceByName()</member>.
140cdf0e10cSrcweir </p>
141cdf0e10cSrcweir*/
142cdf0e10cSrcweir	[optional] interface com::sun::star::lang::XSingleServiceFactory;
143cdf0e10cSrcweir
144cdf0e10cSrcweir/** allows creating various objects that can be inserted into this set. [optional]
145cdf0e10cSrcweir
146cdf0e10cSrcweir <p>This interface may be implemented by an implementation of
147cdf0e10cSrcweir service SetUpdate to support creating elements from other than
148cdf0e10cSrcweir the basic element template. An example of this would be an
149cdf0e10cSrcweir implementation that supports inheritance, allowing the use of
150cdf0e10cSrcweir templates derived from the basic template by extension.
151cdf0e10cSrcweir </p>
152cdf0e10cSrcweir
153cdf0e10cSrcweir <p>This interface may only be implemented if the element type of the set
154cdf0e10cSrcweir (as returned by
155cdf0e10cSrcweir <member scope="com::sun::star::container">XElementAccess::getElementType()</member>)
156cdf0e10cSrcweir is an object type, such as an interface. An implementation should also implement
157cdf0e10cSrcweir interface <type>XTemplateContainer</type> which is optional in this service.
158cdf0e10cSrcweir </p>
159cdf0e10cSrcweir
160cdf0e10cSrcweir <p>The service identifier argument passed
161cdf0e10cSrcweir to <member scope="com::sun::star::lang">XMultiServiceFactory::createInstance()</member>
162cdf0e10cSrcweir or <member scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</member>
163cdf0e10cSrcweir names the template to be instantiated or otherwise identifies the structure
164cdf0e10cSrcweir to be built. The implementation must at least support using the template
165cdf0e10cSrcweir name obtained from <member>XTemplateContainer::getElementTemplateName()</member>
166cdf0e10cSrcweir as a service identifier, in which case the result shall be the same as if
167cdf0e10cSrcweir the corresponding member of <type scope="com::sun::star::lang">XSingleServiceFactory</type>
168cdf0e10cSrcweir had been called.
169cdf0e10cSrcweir </p>
170cdf0e10cSrcweir
171cdf0e10cSrcweir*/
172cdf0e10cSrcweir	[optional] interface com::sun::star::lang::XMultiServiceFactory;
173cdf0e10cSrcweir
174cdf0e10cSrcweir};
175cdf0e10cSrcweir
176cdf0e10cSrcweir//=============================================================================
177cdf0e10cSrcweir
178cdf0e10cSrcweir}; }; }; };
179cdf0e10cSrcweir
180cdf0e10cSrcweir#endif
181