Get the style color and number just once
[LibreOffice.git] / offapi / com / sun / star / util / XNumberFormatter.idl
blobe6f9b517843d55f01a2cc1a9fef9b1edee5da59d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 module com { module sun { module star { module util {
25 /** represents a number formatter.
27 published interface XNumberFormatter: com::sun::star::uno::XInterface
30 /** attaches an XNumberFormatsSupplier to this
31 NumberFormatter.
33 <p>This NumberFormatter will only use the NumberFormats
34 specified in the attached XNumberFormatsSupplier. Without an attached
35 XNumberFormatsSupplier, no formatting is possible.</p>
37 void attachNumberFormatsSupplier( [in] com::sun::star::util::XNumberFormatsSupplier xSupplier );
40 /** @returns
41 the attached XNumberFormatsSupplier.
43 com::sun::star::util::XNumberFormatsSupplier getNumberFormatsSupplier();
46 /** detects the number format in a string which contains a formatted number.
48 long detectNumberFormat( [in] long nKey,
49 [in] string aString )
50 raises( com::sun::star::util::NotNumericException );
53 /** converts a string which contains a formatted number into a number.
55 <p>If this is a text format, the string will not be converted.</p>
57 double convertStringToNumber( [in] long nKey,
58 [in] string aString )
59 raises( com::sun::star::util::NotNumericException );
62 /** converts a number into a string.
64 string convertNumberToString( [in] long nKey,
65 [in] double fValue );
68 /** @returns
69 the color which is specified for the given value in the number format,
70 which is otherwise the value of <var>aDefaultColor</var>.
72 com::sun::star::util::Color queryColorForNumber( [in] long nKey,
73 [in] double fValue,
74 [in] com::sun::star::util::Color aDefaultColor );
77 /** converts a string into another string.
79 string formatString( [in] long nKey,
80 [in] string aString );
83 /** @returns
84 the color which is specified for the given string in the number format,
85 which is otherwise the value of <var>aDefaultColor</var>.
87 com::sun::star::util::Color queryColorForString( [in] long nKey,
88 [in] string aString,
89 [in] com::sun::star::util::Color aDefaultColor );
92 /** converts a number into a string with the specified format.
94 <p>This string can always be converted back to a number using the same
95 format.
96 </p>
98 string getInputString( [in] long nKey,
99 [in] double fValue );
104 }; }; }; };
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */