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_inspection_XNumericControl_idl__
29#define __com_sun_star_inspection_XNumericControl_idl__
30
31#ifndef __com_sun_star_inspection_XPropertyControl_idl__
32#include <com/sun/star/inspection/XPropertyControl.idl>
33#endif
34#ifndef __com_sun_star_beans_Optional_idl__
35#include <com/sun/star/beans/Optional.idl>
36#endif
37#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
38#include <com/sun/star/lang/IllegalArgumentException.idl>
39#endif
40
41//=============================================================================
42module com {  module sun {  module star {  module inspection {
43
44//-----------------------------------------------------------------------------
45/** defines the interface for an <type>XPropertyControl</type> which supports
46    displaying and entering numerical values.
47
48    @since OOo 2.0.3
49*/
50published interface XNumericControl : XPropertyControl
51{
52    /** describes the number of decimal digits to use for the value
53    */
54    [attribute] short   DecimalDigits;
55
56    /** describes the minimum value which is allowed to be entered in the control
57    */
58    [attribute] com::sun::star::beans::Optional<double> MinValue;
59
60    /** describes the maximum value which is allowed to be entered in the control
61    */
62    [attribute] com::sun::star::beans::Optional<double> MaxValue;
63
64    /** describes a <type scope="com::sun::star::util">MeasureUnit</type> to be applied
65        for displaying values.
66
67        <p>Only a certain set of <type scope="com::sun::star::util">MeasureUnit</type> values is
68        supported. In particular, every value which denotes a fraction of another
69        unit (like 100th millimiters) cannot be used as DisplayUnit.</p>
70
71        @throws com::sun::star::lang::IllegalArgumentException
72            if the caller attempts to set an unsupported <type scope="com::sun::star::util">MeasureUnit</type>
73    */
74    [attribute] short DisplayUnit
75    {
76        set raises (com::sun::star::lang::IllegalArgumentException);
77    };
78
79    /** describes a <type scope="com::sun::star::util">MeasureUnit</type> to be
80        applied for transfering values.
81
82        <p>The core measurement unit for a property value might differ from the unit which
83        is used by the control to display it. For instance, your property value might require
84        that your values denote 100th millimeters, but to the user, you want to present the
85        value as, say, inches. In this case, a numeric control can automatically handle the
86        value conversion for you, if you give it a ValueUnit different from the DisplayUnit.</p>
87
88        @see XPropertyControl::Value
89    */
90    [attribute] short ValueUnit;
91};
92
93//=============================================================================
94
95}; }; }; };
96
97#endif
98
99