summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/configuration/SetElement.idl
blob: 6260020d7c6d64f6e7a5ded8525c0993399a874c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
#ifndef __com_sun_star_configuration_SetElement_idl__
#define __com_sun_star_configuration_SetElement_idl__

#include <com/sun/star/configuration/HierarchyElement.idl>
#include <com/sun/star/container/XChild.idl>
#include <com/sun/star/lang/XComponent.idl>
#include <com/sun/star/configuration/XTemplateInstance.idl>


module com { module sun { module star { module configuration {

/** provides information about a dynamic element that can be inserted into a
 homogeneous set of elements within a hierarchy.

 <p>Provides information about the element.
 Provides access to its containing set object.
 Allows controlling the lifetime of the element.
 </p>

 <p>Set elements may be added to and removed from the hierarchy at runtime.
 They bear user-defined names. They may exist independently, outside any
 container.
 </p>

 <p>New set element instances generally are created through members of
 com::sun::star::lang::XSingleServiceFactory or,
 if supported, com::sun::star::lang::XMultiServiceFactory
 on an implementation of SetUpdate. Initially, they are not
 contained in a set object and have no meaningful name.
 </p>

 <p>While an instance is not contained in a set object, it is owned by
 the client and can be disposed by calling
 com::sun::star::lang::XComponent::dispose(). The name
 of the object can freely be changed in that situation though without
 persistent effect.
 </p>

 <p>When the instance is inserted into a set (this includes replacing an
 existing element), ownership is transferred to the container.
 While it is contained in the container, clients must not dispose the
 object. When inserted, the name of the object is fixed and is used to
 identify it within the container. An implementation may support
 com::sun::star::container::XNamed::setName() even in
 this case. If it does, changing the name has the same effect of removing
 the object (under the old name) and then reinserting it into the same
 container (using the new name).
 </p>

 <p>When an instance is removed from a set (this includes being replaced by
 a new element), ownership is transferred to the client again. It can then be
 disposed or reinserted into a container. An instance can only be inserted
 into a container, if it was obtained from the same hierarchy.
 </p>

 <p>When a set element is removed from its set from outside the hierarchy, the
 container disposes of the object. This occurrence can be detected by registering
 a com::sun::star::lang::XEventListener with the object.
 </p>

 <p>If an implementation is part of a <em>read-only</em> view of the hierarchy,
 changing the name or parent is not supported (the object can't be removed from
 its container anyway).
 </p>

 @see com::sun::star::configuration::SetAccess
    Parent objects of this service generally implement service SetAccess.

 @see com::sun::star::configuration::GroupElement
    A complementary service for elements of a static heterogeneous collection.

 @see com::sun::star::configuration::AccessRootElement
    A complementary service for the root element of a hierarchy.

*/
published service SetElement
{
/** is the basic service for accessing information about an element in the
 hierarchy.
*/
    service HierarchyElement;

/** provides access to the containing set object.

 <p>In this service, this interface is mandatory</p>

 <p>com::sun::star::container::XChild::getParent()
 returns `NULL`, if the object is currently not contained in a container.
 </p>

 <p>An implementation may also support
 com::sun::star::container::XChild::setParent().
 If it does, changing the parent has the effect of first removing the object
 from its old parent (if any) and then inserting it into the new parent
 (unless that is `NULL`) under the same name. The new parent must be part of
 the same hierarchy as the old one. The name of the object must have been set
 before.
 </p>
*/
    interface com::sun::star::container::XChild;

/** allows controlling or observing the lifetime of the object.

 <p>Clients may dispose of the object using
 com::sun::star::lang::XComponent::dispose(), only if
 the object is currently not contained in a container (
 com::sun::star::container::XChild::getParent()
 returns `NULL`).
 </p>

 <p>Clients may register a com::sun::star::lang::XEventListener
 to be notified, if the object is removed from its container by an outside source.
 </p>
*/
    interface com::sun::star::lang::XComponent;

/** provides information about the type of the element.

 <p>Set elements have a predetermined structure (their <em>type</em>),
 that is described by and can be generated from a <em>template</em>.
 </p>

 <p>If the object was created using interface
 com::sun::star::lang::XSingleServiceFactory
 on an implementation of SetUpdate, this interface describes the
 same template as interface XTemplateContainer on that
 SetUpdate.
 </p>
 <p>If the object was created using interface
 com::sun::star::lang::XMultiServiceFactory
 on an implementation of SetUpdate, this interface describes the
 template whose name was used as a service identifier for the factory method.
 </p>
 <p>Otherwise, the semantics of the information provided about the template depends on the
 implementation.
 </p>

 @see com::sun::star::configuration::XTemplateContainer
*/
    interface com::sun::star::configuration::XTemplateInstance;
};


}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */