1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_ConfigurationAccess_idl__
24*b1cdbd2cSJim Jagielski#define __com_sun_star_configuration_ConfigurationAccess_idl__
25*b1cdbd2cSJim Jagielski
26*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_HierarchyAccess_idl__
27*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/HierarchyAccess.idl>
28*b1cdbd2cSJim Jagielski#endif
29*b1cdbd2cSJim Jagielski
30*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_HierarchyElement_idl__
31*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/HierarchyElement.idl>
32*b1cdbd2cSJim Jagielski#endif
33*b1cdbd2cSJim Jagielski
34*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_SetAccess_idl__
35*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/SetAccess.idl>
36*b1cdbd2cSJim Jagielski#endif
37*b1cdbd2cSJim Jagielski
38*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_GroupAccess_idl__
39*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/GroupAccess.idl>
40*b1cdbd2cSJim Jagielski#endif
41*b1cdbd2cSJim Jagielski
42*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_AccessRootElement_idl__
43*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/AccessRootElement.idl>
44*b1cdbd2cSJim Jagielski#endif
45*b1cdbd2cSJim Jagielski
46*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_SetElement_idl__
47*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/SetElement.idl>
48*b1cdbd2cSJim Jagielski#endif
49*b1cdbd2cSJim Jagielski
50*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_configuration_GroupElement_idl__
51*b1cdbd2cSJim Jagielski#include <com/sun/star/configuration/GroupElement.idl>
52*b1cdbd2cSJim Jagielski#endif
53*b1cdbd2cSJim Jagielski
54*b1cdbd2cSJim Jagielski//=============================================================================
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module configuration {
57*b1cdbd2cSJim Jagielski
58*b1cdbd2cSJim Jagielski//=============================================================================
59*b1cdbd2cSJim Jagielski/** provides read access to a fragment of the configuration hierarchy.
60*b1cdbd2cSJim Jagielski
61*b1cdbd2cSJim Jagielski <p>Values that are direct or indirect descendants of a root element can be
62*b1cdbd2cSJim Jagielski retrieved and, if themselves objects, navigated. Other interfaces provide
63*b1cdbd2cSJim Jagielski access to information about this element and its context.
64*b1cdbd2cSJim Jagielski Changes to values in the hierarchy can be monitored by event listeners.
65*b1cdbd2cSJim Jagielski </p>
66*b1cdbd2cSJim Jagielski
67*b1cdbd2cSJim Jagielski <p>Descendants of this service also implement this service.
68*b1cdbd2cSJim Jagielski </p>
69*b1cdbd2cSJim Jagielski
70*b1cdbd2cSJim Jagielski <p>Ultimately the configuration holds values. These values are organized into
71*b1cdbd2cSJim Jagielski a hierarchy using structural elements. The structure is defined in advance in
72*b1cdbd2cSJim Jagielski a schema. Necessary information from the schema is stored in the configuration
73*b1cdbd2cSJim Jagielski repository itself and is accessible through an implementation of this service.
74*b1cdbd2cSJim Jagielski </p>
75*b1cdbd2cSJim Jagielski
76*b1cdbd2cSJim Jagielski <p>Two different kinds of structural elements are used in the configuration
77*b1cdbd2cSJim Jagielski hierarchy:
78*b1cdbd2cSJim Jagielski </p>
79*b1cdbd2cSJim Jagielski <dl>
80*b1cdbd2cSJim Jagielski	<dt>Sets</dt>
81*b1cdbd2cSJim Jagielski		<dd>are dynamic containers of homogeneous elements. Which elements
82*b1cdbd2cSJim Jagielski		a <em>set</em> contains can vary. Their names are defined by the
83*b1cdbd2cSJim Jagielski		clients that insert them. On the other hand, the <em>type</em> of
84*b1cdbd2cSJim Jagielski		the elements is the same for all elements. In the case of elements
85*b1cdbd2cSJim Jagielski		that are themselves hierarchy objects, the <em>type</em> includes
86*b1cdbd2cSJim Jagielski		the structure of the hierarchy fragment they contain. Such types
87*b1cdbd2cSJim Jagielski		are defined in the configuration schema as <em>templates</em>.
88*b1cdbd2cSJim Jagielski		</dd>
89*b1cdbd2cSJim Jagielski
90*b1cdbd2cSJim Jagielski	<dt>Groups</dt>
91*b1cdbd2cSJim Jagielski		<dd>are static collections of heterogeneous elements. The names and
92*b1cdbd2cSJim Jagielski		types of the elements of a <em>group</em> are completely defined in the
93*b1cdbd2cSJim Jagielski		configuration schema. Here each element may be of a different
94*b1cdbd2cSJim Jagielski		<em>type</em>, allowing <em>groups</em> that contain a mix of
95*b1cdbd2cSJim Jagielski		subobjects and simple values.
96*b1cdbd2cSJim Jagielski		</dd>
97*b1cdbd2cSJim Jagielski </dl>
98*b1cdbd2cSJim Jagielski
99*b1cdbd2cSJim Jagielski <p>Objects in the configuration hierarchy, for example, implementations of this service,
100*b1cdbd2cSJim Jagielski can thus be classified in the following ways:
101*b1cdbd2cSJim Jagielski </p>
102*b1cdbd2cSJim Jagielski <ul>
103*b1cdbd2cSJim Jagielski	<li><em>Container</em> role:
104*b1cdbd2cSJim Jagielski		An object that can hold child elements as a <em>set</em> or a <em>group</em>.
105*b1cdbd2cSJim Jagielski	</li>
106*b1cdbd2cSJim Jagielski	<li><em>Element</em> role:
107*b1cdbd2cSJim Jagielski		An object may be an element of a <em>set</em> or a <em>group</em>
108*b1cdbd2cSJim Jagielski		or else it may be the root element.
109*b1cdbd2cSJim Jagielski	</li>
110*b1cdbd2cSJim Jagielski </ul>
111*b1cdbd2cSJim Jagielski
112*b1cdbd2cSJim Jagielski <p>Several types of simple <em>values</em> can be used in the configuration.
113*b1cdbd2cSJim Jagielski In addition to the basic (scalar) types, sequences of the basic types are
114*b1cdbd2cSJim Jagielski supported. The basic types are:
115*b1cdbd2cSJim Jagielski </p>
116*b1cdbd2cSJim Jagielski
117*b1cdbd2cSJim Jagielski <ul>
118*b1cdbd2cSJim Jagielski	<li><strong>string</strong> can hold a human-readable text.
119*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom>string</atom>.</p>
120*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[]">string</atom>.</p>
121*b1cdbd2cSJim Jagielski		<p>'<em>human-readable</em>' here excludes non-printing characters
122*b1cdbd2cSJim Jagielski		except for CR, LF and TAB [Unicode code points 9,10,13].
123*b1cdbd2cSJim Jagielski		For binary data, use type <strong>binary</strong> instead.</p>
124*b1cdbd2cSJim Jagielski	</li>
125*b1cdbd2cSJim Jagielski	<li><strong>boolean</strong> can hold the values <TRUE/> or <FALSE/>.
126*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom>boolean</atom>.
127*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[]">boolean</atom>.</p>
128*b1cdbd2cSJim Jagielski	</li>
129*b1cdbd2cSJim Jagielski	<li><strong>short</strong> can hold a 16-bit signed integer.
130*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom>short</atom>.</p>
131*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[]">short</atom>.</p>
132*b1cdbd2cSJim Jagielski	</li>
133*b1cdbd2cSJim Jagielski	<li><strong>int</strong> can hold a 32-bit signed integer.
134*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom>long</atom>.</p>
135*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[]">long</atom>.</p>
136*b1cdbd2cSJim Jagielski	</li>
137*b1cdbd2cSJim Jagielski	<li><strong>long</strong> can hold a 64-bit signed integer.
138*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom>hyper</atom>.</p>
139*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[]">hyper</atom>.</p>
140*b1cdbd2cSJim Jagielski	</li>
141*b1cdbd2cSJim Jagielski	<li><strong>double</strong> can hold a floating point number.
142*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom>double</atom>.</p>
143*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[]">double</atom>.</p>
144*b1cdbd2cSJim Jagielski	</li>
145*b1cdbd2cSJim Jagielski	<li><strong>binary</strong> can hold a sequence of octets.
146*b1cdbd2cSJim Jagielski		<p>Values are represented as <atom dim="[]">byte</atom>.</p>
147*b1cdbd2cSJim Jagielski		<p>Sequences are represented as <atom dim="[][]">byte</atom>.</p>
148*b1cdbd2cSJim Jagielski	</li>
149*b1cdbd2cSJim Jagielski </ul>
150*b1cdbd2cSJim Jagielski
151*b1cdbd2cSJim Jagielski <p>Within templates an additional type <strong>any</strong> can occur. When
152*b1cdbd2cSJim Jagielski such a template is used to create a new <type>SetElement</type>, the type
153*b1cdbd2cSJim Jagielski of the element is initially reported as <atom>any</atom> (having no value).
154*b1cdbd2cSJim Jagielski When the value of such an element is first set, it will assume the type used.
155*b1cdbd2cSJim Jagielski </p>
156*b1cdbd2cSJim Jagielski
157*b1cdbd2cSJim Jagielski <p>If the schema marks a value as <em>nullable</em> (which is indicated by
158*b1cdbd2cSJim Jagielski attribute <const scope="com::sun::star::beans">PropertyAttribute::MAYBEVOID</const> ),
159*b1cdbd2cSJim Jagielski its contents may be <NULL/>.
160*b1cdbd2cSJim Jagielski </p>
161*b1cdbd2cSJim Jagielski
162*b1cdbd2cSJim Jagielski <p>The configuration should support explicit access to default values
163*b1cdbd2cSJim Jagielski (implementing <type scope="com::sun::star::beans">XPropertyState</type>
164*b1cdbd2cSJim Jagielski and  <type scope="com::sun::star::beans">XPropertyWithState</type>).
165*b1cdbd2cSJim Jagielski </p>
166*b1cdbd2cSJim Jagielski
167*b1cdbd2cSJim Jagielski @see ConfigurationProvider
168*b1cdbd2cSJim Jagielski	Root instances of this service can be requested from a
169*b1cdbd2cSJim Jagielski	<type>ConfigurationProvider</type>.
170*b1cdbd2cSJim Jagielski
171*b1cdbd2cSJim Jagielski @see ConfigurationUpdateAccess
172*b1cdbd2cSJim Jagielski	an extended service that includes facilities for modifying
173*b1cdbd2cSJim Jagielski	configuration data.
174*b1cdbd2cSJim Jagielski*/
175*b1cdbd2cSJim Jagielskipublished service ConfigurationAccess
176*b1cdbd2cSJim Jagielski{
177*b1cdbd2cSJim Jagielski	/** provides interfaces to access child and descendent elements.
178*b1cdbd2cSJim Jagielski
179*b1cdbd2cSJim Jagielski	 <p>An implementation actually implements a specialization of this service,
180*b1cdbd2cSJim Jagielski	 which depends on its <em>Container</em> role.
181*b1cdbd2cSJim Jagielski	 </p>
182*b1cdbd2cSJim Jagielski
183*b1cdbd2cSJim Jagielski	 <p>Implementations shall implement exactly one of:</p>
184*b1cdbd2cSJim Jagielski	 <ul>
185*b1cdbd2cSJim Jagielski		<li><type>SetAccess</type> if this element is a <em>Set</em>.</li>
186*b1cdbd2cSJim Jagielski		<li><type>GroupAccess</type> if this element is a <em>Group</em>.</li>
187*b1cdbd2cSJim Jagielski	 </ul>
188*b1cdbd2cSJim Jagielski	 */
189*b1cdbd2cSJim Jagielski	service HierarchyAccess;
190*b1cdbd2cSJim Jagielski
191*b1cdbd2cSJim Jagielski	/** provides interfaces to obtain information about this element and its
192*b1cdbd2cSJim Jagielski	 role and context in the hierarchy.
193*b1cdbd2cSJim Jagielski
194*b1cdbd2cSJim Jagielski	 <p>An implementation actually implements a specialization of this service,
195*b1cdbd2cSJim Jagielski	 which depends on its <em>Element</em> role.
196*b1cdbd2cSJim Jagielski	 </p>
197*b1cdbd2cSJim Jagielski
198*b1cdbd2cSJim Jagielski	 <p>Implementations shall implement exactly one of:</p>
199*b1cdbd2cSJim Jagielski	 <ul>
200*b1cdbd2cSJim Jagielski		<li><type>AccessRootElement</type> if this element is the
201*b1cdbd2cSJim Jagielski			<em>Root</em> of the whole hierarchy. Objects that can be
202*b1cdbd2cSJim Jagielski			created directly by a <type>ConfigurationProvider</type>
203*b1cdbd2cSJim Jagielski			implement this service.</li>
204*b1cdbd2cSJim Jagielski		<li><type>SetElement</type> if this element may be contained in a
205*b1cdbd2cSJim Jagielski			<em>Set</em>.</li>
206*b1cdbd2cSJim Jagielski		<li><type>GroupElement</type> if this element is a child of a
207*b1cdbd2cSJim Jagielski			<em>Group</em>.</li>
208*b1cdbd2cSJim Jagielski	 </ul>
209*b1cdbd2cSJim Jagielski
210*b1cdbd2cSJim Jagielski	 */
211*b1cdbd2cSJim Jagielski	service HierarchyElement;
212*b1cdbd2cSJim Jagielski
213*b1cdbd2cSJim Jagielski	/** specializes <type>HierarchyAccess</type>, if this element is a <em>Set</em>.
214*b1cdbd2cSJim Jagielski
215*b1cdbd2cSJim Jagielski	 	<p>This is an alternative to <type>GroupAccess</type>.
216*b1cdbd2cSJim Jagielski		</p>
217*b1cdbd2cSJim Jagielski	*/
218*b1cdbd2cSJim Jagielski	[optional] service SetAccess;
219*b1cdbd2cSJim Jagielski
220*b1cdbd2cSJim Jagielski	/** specializes <type>HierarchyAccess</type>,
221*b1cdbd2cSJim Jagielski	 if this element is a <em>Group</em>.
222*b1cdbd2cSJim Jagielski	 <p>This is an alternative to <type>SetAccess</type>.
223*b1cdbd2cSJim Jagielski	 </p>
224*b1cdbd2cSJim Jagielski	*/
225*b1cdbd2cSJim Jagielski	[optional] service GroupAccess;
226*b1cdbd2cSJim Jagielski
227*b1cdbd2cSJim Jagielski	/** specializes <type>HierarchyElement</type>,
228*b1cdbd2cSJim Jagielski	 if this element is the <em>Root</em> of the whole hierarchy.
229*b1cdbd2cSJim Jagielski	 <p>This is an alternative to <type>SetElement</type>
230*b1cdbd2cSJim Jagielski	 or <type>GroupElement</type>.
231*b1cdbd2cSJim Jagielski	 </p>
232*b1cdbd2cSJim Jagielski
233*b1cdbd2cSJim Jagielski	 @see ConfigurationProvider
234*b1cdbd2cSJim Jagielski		Instances obtained from a <type>ConfigurationProvider</type> will
235*b1cdbd2cSJim Jagielski		implement this version of <type>HierarchyElement</type>.
236*b1cdbd2cSJim Jagielski	*/
237*b1cdbd2cSJim Jagielski	[optional] service AccessRootElement;
238*b1cdbd2cSJim Jagielski
239*b1cdbd2cSJim Jagielski	/** specializes <type>HierarchyElement</type>,
240*b1cdbd2cSJim Jagielski	 if this element may be contained in a <em>Set</em>.
241*b1cdbd2cSJim Jagielski	 <p>This is an alternative to <type>AccessRootElement</type>
242*b1cdbd2cSJim Jagielski	 or <type>GroupElement</type>.
243*b1cdbd2cSJim Jagielski	 </p>
244*b1cdbd2cSJim Jagielski    */
245*b1cdbd2cSJim Jagielski	[optional] service SetElement;
246*b1cdbd2cSJim Jagielski
247*b1cdbd2cSJim Jagielski	/** specializes <type>HierarchyElement</type>,
248*b1cdbd2cSJim Jagielski	 if this element is a child of a <em>Group</em>.
249*b1cdbd2cSJim Jagielski	 <p>This is an alternative to <type>AccessRootElement</type>
250*b1cdbd2cSJim Jagielski	 or <type>SetElement</type>.
251*b1cdbd2cSJim Jagielski	 </p>
252*b1cdbd2cSJim Jagielski*/
253*b1cdbd2cSJim Jagielski	[optional] service GroupElement;
254*b1cdbd2cSJim Jagielski};
255*b1cdbd2cSJim Jagielski
256*b1cdbd2cSJim Jagielski//=============================================================================
257*b1cdbd2cSJim Jagielski
258*b1cdbd2cSJim Jagielski}; }; }; };
259*b1cdbd2cSJim Jagielski
260*b1cdbd2cSJim Jagielski#endif
261*b1cdbd2cSJim Jagielski
262