1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSchemaHandler.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_configuration_backend_XSchemaHandler_idl__
31 #define __com_sun_star_configuration_backend_XSchemaHandler_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_configuration_backend_TemplateIdentifier_idl__
38 #include
<com
/sun
/star
/configuration
/backend
/TemplateIdentifier.idl
>
41 #ifndef __com_sun_star_configuration_backend_MalformedDataException_idl__
42 #include
<com
/sun
/star
/configuration
/backend
/MalformedDataException.idl
>
45 #ifndef __com_sun_star_lang_WrappedTargetException_idl__
46 #include
<com
/sun
/star
/lang
/WrappedTargetException.idl
>
49 //=============================================================================
51 module com
{ module sun
{ module star
{ module configuration
{ module backend
{
53 //=============================================================================
55 /** receives a description of a configuration schema as a sequence of events.
59 published
interface XSchemaHandler
: ::com
::sun
::star
::uno
::XInterface
61 //-------------------------------------------------------------------------
63 /** receives notification that a schema description is started.
65 <p> The schema descrption may comprise components templates or both.
68 @throws com::sun::star::configuration::backend::MalformedDataException
69 if a schema is already started (and has not been ended).
71 @throws com::sun::star::lang::WrappedTargetException
72 if an error occurs processing the event.
75 raises
( MalformedDataException
,
76 com
::sun
::star
::lang
::WrappedTargetException
);
77 //-------------------------------------------------------------------------
79 /** receives notification that the current schema description is complete.
81 <p> Must match a previous call to <member>startSchema</member>.
84 @throws com::sun::star::configuration::backend::MalformedDataException
86 <li>if invalid data is detected in the schema</li>
87 <li>if there is a unfinished component or template in progress</li>
88 <li>if no schema is started at all</li>
90 <p><em>Not every implementation can detect each condition</em></p>
92 @throws com::sun::star::lang::WrappedTargetException
93 if an error occurs processing the event.
96 raises
( MalformedDataException
,
97 com
::sun
::star
::lang
::WrappedTargetException
);
98 //-------------------------------------------------------------------------
100 /** receives notification that the schema depends on templates
101 from a different component.
104 specifies the name of the component.
106 @throws com::sun::star::configuration::backend::MalformedDataException
108 <li>if there is a unfinished component or template in progress</li>
109 <li>if no schema is started at all</li>
110 <li>if the name is not a valid component name</li>
111 <li>if the requested component is not found</li>
113 <p><em>Not every implementation can detect each condition</em></p>
115 @throws com::sun::star::lang::WrappedTargetException
116 if an error occurs processing the event.
118 void importComponent
( [in] string aName
)
119 raises
( MalformedDataException
,
120 com
::sun
::star
::lang
::WrappedTargetException
);
121 //-------------------------------------------------------------------------
123 /** receives notification that a component description is started.
125 <p> Subsequent calls describe the schema of the component
126 until a matching call to <member>endComponent</member>
131 specifies the name of the component.
133 @throws com::sun::star::configuration::backend::MalformedDataException
135 <li>if there is a unfinished component or template in progress </li>
136 <li>if no schema is started at all </li>
137 <li>if there already is a component data tree of this name</li>
138 <li>if the name is not a valid component name</li>
139 <li>if the instance supports no component schemas (only templates)</li>
141 <p><em>Not every implementation can detect each condition</em></p>
143 @throws com::sun::star::lang::WrappedTargetException
144 if an error occurs processing the event.
146 void startComponent
( [in] string aName
)
147 raises
( MalformedDataException
,
148 com
::sun
::star
::lang
::WrappedTargetException
);
149 //-------------------------------------------------------------------------
151 /** receives notification that a component description is complete.
153 <p> Must match a previous call to <member>startComponent</member>.
156 @throws com::sun::star::configuration::backend::MalformedDataException
158 <li>if invalid data is detected in the component<li>
159 <li>if there is a unfinished subnode in progress<li>
160 <li>if no component has been started at all<li>
161 <li>if the instance supports no component schemas (only templates)<li>
163 <p><em>Not every implementation can detect each condition</em></p>
165 @throws com::sun::star::lang::WrappedTargetException
166 if an error occurs processing the event.
169 raises
( MalformedDataException
,
170 com
::sun
::star
::lang
::WrappedTargetException
);
171 //-------------------------------------------------------------------------
173 /** receives notification that a template description is started for a group.
175 <p> Subsequent calls describe the members and properties of the template
176 until a matching call to <member>endTemplate</member>
181 specifies the identity of the template.
184 specifies the attributes of the template.
186 <p> The value is a combination of
187 <type>SchemaAttribute</type> flags.
189 <p> <const>SchemaAttribute::EXTENSIBLE</const> can be used
190 to describe a template for a node with an extensible
194 @throws com::sun::star::configuration::backend::MalformedDataException
196 <li>if there is a unfinished component or template in progress</li>
197 <li>if no schema is started at all </li>
198 <li>if there already is a template with that identifier</li>
199 <li>if the name is not a valid template identifier </li>
200 <li>if the attributes are not valid for a group</li>
201 <li>if the instance supports no templates (only component schemas)</li>
203 <p><em>Not every implementation can detect each condition</em></p>
205 @throws com::sun::star::lang::WrappedTargetException
206 if an error occurs processing the event.
208 @see com::sun::star::configuration::backend::SchemaAttribute
210 void startGroupTemplate
( [in] TemplateIdentifier aTemplate
,
211 [in] short aAttributes
)
212 raises
( MalformedDataException
,
213 com
::sun
::star
::lang
::WrappedTargetException
);
214 //-------------------------------------------------------------------------
216 /** receives notification that a template description is started for a set.
218 <p> Subsequent calls describe the members and properties of the template
219 until a matching call to <member>endTemplate</member>
224 specifies the identity of the template.
227 specifies the attributes of the template.
229 <p> The value is a combination of
230 <type>SchemaAttribute</type> flags.
232 <p> <const>SchemaAttribute::EXTENSIBLE</const> can be used
233 to describe a template for a node with an extensible
238 specifies the (default) template for set items.
240 @throws com::sun::star::configuration::backend::MalformedDataException
242 <li>if there is a unfinished component or template in progress</li>
243 <li>if no schema is started at all </li>
244 <li>if there already is a template with that identifier</li>
245 <li>if the item-type template is not found</li>
246 <li>if the name or item-type are not valid template identifiers </li>
247 <li>if the attributes are not valid for a set</li>
248 <li>if the instance supports no templates (only component schemas).</li>
250 <p><em>Not every implementation can detect each condition</em></p>
252 @throws com::sun::star::lang::WrappedTargetException
253 if an error occurs processing the event.
255 @see com::sun::star::configuration::backend::SchemaAttribute
257 void startSetTemplate
( [in] TemplateIdentifier aTemplate
,
258 [in] short aAttributes
,
259 [in] TemplateIdentifier aItemType
)
260 raises
( MalformedDataException
,
261 com
::sun
::star
::lang
::WrappedTargetException
);
262 //-------------------------------------------------------------------------
264 /** receives notification that a template description is complete.
266 <p> Must match a previous call to <member>startGroupTemplate</member>
267 or <member>startSetTemplate</member>.
270 @throws com::sun::star::configuration::backend::MalformedDataException
272 <li>if invalid data is detected in the template</li>
273 <li>if there is a unfinished subnode in progress</li>
274 <li>if no template has been started at all</li>
275 <li>if the instance supports no templates (only component schemas)</li>
277 <p><em>Not every implementation can detect each condition</em></p>
279 @throws com::sun::star::lang::WrappedTargetException
280 if an error occurs processing the event.
283 raises
( MalformedDataException
,
284 com
::sun
::star
::lang
::WrappedTargetException
);
285 //-------------------------------------------------------------------------
287 /** receives notification that a group description is started.
289 <p> Subsequent calls describe the members and properties of the group
290 until a matching call to <member>endNode</member>
295 specifies the name of the group.
298 specifies the attributes of the node.
300 <p> The value is a combination of
301 <type>SchemaAttribute</type> flags.
303 <p> <const>SchemaAttribute::EXTENSIBLE</const> can be used
304 to describe a group with an extensible set of properties.
307 @throws com::sun::star::configuration::backend::MalformedDataException
309 <li>if there isn't a group node in progress currently</li>
310 <li>if there already is a node with that name</li>
311 <li>if the name is not a valid node name</li>
312 <li>if the attributes are not valid for a group</li>
314 <p><em>Not every implementation can detect each condition</em></p>
316 @throws com::sun::star::lang::WrappedTargetException
317 if an error occurs processing the event.
319 @see com::sun::star::configuration::backend::SchemaAttribute
321 void startGroup
( [in] string aName
,
322 [in] short aAttributes
)
323 raises
( MalformedDataException
,
324 com
::sun
::star
::lang
::WrappedTargetException
);
325 //-------------------------------------------------------------------------
327 /** receives notification that a set description is started.
329 <p> Subsequent calls describe the item-types and properties of the set
330 until a matching call to <member>endNode</member>
335 specifies the name of the set.
338 specifies the attributes of the node.
340 <p> The value is a combination of
341 <type>SchemaAttribute</type> flags.
343 <p> <const>SchemaAttribute::EXTENSIBLE</const> can be used
344 to describe a set with an extensible set of properties.
348 specifies the (default) template for set items.
350 @throws com::sun::star::configuration::backend::MalformedDataException
352 <li>if there isn't a group node in progress currently</li>
353 <li>if there already is a node with that name</li>
354 <li>if the item-type template is not found</li>
355 <li>if the name is not a valid node name</li>
356 <li>if the item-type is not a valid template identifier</li>
357 <li>if the attributes are not valid for a set</li>
359 <p><em>Not every implementation can detect each condition</em></p>
361 @throws com::sun::star::lang::WrappedTargetException
362 if an error occurs processing the event.
364 @see com::sun::star::configuration::backend::SchemaAttribute
366 void startSet
( [in] string aName
,
367 [in] short aAttributes
,
368 [in] TemplateIdentifier aItemType
)
369 raises
( MalformedDataException
,
370 com
::sun
::star
::lang
::WrappedTargetException
);
371 //-------------------------------------------------------------------------
373 /** receives notification that a node description is complete.
375 <p> Must match the last open call to <member>startGroup</member>
376 or <member>startSet</member>.
379 @throws com::sun::star::configuration::backend::MalformedDataException
381 <li>if the name is not a the name of the node in progress</li>
382 <li>if invalid data is detected in the node</li>
383 <li>if no node has been started at all</li>
385 <p><em>Not every implementation can detect each condition</em></p>
387 @throws com::sun::star::lang::WrappedTargetException
388 if an error occurs processing the event.
391 raises
( MalformedDataException
,
392 com
::sun
::star
::lang
::WrappedTargetException
);
393 //-------------------------------------------------------------------------
395 /** receives notification that a property is added to the current node.
397 <p> The property will have a default value of <NULL/>
398 (unless it is <const>SchemaAttribute::REQUIRED</const>).
402 specifies the name of the new property.
405 specifies the attributes of the new property.
407 <p> The value is a combination of
408 <type>SchemaAttribute</type> flags.
412 specifies the type of the new property.
414 @throws com::sun::star::configuration::backend::MalformedDataException
416 <li>if there isn't a group or extensible node in progress currently</li>
417 <li>if a property with the same name already exists</li>
418 <li>if the specified type is not allowed</li>
419 <li>if the name is not a valid property name</li>
420 <li>if the attributes are not valid for a property</li>
422 <p><em>Not every implementation can detect each condition</em></p>
424 @throws com::sun::star::lang::WrappedTargetException
425 if an error occurs processing the event.
427 @see com::sun::star::configuration::backend::SchemaAttribute
429 void addProperty
( [in] string aName
,
430 [in] short aAttributes
,
432 raises
( MalformedDataException
,
433 com
::sun
::star
::lang
::WrappedTargetException
);
435 //-------------------------------------------------------------------------
437 /** receives notification that a property having a default value
438 is added to the current node.
441 specifies the name of the new property.
444 specifies the attributes of the new property.
446 <p> The value is a combination of
447 <type>SchemaAttribute</type> flags.
451 specifies the value of the new property.
453 <p> The value also determines the type.
454 Therefore the value must not be <void/>.
457 @throws com::sun::star::configuration::backend::MalformedDataException
459 <li>if there isn't a group or extensible node in progress currently</li>
460 <li>if a property with the same name already exists</li>
461 <li>if the type of the default value is not an allowed type,
462 or if the default value is <void/></li>
463 <li>if the name is not a valid property name</li>
464 <li>if the attributes are not valid for a property</li>
466 <p><em>Not every implementation can detect each condition</em></p>
468 @throws com::sun::star::lang::WrappedTargetException
469 if an error occurs processing the event.
471 @see com::sun::star::configuration::backend::SchemaAttribute
473 void addPropertyWithDefault
( [in] string aName
,
474 [in] short aAttributes
,
475 [in] any aDefaultValue
)
476 raises
( MalformedDataException
,
477 com
::sun
::star
::lang
::WrappedTargetException
);
479 //-------------------------------------------------------------------------
481 /** receives notification that the current group has a child node
482 that is an instance of a specified template.
485 specifies the name of the new node.
488 specifies a template that describes the new node.
490 @throws com::sun::star::configuration::backend::MalformedDataException
492 <li>if there isn't a group node in progress currently</li>
493 <li>if there already is a node with that name</li>
494 <li>if the template is not found</li>
495 <li>if the name or template name are not valid</li>
497 <p><em>Not every implementation can detect each condition</em></p>
499 @throws com::sun::star::lang::WrappedTargetException
500 if an error occurs processing the event.
502 void addInstance
( [in] string aName
,
503 [in] TemplateIdentifier aTemplate
)
504 raises
( MalformedDataException
,
505 com
::sun
::star
::lang
::WrappedTargetException
);
507 //-------------------------------------------------------------------------
509 /** receives notification that the current set can contain items
510 that are instances of a specified template.
513 specifies a template that is accepted as valid item type
514 for the current set node.
516 @throws com::sun::star::configuration::backend::MalformedDataException
518 <li>if there isn't a set node in progress currently</li>
519 <li>if the template is not found</li>
520 <li>if the name is not a valid template name</li>
522 <p><em>Not every implementation can detect each condition</em></p>
524 @throws com::sun::star::lang::WrappedTargetException
525 if an error occurs processing the event.
527 void addItemType
( [in] TemplateIdentifier aItemType
)
528 raises
( MalformedDataException
,
529 com
::sun
::star
::lang
::WrappedTargetException
);
531 //-------------------------------------------------------------------------
535 //=============================================================================
539 //=============================================================================