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: XNumberFormatter.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 ************************************************************************/
30 #ifndef __com_sun_star_util_XNumberFormatter_idl__
31 #define __com_sun_star_util_XNumberFormatter_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_util_Color_idl__
38 #include
<com
/sun
/star
/util
/Color.idl
>
41 #ifndef __com_sun_star_util_XNumberFormatsSupplier_idl__
42 #include
<com
/sun
/star
/util
/XNumberFormatsSupplier.idl
>
45 #ifndef __com_sun_star_util_NotNumericException_idl__
46 #include
<com
/sun
/star
/util
/NotNumericException.idl
>
49 #ifndef __com_sun_star_util_Color_idl__
50 #include
<com
/sun
/star
/util
/Color.idl
>
54 //=============================================================================
56 module com
{ module sun
{ module star
{ module util
{
58 //=============================================================================
60 /** represents a number formatter.
62 published
interface XNumberFormatter
: com
::sun
::star
::uno
::XInterface
64 //-------------------------------------------------------------------------
66 /** attaches an <type>XNumberFormatsSupplier</type> to this
67 <type>NumberFormatter</type>.
69 <p>This <type>NumberFormatter</type> will only use the <type>NumberFormats</type>
70 specified in the attached <type>XNumberFormatsSupplier</type>. Without an attached
71 <type>XNumberFormatsSupplier</type>, no formatting is possible.</p>
73 void attachNumberFormatsSupplier
( [in] com
::sun
::star
::util
::XNumberFormatsSupplier xSupplier
);
75 //-------------------------------------------------------------------------
78 the attached <type>XNumberFormatsSupplier</type>.
80 com
::sun
::star
::util
::XNumberFormatsSupplier getNumberFormatsSupplier
();
82 //-------------------------------------------------------------------------
84 /** detects the number format in a string which contains a formatted number.
86 long detectNumberFormat
( [in] long nKey
,
88 raises
( com
::sun
::star
::util
::NotNumericException
);
90 //-------------------------------------------------------------------------
92 /** converts a string which contains a formatted number into a number.
94 <p>If this is a text format, the string will not be converted.</p>
96 double convertStringToNumber
( [in] long nKey
,
98 raises
( com
::sun
::star
::util
::NotNumericException
);
100 //-------------------------------------------------------------------------
102 /** converts a number into a string.
104 string convertNumberToString
( [in] long nKey
,
105 [in] double fValue
);
107 //-------------------------------------------------------------------------
110 the color which is specified for the given value in the number format,
111 which is otherwise the value of <var>aDefaultColor</var>.
113 com
::sun
::star
::util
::Color queryColorForNumber
( [in] long nKey
,
115 [in] com
::sun
::star
::util
::Color aDefaultColor
);
117 //-------------------------------------------------------------------------
119 /** converts a string into another string.
121 string formatString
( [in] long nKey
,
122 [in] string aString
);
124 //-------------------------------------------------------------------------
127 the color which is specified for the given string in the number format,
128 which is otherwise the value of <var>aDefaultColor</var>.
130 com
::sun
::star
::util
::Color queryColorForString
( [in] long nKey
,
132 [in] com
::sun
::star
::util
::Color aDefaultColor
);
134 //-------------------------------------------------------------------------
136 /** converts a number into a string with the specified format.
138 <p>This string can always be converted back to a number using the same
142 string getInputString
( [in] long nKey
,
143 [in] double fValue
);
147 //=============================================================================