1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_form_binding_BindableControlModel_idl__
29#define __com_sun_star_form_binding_BindableControlModel_idl__
30
31#ifndef __com_sun_star_form_binding_XBindableValue_idl__
32#include <com/sun/star/form/binding/XBindableValue.idl>
33#endif
34#ifndef __com_sun_star_form_FormControlModel_idl__
35#include <com/sun/star/form/FormControlModel.idl>
36#endif
37
38//=============================================================================
39
40module com {  module sun {  module star {  module form { module binding {
41
42/** specifies the model of a form control which supports binding to an external
43    value supplier.
44*/
45service BindableControlModel
46{
47    /** specifies the basic functionality for a form control model
48
49        <p>Via this service, bindable control models inherit the
50        <type scope="com::sun::star::util">XCloneable</type> interface.<br/>
51        If an bindable control model, at which a binding has been established (via
52        <member>XBindableValue::setValueBinding</member>), is being cloned, then the
53        binding is also established at the clone. Effectively, this means that
54        both control model instances share the same binding instance.</p>
55    */
56	service com::sun::star::form::FormControlModel;
57
58    /** specifies support for being bound to an external value
59
60        <p>When a <type>BindableControlModel</type> is bound to an external value,
61        then every change in the control model's value is <em>immediately</em> reflected
62        in the external binding.</p>
63
64        <p>If the binding set via this interface supports the <member>ValueBinding::ReadOnly</member>
65        and <member>ValueBinding::Relevant</member> properties, they're respected by the control model:
66        <ul><li>The control model's own <code>ReadOnly</code> property (if present) is kept in sync with the
67                binding's <code>ReadOnly</code> property. That is, any control using the value
68                binding is read-only as long as the binding is.</li>
69            <li>The control model's own <code>Enabled</code> property (if present) is kept in sync
70                with the binding's <code>Relevant</code> property. That is, any control using
71                the value binding is disabled as long as the binding is not relevant.</li>
72        </ul>
73        </p>
74
75        <p>In both cases, explicit changes of the model's property are ignored if they would relax
76        the restriction imposed by the binding.<br/>
77        For instance, if the binding declares it's value to
78        be read-only (indicated by <member>ValueBinding::ReadOnly</member> being <TRUE/>), then
79        any attempt to set the <code>ReadOnly</code> property of the control model to <FALSE/> will
80        fail. However, if the binding's value is not read-only, then the <code>ReadOnly</code>
81        property at the control model can be freely set.<br/>
82        The very same holds for the binding's <member>ValueBinding::Relevant</member> and the control
83        model's <code>Enabled</code> properties.</p>
84    */
85    interface XBindableValue;
86};
87
88//=============================================================================
89
90}; }; }; }; };
91
92#endif
93