1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_configuration_backend_XLayerHandler_idl__
28 #define __com_sun_star_configuration_backend_XLayerHandler_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
34 #ifndef __com_sun_star_configuration_backend_TemplateIdentifier_idl__
35 #include
<com
/sun
/star
/configuration
/backend
/TemplateIdentifier.idl
>
38 #ifndef __com_sun_star_configuration_backend_MalformedDataException_idl__
39 #include
<com
/sun
/star
/configuration
/backend
/MalformedDataException.idl
>
42 #ifndef __com_sun_star_lang_WrappedTargetException_idl__
43 #include
<com
/sun
/star
/lang
/WrappedTargetException.idl
>
46 //=============================================================================
48 module com
{ module sun
{ module star
{ module configuration
{ module backend
{
50 //=============================================================================
52 /** receives a description of a configuration layer
53 as a sequence of events.
57 published
interface XLayerHandler
: ::com
::sun
::star
::uno
::XInterface
59 //-------------------------------------------------------------------------
61 /** receives notification that a layer description is started
64 <p> Subsequent calls describe the contents of the layer
65 until a matching call to <member>XLayerHandler::endLayer()</member>
69 @throws com::sun::star::configuration::backend::MalformedDataException
70 if there is an unfinished layer in progress
72 @throws com::sun::star::lang::WrappedTargetException
73 if an error occurs processing the event.
76 raises
( MalformedDataException
,
77 com
::sun
::star
::lang
::WrappedTargetException
);
78 //-------------------------------------------------------------------------
80 /** receives notification that a layer description is complete.
82 <p> Must match a previous call to <member>XLayerHandler::startLayer()</member>.
85 @throws com::sun::star::configuration::backend::MalformedDataException
87 <li>if invalid data is detected in the layer</li>
88 <li>if there is a unfinished subnode in progress</li>
89 <li>if no layer is started at all</li>
90 <li>if the layer tries to override read-only or final data</li>
92 <p><em>Not every implementation can detect each condition</em></p>
94 @throws com::sun::star::lang::WrappedTargetException
95 if an error occurs processing the event.
98 raises
( MalformedDataException
,
99 com
::sun
::star
::lang
::WrappedTargetException
);
100 //-------------------------------------------------------------------------
102 /** receives notification that a description of a node override is started.
104 <p> Subsequent calls describe overrides to properties and members
105 or items of the node until a matching call to
106 <member>XLayerHandler::endNode()</member>is encountered.
110 specifies the name of the node.
113 specifies attribute values to be applied to the node.
115 <p> The value is a combination of
116 <type>NodeAttribute</type> flags.
118 <p> The attributes are combined cumulatively with those
123 if <TRUE/>, specifies that the node should be cleared to an empty
124 state by removing all non-mandatory children from lower layers prior
125 to applying the overrides.
127 @throws com::sun::star::configuration::backend::MalformedDataException
129 <li>if there isn't a layer in progress</li>
130 <li>if there already was a change to that node</li>
131 <li>if there is no node with that name</li>
132 <li>if the node is marked read-only in a lower layer</li>
133 <li>if the name is not a valid node name</li>
134 <li>if the attributes are not valid for the node</li>
136 <p><em>Not every implementation can detect each condition</em></p>
138 @throws com::sun::star::lang::WrappedTargetException
139 if an error occurs processing the event.
141 @see com::sun::star::configuration::backend::NodeAttribute
143 void overrideNode
( [in] string aName
,
144 [in] short aAttributes
,
145 [in] boolean bClear
)
146 raises
( MalformedDataException
,
147 com
::sun
::star
::lang
::WrappedTargetException
);
148 //-------------------------------------------------------------------------
150 /** receives notification that a new item is started.
152 <p> The current node must be a set and
153 a preexisting item (if any) must be removeable.
155 <p> The new item will be created from the default template
158 <p> Subsequent calls describe the difference from the template
159 of properties and members or items of the node until
160 a matching call to <member>XLayerHandler::endNode()</member>
165 specifies the name of the item.
168 specifies attribute values to be applied to the new node.
170 <p> The value is a combination of
171 <type>NodeAttribute</type> flags. Note that
172 <member>NodeAttribute::FUSE</member> has an impact on the
173 semantics of this method.
176 @throws com::sun::star::configuration::backend::MalformedDataException
178 <li>if there isn't a set node in progress currently</li>
179 <li>if there already was a change to a node of that name</li>
180 <li>if the template for the new node is not found</li>
181 <li>if an item of that name on a lower layer is not removeable</li>
182 <li>if the name is not a valid item name</li>
183 <li>if the attributes are not valid for the node</li>
185 <p><em>Not every implementation can detect each condition</em></p>
187 @throws com::sun::star::lang::WrappedTargetException
188 if an error occurs processing the event.
190 @see com::sun::star::configuration::backend::NodeAttribute
192 void addOrReplaceNode
( [in] string aName
,
193 [in] short aAttributes
)
194 raises
( MalformedDataException
,
195 com
::sun
::star
::lang
::WrappedTargetException
);
196 //-------------------------------------------------------------------------
198 /** receives notification that a new item based on a particular template
201 <p> The current node must be a set and
202 a preexisting item (if any) must be removeable.
204 <p> Subsequent calls describe the difference from the template
205 of properties and members or items of the node until
206 a matching call to <member>XLayerHandler::endNode()</member>
211 specifies the name of the item.
214 specifies the template to use for the new node
217 specifies attribute values to be applied to the new node.
219 <p> The value is a combination of
220 <type>NodeAttribute</type> flags. Note that
221 <member>NodeAttribute::FUSE</member> has an impact on the
222 semantics of this method.
225 @throws com::sun::star::configuration::backend::MalformedDataException
227 <li>if there isn't a set node in progress currently</li>
228 <li>if there already was a change to a node of that name</li>
229 <li>if the template for the new node is not found</li>
230 <li>if the template is not a valid item type for the containing set</li>
231 <li>if an item of that name on a lower layer is not removeable</li>
232 <li>if the name is not a valid item name</li>
233 <li>if the attributes are not valid for the node</li>
235 <p><em>Not every implementation can detect each condition</em></p>
237 @throws com::sun::star::lang::WrappedTargetException
238 if an error occurs processing the event.
240 @see com::sun::star::configuration::backend::NodeAttribute
242 void addOrReplaceNodeFromTemplate
( [in] string aName
,
243 [in] TemplateIdentifier aTemplate
,
244 [in] short aAttributes
)
245 raises
( MalformedDataException
,
246 com
::sun
::star
::lang
::WrappedTargetException
);
247 //-------------------------------------------------------------------------
249 /** receives notification that a node description is complete.
251 <p> Must match the last open call to
252 <member>XLayerHandler::overrideNode()</member>,
253 <member>XLayerHandler::addOrReplaceNode()</member> or
254 <member>XLayerHandler::addOrReplaceNodeFromTemplate()</member>.
257 @throws com::sun::star::configuration::backend::MalformedDataException
259 <li>if invalid data is detected in the node</li>
260 <li>if no node is started at all</li>
262 <p><em>Not every implementation can detect each condition</em></p>
264 @throws com::sun::star::lang::WrappedTargetException
265 if an error occurs processing the event.
268 raises
( MalformedDataException
,
269 com
::sun
::star
::lang
::WrappedTargetException
);
270 //-------------------------------------------------------------------------
272 /** receives notification that a node is dropped from a set.
274 <p> The current node must be a set and
275 the item must be removeable.
279 specifies the name of the node.
281 @throws com::sun::star::configuration::backend::MalformedDataException
283 <li>if there isn't a set node in progress currently</li>
284 <li>if there already was a change to a node of that name</li>
285 <li>if there is no item with that name</li>
286 <li>if the item is not removeable</li>
287 <li>if the name is not a valid node name</li>
289 <p><em>Not every implementation can detect each condition</em></p>
291 @throws com::sun::star::lang::WrappedTargetException
292 if an error occurs processing the event.
294 void dropNode
( [in] string aName
)
295 raises
( MalformedDataException
,
296 com
::sun
::star
::lang
::WrappedTargetException
);
297 //-------------------------------------------------------------------------
299 /** receives notification that an existing property is modified.
301 <p> Subsequent calls describe new value(s) for the property until a
302 matching call to <member>XLayerHandler::endProperty()</member>
307 specifies the name of the property.
310 specifies the new attributes of the property.
312 <p> The value is a combination of
313 <type>NodeAttribute</type> flags.
315 <p> The attributes are combined cumulatively with those
320 specifies the type of the property.
322 <p> This must be the same type as is already defined in the schema
323 or lower layers, unless the previous type was unspecified
325 <const scope="com::sun::star::uno">TypeClass::ANY</const>.)
327 <p> A <void/> type indicates that the type is unspecified
329 In this case any subsequent value may be of a generic type
330 (e.g. <atom>string</atom> or - for list values -
331 <atom dim="[]">string</atom>.) Such values may be
332 converted to the type defined in the schema by
337 if <TRUE/>, specifies that the property should be cleared to an empty
338 state by discarding all values from lower layers prior
339 to applying the overrides.
341 @throws com::sun::star::configuration::backend::MalformedDataException
343 <li>if there isn't a group or extensible node in progress currently</li>
344 <li>if there already was a change to a property of that name</li>
345 <li>if there is no property with that name</li>
346 <li>if the property is read-only</li>
347 <li>if the type does not match the type of the property</li>
348 <li>if a type is missing and cannot be determined otherwise</li>
349 <li>if the name is not a valid property name</li>
350 <li>if the attributes are not valid for the property</li>
352 <p><em>Not every implementation can detect each condition</em></p>
354 @throws com::sun::star::lang::WrappedTargetException
355 if an error occurs processing the event.
357 @see com::sun::star::configuration::backend::NodeAttribute
359 void overrideProperty
( [in] string aName
,
360 [in] short aAttributes
,
362 [in] boolean bClear
)
363 raises
( MalformedDataException
,
364 com
::sun
::star
::lang
::WrappedTargetException
);
366 //-------------------------------------------------------------------------
368 /** receives notification that the value of the current property
372 specifies the new value of the property.
374 <p> The value must match the type of the current property.
375 If the property does not have the
376 <const>SchemaAttribute::REQUIRED</const> flag set,
377 the value can be <void/>.
379 <p> If the current property is localized, this value applies
380 to the default locale.
383 @throws com::sun::star::configuration::backend::MalformedDataException
385 <li>if there isn't a property in progress currently</li>
386 <li>if there already was a change to the value of that property</li>
387 <li>if the value does not have the proper type</li>
388 <li>if the value is not valid for the property</li>
390 <p><em>Not every implementation can detect each condition</em></p>
392 @throws com::sun::star::lang::WrappedTargetException
393 if an error occurs processing the event.
395 @see com::sun::star::configuration::backend::NodeAttribute
397 void setPropertyValue
( [in] any aValue
)
398 raises
( MalformedDataException
,
399 com
::sun
::star
::lang
::WrappedTargetException
);
401 //-------------------------------------------------------------------------
403 /** receives notification that the value of the current localized property
404 is overridden for a specific locale .
407 specifies the new value of the property.
409 <p> The value must match the type of the current property.
410 If the property does not have the
411 <const>SchemaAttribute::REQUIRED</const> flag set,
412 the value can be <void/>.
416 specifies the locale this value should apply to.
418 @throws com::sun::star::configuration::backend::MalformedDataException
420 <li>if there isn't a property in progress currently</li>
421 <li>if the current property isn't localized</li>
422 <li>if there already was a change to the property for that locale</li>
423 <li>if the value does not have the proper type</li>
424 <li>if the value is not valid for the property</li>
425 <li>if the locale is not a valid locale</li>
427 <p><em>Not every implementation can detect each condition</em></p>
429 @throws com::sun::star::lang::WrappedTargetException
430 if an error occurs processing the event.
432 @see com::sun::star::configuration::backend::NodeAttribute
434 void setPropertyValueForLocale
([in] any aValue
,
435 [in] string aLocale
)
436 raises
( MalformedDataException
,
437 com
::sun
::star
::lang
::WrappedTargetException
);
439 //-------------------------------------------------------------------------
441 /** receives notification that a property description is complete.
443 <p> Must match an open call to
444 <member>XLayerHandler::overrideProperty()</member>,
447 @throws com::sun::star::configuration::backend::MalformedDataException
449 <li>if invalid data is detected in the property</li>
450 <li>if no property is started at all</li>
452 <p><em>Not every implementation can detect each condition</em></p>
454 @throws com::sun::star::lang::WrappedTargetException
455 if an error occurs processing the event.
458 raises
( MalformedDataException
,
459 com
::sun
::star
::lang
::WrappedTargetException
);
460 //-------------------------------------------------------------------------
462 /** receives notification that a property having a <void/> value is added
465 <p> The current node must be extensible.
469 specifies the name of the new property.
472 specifies the attributes of the new property.
474 <p> The value is a combination of
475 <type>NodeAttribute</type> flags and may also contain the
476 <const>SchemaAttribute::REQUIRED</const> flag.
478 <p> <const>NodeAttribute::MANDATORY</const> need not be set,
479 as dynamically added properties always are mandatory
480 in subsequent layers.
484 specifies the type of the new property.
486 @throws com::sun::star::configuration::backend::MalformedDataException
488 <li>if there isn't an extensible node in progress currently</li>
489 <li>if a property with that name already exists</li>
490 <li>if the specified type is not allowed for a property</li>
491 <li>if the name is not a valid property name</li>
492 <li><li>if the attributes are not valid for the property</li>
494 <p><em>Not every implementation can detect each condition</em></p>
496 @throws com::sun::star::lang::WrappedTargetException
497 if an error occurs processing the event.
499 @see com::sun::star::configuration::backend::SchemaAttribute
501 void addProperty
( [in] string aName
,
502 [in] short aAttributes
,
504 raises
( MalformedDataException
,
505 com
::sun
::star
::lang
::WrappedTargetException
);
507 //-------------------------------------------------------------------------
509 /** receives notification that a property having a non-<void/> value
510 is added to the current node.
512 <p> The current node must be extensible.
516 specifies the name of the new property.
519 specifies the attributes of the new property.
521 <p> The value is a combination of
522 <type>NodeAttribute</type> flags and may also contain the
523 <const>SchemaAttribute::REQUIRED</const> flag.
526 <p> <const>NodeAttribute::MANDATORY</const> need not be set,
527 as dynamic properties always are mandatory
528 in subsequent layers.
532 specifies the value of the new property.
534 <p> The value also determines the type.
535 Therefore the value must not be <void/>.
538 @throws com::sun::star::configuration::backend::MalformedDataException
540 <li>if there isn't an extensible node in progress currently</li>
541 <li>if a property with that name already exists</li>
542 <li>if the type of the value is not an allowed type
543 or if the value is <void/></li>
544 <li>if the name is not a valid property name</li>
545 <li>if the value is not valid for the property</li>
546 <li>if the attributes are not valid for the property</li>
548 <p><em>Not every implementation can detect each condition</em></p>
550 @throws com::sun::star::lang::WrappedTargetException
551 if an error occurs processing the event.
553 @see com::sun::star::configuration::backend::SchemaAttribute
555 void addPropertyWithValue
( [in] string aName
,
556 [in] short aAttributes
,
558 raises
( MalformedDataException
,
559 com
::sun
::star
::lang
::WrappedTargetException
);
561 //-------------------------------------------------------------------------
564 //=============================================================================
568 //=============================================================================