update dev300-m58
[ooovba.git] / offapi / com / sun / star / form / binding / BindableDataAwareControlModel.idl
blob1b635a4c63bd743af588e38ac35e28b0b36d34a8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BindableDataAwareControlModel.idl,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
31 #ifndef __com_sun_star_form_binding_BindableDataAwareControlModel_idl__
32 #define __com_sun_star_form_binding_BindableDataAwareControlModel_idl__
34 #ifndef __com_sun_star_form_DataAwareControlModel_idl__
35 #include <com/sun/star/form/DataAwareControlModel.idl>
36 #endif
38 #ifndef __com_sun_star_form_binding_BindableControlModel_idl__
39 #include <com/sun/star/form/binding/BindableControlModel.idl>
40 #endif
42 //=============================================================================
44 module com { module sun { module star { module form { module binding {
46 //=============================================================================
48 /** is a specialization of the <type scope="com::sun::star::form">DataAwareControlModel</type>
49 which additionally supports binding to external value suppliers.
51 <p>Control models usually have some kind of value property, which reflects the very current
52 content of the controls associated with this model. For instance, for an
53 <type scope="com::sun::star::form::component">TextField</type>, this would be the
54 <member scope="com::sun::star::awt">UnoControlEditModel::Text</member> property of the base
55 service. Similarily, a <type scope="com::sun::star::form::component">CheckBox</type> has
56 a property <member scope="com::sun::star::awt">UnoControlCheckBoxModel::State</member>, which
57 reflects the current check state.</p>
59 <p>Usual <type scope="com::sun::star::form">DataAwareControlModel</type>s can be bound to
60 a column of a <type scope="com::sun::star::form::component">DataForm</type>, and exchange
61 their content with such a column.<br/>
62 In particular, when the <type scope="com::sun::star::form::component">DataForm</type>
63 is moved to a different record, then the bound control model is updated with the value of
64 it's column in this particular row.<br/>
65 On the other hand, when any change in the control model (e.g. resulting from a user entering
66 data in a control associated with the control model) is committed
67 (<member scope="com::sun::star::form">XBoundComponent::commit</member>), then the actual
68 data of the control model is written into the associated
69 <type scope="com::sun::star::form::component">DataForm</type> column.</p>
71 <p><type>BindableDataAwareControlModel</type>'s additionally support an alternative value
72 binding, which forces them to exchange their value with another foreign instance.
73 In some sense, they are an abstraction of the data aware control models, which only
74 support a specialized, hard-coded value binding (namely the binding to a
75 <type scope="com::sun::star::form::component">DataForm</type> column).</p>
77 <p>For this, they provide the <type>XBindableValue</type> interface which allows to
78 set an external component to exchange the value with.</p>
80 <p>The following rules apply when a data aware control model is bound to an external value binding:
81 <ul><li><b>Priority</b><br/>
82 External value bindings overrule any active SQL-column binding. If an external
83 component is bound to a control model which currently has an active SQL binding,
84 this SQL binding is suspended, until the external binding is revoked.
85 </li>
86 <li><b>Activation</b><br/>
87 An external value binding becomes effective as soon as it is set. This is a
88 difference to SQL bindings, which only are effective when the parent form
89 of the control model is loaded (<type scope="com::sun::star::form">XLoadable</type>).
90 </li>
91 <li><b>Immediacy</b><br/>
92 When a <type>BindableDataAwareControlModel</type> is bound to an external value,
93 then every change in the control model's value is <em>immediately</em> reflected
94 in the external binding. This is a difference to SQL bindings of most
95 <type scope="com::sun::star::form">DataAwareControlModel</type>'s, where changes
96 in the control model's value are only propagated to the bound column upon explicit
97 request via <member scope="com::sun::star::form">XBoundComponent::commit</member>.<br/>
98 Note that this restriction is inherited from the <type>BindableControlModel</type>.
99 </li>
100 <li><b>Cloning</b><br/>
101 <type scope="com::sun::star::form">FormControlModel</type>s support cloning themself
102 via the <type scope="com::sun::star::util">XCloneable</type> interface which they
103 inherit from the <type scope="com::sun::star::awt">UnoControlModel</type> service.</br>
104 When a <type>BindableDataAwareControlModel</type> is cloned while it has an active
105 external value binding, then the clone is also bound to the same binding instance.<br/>
106 Note that this restriction is inherited from the <type>BindableControlModel</type>.
107 </li>
108 </ul>
109 </p>
111 <p>When a <type>BindableDataAwareControlModel</type> is being bound to an external value,
112 using <member>XBindableValue::setValueBinding</member>,
113 then the control model (it's value property, respectively) and the external value are
114 initially synchronized by setting the external value (<member>XValueBinding::getValue</member>)
115 at the control model.</p>
118 service BindableDataAwareControlModel
120 /** specifies the functionality for binding the control model to a
121 column of an SQL <type scope="com::sun::star::form::component">DataForm</type>.
123 service com::sun::star::form::DataAwareControlModel;
125 /** specifies the functionality for <em>alternatively</em> binding the control model
126 to an external value.
128 service BindableControlModel;
131 //=============================================================================
133 }; }; }; }; };
135 #endif