merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / util / XNumberFormatter.idl
blobf01f1b30bf737ea0d8bc297a5ffdbb9bfa93fabe
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_util_XNumberFormatter_idl__
28 #define __com_sun_star_util_XNumberFormatter_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include <com/sun/star/uno/XInterface.idl>
32 #endif
34 #ifndef __com_sun_star_util_Color_idl__
35 #include <com/sun/star/util/Color.idl>
36 #endif
38 #ifndef __com_sun_star_util_XNumberFormatsSupplier_idl__
39 #include <com/sun/star/util/XNumberFormatsSupplier.idl>
40 #endif
42 #ifndef __com_sun_star_util_NotNumericException_idl__
43 #include <com/sun/star/util/NotNumericException.idl>
44 #endif
46 #ifndef __com_sun_star_util_Color_idl__
47 #include <com/sun/star/util/Color.idl>
48 #endif
51 //=============================================================================
53 module com { module sun { module star { module util {
55 //=============================================================================
57 /** represents a number formatter.
59 published interface XNumberFormatter: com::sun::star::uno::XInterface
61 //-------------------------------------------------------------------------
63 /** attaches an <type>XNumberFormatsSupplier</type> to this
64 <type>NumberFormatter</type>.
66 <p>This <type>NumberFormatter</type> will only use the <type>NumberFormats</type>
67 specified in the attached <type>XNumberFormatsSupplier</type>. Without an attached
68 <type>XNumberFormatsSupplier</type>, no formatting is possible.</p>
70 void attachNumberFormatsSupplier( [in] com::sun::star::util::XNumberFormatsSupplier xSupplier );
72 //-------------------------------------------------------------------------
74 /** @returns
75 the attached <type>XNumberFormatsSupplier</type>.
77 com::sun::star::util::XNumberFormatsSupplier getNumberFormatsSupplier();
79 //-------------------------------------------------------------------------
81 /** detects the number format in a string which contains a formatted number.
83 long detectNumberFormat( [in] long nKey,
84 [in] string aString )
85 raises( com::sun::star::util::NotNumericException );
87 //-------------------------------------------------------------------------
89 /** converts a string which contains a formatted number into a number.
91 <p>If this is a text format, the string will not be converted.</p>
93 double convertStringToNumber( [in] long nKey,
94 [in] string aString )
95 raises( com::sun::star::util::NotNumericException );
97 //-------------------------------------------------------------------------
99 /** converts a number into a string.
101 string convertNumberToString( [in] long nKey,
102 [in] double fValue );
104 //-------------------------------------------------------------------------
106 /** @returns
107 the color which is specified for the given value in the number format,
108 which is otherwise the value of <var>aDefaultColor</var>.
110 com::sun::star::util::Color queryColorForNumber( [in] long nKey,
111 [in] double fValue,
112 [in] com::sun::star::util::Color aDefaultColor );
114 //-------------------------------------------------------------------------
116 /** converts a string into another string.
118 string formatString( [in] long nKey,
119 [in] string aString );
121 //-------------------------------------------------------------------------
123 /** @returns
124 the color which is specified for the given string in the number format,
125 which is otherwise the value of <var>aDefaultColor</var>.
127 com::sun::star::util::Color queryColorForString( [in] long nKey,
128 [in] string aString,
129 [in] com::sun::star::util::Color aDefaultColor );
131 //-------------------------------------------------------------------------
133 /** converts a number into a string with the specified format.
135 <p>This string can always be converted back to a number using the same
136 format.
137 </p>
139 string getInputString( [in] long nKey,
140 [in] double fValue );
144 //=============================================================================
146 }; }; }; };
148 #endif