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_SetElement_idl__ 24cdf0e10cSrcweir#define __com_sun_star_configuration_SetElement_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_configuration_HierarchyElement_idl__ 27cdf0e10cSrcweir#include <com/sun/star/configuration/HierarchyElement.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_container_XChild_idl__ 31cdf0e10cSrcweir#include <com/sun/star/container/XChild.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__ 35cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir#ifndef __com_sun_star_configuration_XTemplateInstance_idl__ 39cdf0e10cSrcweir#include <com/sun/star/configuration/XTemplateInstance.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir//============================================================================= 43cdf0e10cSrcweir 44cdf0e10cSrcweirmodule com { module sun { module star { module configuration { 45cdf0e10cSrcweir 46cdf0e10cSrcweir//============================================================================= 47cdf0e10cSrcweir/** provides information about a dynamic element that can be inserted into a 48cdf0e10cSrcweir homogeneous set of elements within a hierarchy. 49cdf0e10cSrcweir 50cdf0e10cSrcweir <p>Provides information about the element. 51cdf0e10cSrcweir Provides access to its containing set object. 52cdf0e10cSrcweir Allows controlling the lifetime of the element. 53cdf0e10cSrcweir </p> 54cdf0e10cSrcweir 55cdf0e10cSrcweir <p>Set elements may be added to and removed from the hierarchy at runtime. 56cdf0e10cSrcweir They bear user-defined names. They may exist independently, outside any 57cdf0e10cSrcweir container. 58cdf0e10cSrcweir </p> 59cdf0e10cSrcweir 60cdf0e10cSrcweir <p>New set element instances generally are created through members of 61cdf0e10cSrcweir <type scope="com::sun::star::lang">XSingleServiceFactory</type> or, 62cdf0e10cSrcweir if supported, <type scope="com::sun::star::lang">XMultiServiceFactory</type> 63cdf0e10cSrcweir on an implementation of <type>SetUpdate</type>. Initially, they are not 64cdf0e10cSrcweir contained in a set object and have no meaningful name. 65cdf0e10cSrcweir </p> 66cdf0e10cSrcweir 67cdf0e10cSrcweir <p>While an instance is not contained in a set object, it is owned by 68cdf0e10cSrcweir the client and can be disposed by calling 69cdf0e10cSrcweir <member scope="com::sun::star::lang">XComponent::dispose()</member>. The name 70cdf0e10cSrcweir of the object can freely be changed in that situation though without 71cdf0e10cSrcweir persistent effect. 72cdf0e10cSrcweir </p> 73cdf0e10cSrcweir 74cdf0e10cSrcweir <p>When the instance is inserted into a set (this includes replacing an 75cdf0e10cSrcweir existing element), ownership is transferred to the container. 76cdf0e10cSrcweir While it is contained in the container, clients must not dispose the 77cdf0e10cSrcweir object. When inserted, the name of the object is fixed and is used to 78cdf0e10cSrcweir identify it within the container. An implementation may support 79cdf0e10cSrcweir <member scope="com::sun::star::container">XNamed::setName()</member> even in 80cdf0e10cSrcweir this case. If it does, changing the name has the same effect of removing 81cdf0e10cSrcweir the object (under the old name) and then reinserting it into the same 82cdf0e10cSrcweir container (using the new name). 83cdf0e10cSrcweir </p> 84cdf0e10cSrcweir 85cdf0e10cSrcweir <p>When an instance is removed from a set (this includes being replaced by 86cdf0e10cSrcweir a new element), ownership is transferred to the client again. It can then be 87cdf0e10cSrcweir disposed or reinserted into a container. An instance can only be inserted 88cdf0e10cSrcweir into a container, if it was obtained from the same hierarchy. 89cdf0e10cSrcweir </p> 90cdf0e10cSrcweir 91cdf0e10cSrcweir <p>When a set element is removed from its set from outside the hierarchy, the 92cdf0e10cSrcweir container disposes of the object. This occurrence can be detected by registering 93cdf0e10cSrcweir a <type scope="com::sun::star::lang">XEventListener</type> with the object. 94cdf0e10cSrcweir </p> 95cdf0e10cSrcweir 96cdf0e10cSrcweir <p>If an implementation is part of a <em>read-only</em> view of the hierarchy, 97cdf0e10cSrcweir changing the name or parent is not supported (the object can't be removed from 98cdf0e10cSrcweir its container anyway). 99cdf0e10cSrcweir </p> 100cdf0e10cSrcweir 101cdf0e10cSrcweir @see com::sun::star::configuration::SetAccess 102cdf0e10cSrcweir Parent objects of this service generally implement service SetAccess. 103cdf0e10cSrcweir 104cdf0e10cSrcweir @see com::sun::star::configuration::GroupElement 105cdf0e10cSrcweir A complementary service for elements of a static heterogeneous collection. 106cdf0e10cSrcweir 107cdf0e10cSrcweir @see com::sun::star::configuration::AccessRootElement 108cdf0e10cSrcweir A complementary service for the root element of a hierarchy. 109cdf0e10cSrcweir 110cdf0e10cSrcweir*/ 111cdf0e10cSrcweirpublished service SetElement 112cdf0e10cSrcweir{ 113cdf0e10cSrcweir/** is the basic service for accessing information about an element in the 114cdf0e10cSrcweir hierarchy. 115cdf0e10cSrcweir*/ 116cdf0e10cSrcweir service HierarchyElement; 117cdf0e10cSrcweir 118cdf0e10cSrcweir/** provides access to the containing set object. 119cdf0e10cSrcweir 120cdf0e10cSrcweir <p>In this service, this interface is mandatory</p> 121cdf0e10cSrcweir 122cdf0e10cSrcweir <p><member scope="com::sun::star::container">XChild::getParent()</member> 123cdf0e10cSrcweir returns <NULL/>, if the object is currently not contained in a container. 124cdf0e10cSrcweir </p> 125cdf0e10cSrcweir 126cdf0e10cSrcweir <p>An implementation may also support 127cdf0e10cSrcweir <member scope="com::sun::star::container">XChild::setParent()</member>. 128cdf0e10cSrcweir If it does, changing the parent has the effect of first removing the object 129cdf0e10cSrcweir from its old parent (if any) and then inserting it into the new parent 130cdf0e10cSrcweir (unless that is <NULL/>) under the same name. The new parent must be part of 131cdf0e10cSrcweir the same hierarchy as the old one. The name of the object must have been set 132cdf0e10cSrcweir before. 133cdf0e10cSrcweir </p> 134cdf0e10cSrcweir*/ 135cdf0e10cSrcweir interface com::sun::star::container::XChild; 136cdf0e10cSrcweir 137cdf0e10cSrcweir/** allows controlling or observing the lifetime of the object. 138cdf0e10cSrcweir 139cdf0e10cSrcweir <p>Clients may dispose of the object using 140cdf0e10cSrcweir <member scope="com::sun::star::lang">XComponent::dispose()</member>, only if 141cdf0e10cSrcweir the object is currently not contained in a container ( 142cdf0e10cSrcweir <member scope="com::sun::star::container">XChild::getParent()</member> 143cdf0e10cSrcweir returns <NULL/>). 144cdf0e10cSrcweir </p> 145cdf0e10cSrcweir 146cdf0e10cSrcweir <p>Clients may register an <type scope="com::sun::star::lang">XEventListener</type> 147cdf0e10cSrcweir to be notified, if the object is removed from its container by an outside source. 148cdf0e10cSrcweir </p> 149cdf0e10cSrcweir*/ 150cdf0e10cSrcweir interface com::sun::star::lang::XComponent; 151cdf0e10cSrcweir 152cdf0e10cSrcweir/** provides information about the type of the element. 153cdf0e10cSrcweir 154cdf0e10cSrcweir <p>Set elements have a predetermined structure (their <em>type</em>), 155cdf0e10cSrcweir that is described by and can be generated from a <em>template</em>. 156cdf0e10cSrcweir </p> 157cdf0e10cSrcweir 158cdf0e10cSrcweir <p>If the object was created using interface 159cdf0e10cSrcweir <type scope="com::sun::star::lang">XSingleServiceFactory</type> 160cdf0e10cSrcweir on an implementation of <type>SetUpdate</type>, this interface describes the 161cdf0e10cSrcweir same template as interface <type>XTemplateContainer</type> on that 162cdf0e10cSrcweir <type>SetUpdate</type>. 163cdf0e10cSrcweir </p> 164cdf0e10cSrcweir <p>If the object was created using interface 165cdf0e10cSrcweir <type scope="com::sun::star::lang">XMultiServiceFactory</type> 166cdf0e10cSrcweir on an implementation of <type>SetUpdate</type>, this interface describes the 167cdf0e10cSrcweir template whose name was used as a service identifier for the factory method. 168cdf0e10cSrcweir </p> 169cdf0e10cSrcweir <p>Otherwise, the semantics of the information provided about the template depends on the 170cdf0e10cSrcweir implementation. 171cdf0e10cSrcweir </p> 172cdf0e10cSrcweir 173cdf0e10cSrcweir @ see com::sun::star::configuration::XTemplateContainer 174cdf0e10cSrcweir*/ 175cdf0e10cSrcweir interface com::sun::star::configuration::XTemplateInstance; 176cdf0e10cSrcweir}; 177cdf0e10cSrcweir 178cdf0e10cSrcweir//============================================================================= 179cdf0e10cSrcweir 180cdf0e10cSrcweir}; }; }; }; 181cdf0e10cSrcweir 182cdf0e10cSrcweir#endif 183