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_BindableDatabaseCheckBox_idl__
29#define __com_sun_star_form_binding_BindableDatabaseCheckBox_idl__
30
31#ifndef __com_sun_star_form_component_DatabaseCheckBox_idl__
32#include <com/sun/star/form/component/DatabaseCheckBox.idl>
33#endif
34
35#ifndef __com_sun_star_form_binding_BindableDataAwareControlModel_idl__
36#include <com/sun/star/form/binding/BindableDataAwareControlModel.idl>
37#endif
38
39//=============================================================================
40
41module com {  module sun {  module star {  module form {  module binding {
42
43//=============================================================================
44
45/** This service specifies a check box which is data-aware and thus can be bound to a
46    database field, and additionally supports binding to arbitrary external values.
47
48    <p>The <type scope="com::sun::star::form::binding">XValueBinding</type> instance which
49    can be associated with a <type>BindableDatabaseCheckBox</type> must support exchanging
50    boolean values. The following mapping between external values and control states apply:
51    <ul><li><TRUE/> will be mapped to the box being checked, and vice versa</li>
52        <li><FALSE/> will be mapped to it being unchecked, and vice versa</li>
53        <li><NULL/> will be mapped to it being in indetermined state, if the box currently supports
54        this, or being unchecked else. The indetermined of the check box will always be
55        mapped to <NULL/> when writing the external value.</li>
56    </ul></p>
57
58    <p>If the value binding associated with a <type>BindableDatabaseCheckBox</type>
59    supports exchanging string values, <em>and</em> the <member scope="com::sun::star::form::component">CheckBox::RefValue</member>
60    is <em>not</em> empty, then the radio button will exchange it's value as string:
61    <ul><li>A string equal to the reference value will be mapped to the button being checked, and vice versa</li>
62        <li>A string not equal to the reference value will be mapped to the button being unchecked, and vice versa</li>
63        <li><NULL/> will be mapped to it being in indetermined state</li>
64    </ul></p>
65
66    @see com::sun::star::form::binding::XValueBinding::supportsType
67    @see com::sun::star::awt::UnoControlCheckBoxModel::State
68    @see com::sun::star::awt::UnoControlCheckBoxModel::TriState
69    @see com::sun::star::form::component::CheckBox::RefValue
70 */
71service BindableDatabaseCheckBox
72{
73	service com::sun::star::form::component::DatabaseCheckBox;
74
75    /** specifies the interaction between an internal binding to a database column,
76        and an external value binding.</p>
77    */
78    service com::sun::star::form::binding::BindableDataAwareControlModel;
79
80    /** specifies a value which is to be associated with the control when it's <em>not</em>
81        checked.
82
83        <p><member scope="com::sun::star::form::component">CheckBox::RefValue</member> is transferred to
84        possible external value bindings as soon as the check box is checked. With the member
85        <member>SecondaryRefValue</member>, clients of the check box can also associate a value with
86        the <em>not checked</em> state of the control.</p>
87    */
88    [property] string SecondaryRefValue;
89};
90
91//=============================================================================
92
93}; }; }; }; };
94
95#endif
96