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