bump product version to 4.1.6.2
[LibreOffice.git] / offapi / com / sun / star / form / binding / BindableDataAwareControlModel.idl
blobd9a3855804d656b2b9acb038dec3cf07a04b040d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /**
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_form_binding_BindableDataAwareControlModel_idl__
21 #define __com_sun_star_form_binding_BindableDataAwareControlModel_idl__
23 #include <com/sun/star/form/DataAwareControlModel.idl>
24 #include <com/sun/star/form/binding/BindableControlModel.idl>
27 module com { module sun { module star { module form { module binding {
30 /** is a specialization of the <type scope="com::sun::star::form">DataAwareControlModel</type>
31 which additionally supports binding to external value suppliers.
33 <p>Control models usually have some kind of value property, which reflects the very current
34 content of the controls associated with this model. For instance, for an
35 <type scope="com::sun::star::form::component">TextField</type>, this would be the
36 <member scope="com::sun::star::awt">UnoControlEditModel::Text</member> property of the base
37 service. Similarly, a <type scope="com::sun::star::form::component">CheckBox</type> has
38 a property <member scope="com::sun::star::awt">UnoControlCheckBoxModel::State</member>, which
39 reflects the current check state.</p>
41 <p>Usual <type scope="com::sun::star::form">DataAwareControlModel</type>s can be bound to
42 a column of a <type scope="com::sun::star::form::component">DataForm</type>, and exchange
43 their content with such a column.<br/>
44 In particular, when the <type scope="com::sun::star::form::component">DataForm</type>
45 is moved to a different record, then the bound control model is updated with the value of
46 it's column in this particular row.<br/>
47 On the other hand, when any change in the control model (e.g. resulting from a user entering
48 data in a control associated with the control model) is committed
49 (<member scope="com::sun::star::form">XBoundComponent::commit</member>), then the actual
50 data of the control model is written into the associated
51 <type scope="com::sun::star::form::component">DataForm</type> column.</p>
53 <p><type>BindableDataAwareControlModel</type>'s additionally support an alternative value
54 binding, which forces them to exchange their value with another foreign instance.
55 In some sense, they are an abstraction of the data aware control models, which only
56 support a specialized, hard-coded value binding (namely the binding to a
57 <type scope="com::sun::star::form::component">DataForm</type> column).</p>
59 <p>For this, they provide the <type>XBindableValue</type> interface which allows to
60 set an external component to exchange the value with.</p>
62 <p>The following rules apply when a data aware control model is bound to an external value binding:
63 <ul><li><b>Priority</b><br/>
64 External value bindings overrule any active SQL-column binding. If an external
65 component is bound to a control model which currently has an active SQL binding,
66 this SQL binding is suspended, until the external binding is revoked.
67 </li>
68 <li><b>Activation</b><br/>
69 An external value binding becomes effective as soon as it is set. This is a
70 difference to SQL bindings, which only are effective when the parent form
71 of the control model is loaded (<type scope="com::sun::star::form">XLoadable</type>).
72 </li>
73 <li><b>Immediacy</b><br/>
74 When a <type>BindableDataAwareControlModel</type> is bound to an external value,
75 then every change in the control model's value is <em>immediately</em> reflected
76 in the external binding. This is a difference to SQL bindings of most
77 <type scope="com::sun::star::form">DataAwareControlModel</type>'s, where changes
78 in the control model's value are only propagated to the bound column upon explicit
79 request via <member scope="com::sun::star::form">XBoundComponent::commit</member>.<br/>
80 Note that this restriction is inherited from the <type>BindableControlModel</type>.
81 </li>
82 <li><b>Cloning</b><br/>
83 <type scope="com::sun::star::form">FormControlModel</type>s support cloning themselves
84 via the <type scope="com::sun::star::util">XCloneable</type> interface which they
85 inherit from the <type scope="com::sun::star::awt">UnoControlModel</type> service.</br>
86 When a <type>BindableDataAwareControlModel</type> is cloned while it has an active
87 external value binding, then the clone is also bound to the same binding instance.<br/>
88 Note that this restriction is inherited from the <type>BindableControlModel</type>.
89 </li>
90 </ul>
91 </p>
93 <p>When a <type>BindableDataAwareControlModel</type> is being bound to an external value,
94 using <member>XBindableValue::setValueBinding</member>,
95 then the control model (it's value property, respectively) and the external value are
96 initially synchronized by setting the external value (<member>XValueBinding::getValue</member>)
97 at the control model.</p>
100 service BindableDataAwareControlModel
102 /** specifies the functionality for binding the control model to a
103 column of an SQL <type scope="com::sun::star::form::component">DataForm</type>.
105 service com::sun::star::form::DataAwareControlModel;
107 /** specifies the functionality for <em>alternatively</em> binding the control model
108 to an external value.
110 service BindableControlModel;
114 }; }; }; }; };
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */