1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_form_validation_ValidatableControlModel_idl__
25#define __com_sun_star_form_validation_ValidatableControlModel_idl__
26
27#ifndef __com_sun_star_form_FormControlModel_idl__
28#include <com/sun/star/form/FormControlModel.idl>
29#endif
30
31#ifndef __com_sun_star_form_validation_XValidatableFormComponent_idl__
32#include <com/sun/star/form/validation/XValidatableFormComponent.idl>
33#endif
34
35#ifndef __com_sun_star_form_validation_XValidityConstraintListener_idl__
36#include <com/sun/star/form/validation/XValidityConstraintListener.idl>
37#endif
38
39//=============================================================================
40
41module com {  module sun {  module star {  module form { module validation {
42
43/** specifies the model of a form control which supports live validation of its
44    input.
45
46    <p>Validatable control models support setting a validator with dynamic
47    validity constraints, and broadcasting changes in their value as well as the
48    validity of their value.</p>
49*/
50service ValidatableControlModel
51{
52    /** specifies the basic functionality for a form control model
53
54        <p>Via this service, validatable control models inherit the
55        <type scope="com::sun::star::util">XCloneable</type> interface.<br/>
56        If an validatable control model, at which a validator has been set (via
57        <member>XValidatable::setValidator</member>), is being cloned, then the
58        validator is also set at the clone. Effectively, this means that
59        both control model instances share the same validator instance.</p>
60    */
61    service com::sun::star::form::FormControlModel;
62
63    /** enables support for validating the value of the control model
64
65        <p>Setting an retrieving the current validator of the control model is
66        possible via the <type>XValidatable</type> interface (which
67        <type>XValidatableFormComponent</type> is derived from).</p>
68
69        <p>Easy access to the current value of the control, as well as it's validity
70        (relative to the active validator), is provided by the methods <member>XValidatableFormComponent::isValid</member>
71        and <member>XValidatableFormComponent::getCurrentValue</member>.</p>
72
73        <p>Note that the type of the value provided by <member>XValidatableFormComponent::getCurrentValue</member>
74        is not specified here, but depends on the concrete control type.</p>
75    */
76    interface XValidatableFormComponent;
77
78    /** enables support for validators with dynamic validity constraints.
79
80        <p>As soon as a validator is set via <member>XValidatable::setValidator</member>, the validatable
81        control model registers itself as listener. If the validity constraint of the validator
82        changes, the <type>ValidatableControlModel</type> re-validates it's current valid, and
83        broadcasts any resuling changes to all its <type>XFormComponentValidityListener</type>, if
84        necessary.</p>
85    */
86    interface XValidityConstraintListener;
87};
88
89//=============================================================================
90
91}; }; }; }; };
92
93#endif
94