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