update dev300-m58
[ooovba.git] / offapi / com / sun / star / util / XNumberFormatter.idl
blob76a4414642816a3ceb2b644b0cc59c2669bb6c50
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XNumberFormatter.idl,v $
10 * $Revision: 1.11 $
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>
35 #endif
37 #ifndef __com_sun_star_util_Color_idl__
38 #include <com/sun/star/util/Color.idl>
39 #endif
41 #ifndef __com_sun_star_util_XNumberFormatsSupplier_idl__
42 #include <com/sun/star/util/XNumberFormatsSupplier.idl>
43 #endif
45 #ifndef __com_sun_star_util_NotNumericException_idl__
46 #include <com/sun/star/util/NotNumericException.idl>
47 #endif
49 #ifndef __com_sun_star_util_Color_idl__
50 #include <com/sun/star/util/Color.idl>
51 #endif
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 //-------------------------------------------------------------------------
77 /** @returns
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,
87 [in] string aString )
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,
97 [in] string aString )
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 //-------------------------------------------------------------------------
109 /** @returns
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,
114 [in] double fValue,
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 //-------------------------------------------------------------------------
126 /** @returns
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,
131 [in] string aString,
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
139 format.
140 </p>
142 string getInputString( [in] long nKey,
143 [in] double fValue );
147 //=============================================================================
149 }; }; }; };
151 #endif