1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_form_binding_BindableControlModel_idl__
25cdf0e10cSrcweir#define __com_sun_star_form_binding_BindableControlModel_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_form_binding_XBindableValue_idl__
28cdf0e10cSrcweir#include <com/sun/star/form/binding/XBindableValue.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir#ifndef __com_sun_star_form_FormControlModel_idl__
31cdf0e10cSrcweir#include <com/sun/star/form/FormControlModel.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir//=============================================================================
35cdf0e10cSrcweir
36cdf0e10cSrcweirmodule com {  module sun {  module star {  module form { module binding {
37cdf0e10cSrcweir
38cdf0e10cSrcweir/** specifies the model of a form control which supports binding to an external
39cdf0e10cSrcweir    value supplier.
40cdf0e10cSrcweir*/
41cdf0e10cSrcweirservice BindableControlModel
42cdf0e10cSrcweir{
43cdf0e10cSrcweir    /** specifies the basic functionality for a form control model
44cdf0e10cSrcweir
45cdf0e10cSrcweir        <p>Via this service, bindable control models inherit the
46cdf0e10cSrcweir        <type scope="com::sun::star::util">XCloneable</type> interface.<br/>
47cdf0e10cSrcweir        If an bindable control model, at which a binding has been established (via
48cdf0e10cSrcweir        <member>XBindableValue::setValueBinding</member>), is being cloned, then the
49cdf0e10cSrcweir        binding is also established at the clone. Effectively, this means that
50cdf0e10cSrcweir        both control model instances share the same binding instance.</p>
51cdf0e10cSrcweir    */
52cdf0e10cSrcweir	service com::sun::star::form::FormControlModel;
53cdf0e10cSrcweir
54cdf0e10cSrcweir    /** specifies support for being bound to an external value
55cdf0e10cSrcweir
56cdf0e10cSrcweir        <p>When a <type>BindableControlModel</type> is bound to an external value,
57cdf0e10cSrcweir        then every change in the control model's value is <em>immediately</em> reflected
58cdf0e10cSrcweir        in the external binding.</p>
59cdf0e10cSrcweir
60cdf0e10cSrcweir        <p>If the binding set via this interface supports the <member>ValueBinding::ReadOnly</member>
61cdf0e10cSrcweir        and <member>ValueBinding::Relevant</member> properties, they're respected by the control model:
62cdf0e10cSrcweir        <ul><li>The control model's own <code>ReadOnly</code> property (if present) is kept in sync with the
63cdf0e10cSrcweir                binding's <code>ReadOnly</code> property. That is, any control using the value
64cdf0e10cSrcweir                binding is read-only as long as the binding is.</li>
65cdf0e10cSrcweir            <li>The control model's own <code>Enabled</code> property (if present) is kept in sync
66cdf0e10cSrcweir                with the binding's <code>Relevant</code> property. That is, any control using
67cdf0e10cSrcweir                the value binding is disabled as long as the binding is not relevant.</li>
68cdf0e10cSrcweir        </ul>
69cdf0e10cSrcweir        </p>
70cdf0e10cSrcweir
71cdf0e10cSrcweir        <p>In both cases, explicit changes of the model's property are ignored if they would relax
72cdf0e10cSrcweir        the restriction imposed by the binding.<br/>
73cdf0e10cSrcweir        For instance, if the binding declares it's value to
74cdf0e10cSrcweir        be read-only (indicated by <member>ValueBinding::ReadOnly</member> being <TRUE/>), then
75cdf0e10cSrcweir        any attempt to set the <code>ReadOnly</code> property of the control model to <FALSE/> will
76cdf0e10cSrcweir        fail. However, if the binding's value is not read-only, then the <code>ReadOnly</code>
77cdf0e10cSrcweir        property at the control model can be freely set.<br/>
78cdf0e10cSrcweir        The very same holds for the binding's <member>ValueBinding::Relevant</member> and the control
79cdf0e10cSrcweir        model's <code>Enabled</code> properties.</p>
80cdf0e10cSrcweir    */
81cdf0e10cSrcweir    interface XBindableValue;
82cdf0e10cSrcweir};
83cdf0e10cSrcweir
84cdf0e10cSrcweir//=============================================================================
85cdf0e10cSrcweir
86cdf0e10cSrcweir}; }; }; }; };
87cdf0e10cSrcweir
88cdf0e10cSrcweir#endif
89