1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XNumericControl.idl,v $
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_inspection_XNumericControl_idl__
32 #define __com_sun_star_inspection_XNumericControl_idl__
34 #ifndef __com_sun_star_inspection_XPropertyControl_idl__
35 #include
<com
/sun
/star
/inspection
/XPropertyControl.idl
>
37 #ifndef __com_sun_star_beans_Optional_idl__
38 #include
<com
/sun
/star
/beans
/Optional.idl
>
40 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
41 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
44 //=============================================================================
45 module com
{ module sun
{ module star
{ module inspection
{
47 //-----------------------------------------------------------------------------
48 /** defines the interface for an <type>XPropertyControl</type> which supports
49 displaying and entering numerical values.
53 interface XNumericControl
: XPropertyControl
55 /** describes the number of decimal digits to use for the value
57 [attribute
] short DecimalDigits
;
59 /** describes the minimum value which is allowed to be entered in the control
61 [attribute
] com
::sun
::star
::beans
::Optional<double> MinValue
;
63 /** describes the maximum value which is allowed to be entered in the control
65 [attribute
] com
::sun
::star
::beans
::Optional<double> MaxValue
;
67 /** describes a <type scope="com::sun::star::util">MeasureUnit</type> to be applied
68 for displaying values.
70 <p>Only a certain set of <type scope="com::sun::star::util">MeasureUnit</type> values is
71 supported. In particular, every value which denotes a fraction of another
72 unit (like 100th millimiters) cannot be used as DisplayUnit.</p>
74 @throws com::sun::star::lang::IllegalArgumentException
75 if the caller attempts to set an unsupported <type scope="com::sun::star::util">MeasureUnit</type>
77 [attribute
] short DisplayUnit
79 set raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
82 /** describes a <type scope="com::sun::star::util">MeasureUnit</type> to be
83 applied for transfering values.
85 <p>The core measurement unit for a property value might differ from the unit which
86 is used by the control to display it. For instance, your property value might require
87 that your values denote 100th millimeters, but to the user, you want to present the
88 value as, say, inches. In this case, a numeric control can automatically handle the
89 value conversion for you, if you give it a ValueUnit different from the DisplayUnit.</p>
91 @see XPropertyControl::Value
93 [attribute
] short ValueUnit
;
96 //=============================================================================