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_ValueBinding_idl__
25cdf0e10cSrcweir#define __com_sun_star_form_binding_ValueBinding_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_util_XValueBinding_idl__
28cdf0e10cSrcweir#include <com/sun/star/form/binding/XValueBinding.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertySet_idl__
31cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
34cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
35cdf0e10cSrcweir#endif
36cdf0e10cSrcweir#ifndef __com_sun_star_util_XModifyBroadcaster_idl__
37cdf0e10cSrcweir#include <com/sun/star/util/XModifyBroadcaster.idl>
38cdf0e10cSrcweir#endif
39cdf0e10cSrcweir
40cdf0e10cSrcweir//=============================================================================
41cdf0e10cSrcweir
42cdf0e10cSrcweirmodule com {  module sun {  module star {  module form { module binding {
43cdf0e10cSrcweir
44cdf0e10cSrcweir//=============================================================================
45cdf0e10cSrcweir
46cdf0e10cSrcweir/** defines a component which allows access to a single value
47cdf0e10cSrcweir
48cdf0e10cSrcweir    <p>Read/Write access to the value represented by this component is supported,
49cdf0e10cSrcweir    as well as (optionally) active broadcasting of value changes</p>
50cdf0e10cSrcweir*/
51cdf0e10cSrcweirservice ValueBinding
52cdf0e10cSrcweir{
53cdf0e10cSrcweir    /** determines whether the value is currently readonly
54cdf0e10cSrcweir
55cdf0e10cSrcweir        <p>For instance, you could imagine a <type>ValueBinding</type> which
56cdf0e10cSrcweir        represents a cell in a spreadsheet document, and whose value is readonly
57cdf0e10cSrcweir        as long as the spreadsheet is locked.</p>
58cdf0e10cSrcweir
59cdf0e10cSrcweir        <p>As long as this property is <TRUE/>, the value binding should throw
60cdf0e10cSrcweir        a <type>InvalidBindingStateException</type> when its
61cdf0e10cSrcweir        <member>XValueBinding::setValue</member> method is invoked.</p>
62cdf0e10cSrcweir    */
63cdf0e10cSrcweir    [optional, property, bound, readonly]  boolean  ReadOnly;
64cdf0e10cSrcweir
65cdf0e10cSrcweir    /** determines the relevance of the value represented by the binding
66cdf0e10cSrcweir
67cdf0e10cSrcweir        <p>In a more complex scenario, where different form controls are bound to different
68cdf0e10cSrcweir        values, which all are part of a larger data structure, some of the items in this
69cdf0e10cSrcweir        data structure may not be relevant currently. This is indicated by the
70cdf0e10cSrcweir        <member>Relevant</member> property being <FALSE/>.</p>
71cdf0e10cSrcweir
72cdf0e10cSrcweir        <p><type>XBindableValue</type>s which are bound to this binding may or may not
73cdf0e10cSrcweir        react in certain ways on the (ir)relevance of their bound value.</p>
74cdf0e10cSrcweir
75cdf0e10cSrcweir        <p>One possible reaction could be that user interface elements which are associated
76cdf0e10cSrcweir        with the <type>XBindableValue</type> are disabled as long as <member>Relevant</member>
77cdf0e10cSrcweir        is <FALSE/>.</p>
78cdf0e10cSrcweir    */
79cdf0e10cSrcweir    [optional, property, bound, readonly]  boolean  Relevant;
80cdf0e10cSrcweir
81cdf0e10cSrcweir	//-------------------------------------------------------------------------
82cdf0e10cSrcweir	/** allows access to the properties of the binding
83cdf0e10cSrcweir    */
84cdf0e10cSrcweir    [optional] interface   com::sun::star::beans::XPropertySet;
85cdf0e10cSrcweir
86cdf0e10cSrcweir    //-------------------------------------------------------------------------
87cdf0e10cSrcweir	/** allows read and write access to the value represented by this binding
88cdf0e10cSrcweir    */
89cdf0e10cSrcweir    interface XValueBinding;
90cdf0e10cSrcweir
91cdf0e10cSrcweir    /** allows other components to be notified when the value represented
92cdf0e10cSrcweir        by the <type>ValueBinding</type> instance changes.
93cdf0e10cSrcweir
94cdf0e10cSrcweir        <p>This interface is optional, since a binding may not support
95cdf0e10cSrcweir        actively notifying changes in it's value. Note, however, that in case
96cdf0e10cSrcweir        this interface is not supported, the bound component cannot react
97cdf0e10cSrcweir        on value changes, and will thus override any values which are
98cdf0e10cSrcweir        set by an instance other than itself.</p>
99cdf0e10cSrcweir    */
100cdf0e10cSrcweir    [optional] interface com::sun::star::util::XModifyBroadcaster;
101cdf0e10cSrcweir
102cdf0e10cSrcweir    /** allows life time control for the component
103cdf0e10cSrcweir
104cdf0e10cSrcweir        <p>An <type>ValueBinding</type> may be known to one ore more components
105cdf0e10cSrcweir        supporting the <type>XBindableValue</type> interface, which all work with
106cdf0e10cSrcweir        this binding. However, they will not <em>own</em> the <type>ValueBinding</type>.
107cdf0e10cSrcweir        The ownership is with another instance, which may also decide to obsolete
108cdf0e10cSrcweir        the <type>ValueBinding</type> for whatever reasons (e.g. because the data model
109cdf0e10cSrcweir        which the binding reflected died). For this reason, a <type>ValueBinding</type>
110cdf0e10cSrcweir        must offer a possibility to be obsoleted by it's owner, and to notify this
111cdf0e10cSrcweir        obsoletion to other interested parties, such as <type>XBindableValue</type>s.</p>
112cdf0e10cSrcweir    */
113cdf0e10cSrcweir    interface com::sun::star::lang::XComponent;
114cdf0e10cSrcweir};
115cdf0e10cSrcweir
116cdf0e10cSrcweir//=============================================================================
117cdf0e10cSrcweir
118cdf0e10cSrcweir}; }; }; }; };
119cdf0e10cSrcweir
120cdf0e10cSrcweir#endif
121