Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / util / XNumberFormatter.idl
blobdd32f4862e3f29f8b60e9498712f6d44ef8234ac
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 .
19 #ifndef __com_sun_star_util_XNumberFormatter_idl__
20 #define __com_sun_star_util_XNumberFormatter_idl__
22 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/util/Color.idl>
25 #include <com/sun/star/util/XNumberFormatsSupplier.idl>
27 #include <com/sun/star/util/NotNumericException.idl>
31 module com { module sun { module star { module util {
34 /** represents a number formatter.
36 published interface XNumberFormatter: com::sun::star::uno::XInterface
39 /** attaches an XNumberFormatsSupplier to this
40 NumberFormatter.
42 <p>This NumberFormatter will only use the NumberFormats
43 specified in the attached XNumberFormatsSupplier. Without an attached
44 XNumberFormatsSupplier, no formatting is possible.</p>
46 void attachNumberFormatsSupplier( [in] com::sun::star::util::XNumberFormatsSupplier xSupplier );
49 /** @returns
50 the attached XNumberFormatsSupplier.
52 com::sun::star::util::XNumberFormatsSupplier getNumberFormatsSupplier();
55 /** detects the number format in a string which contains a formatted number.
57 long detectNumberFormat( [in] long nKey,
58 [in] string aString )
59 raises( com::sun::star::util::NotNumericException );
62 /** converts a string which contains a formatted number into a number.
64 <p>If this is a text format, the string will not be converted.</p>
66 double convertStringToNumber( [in] long nKey,
67 [in] string aString )
68 raises( com::sun::star::util::NotNumericException );
71 /** converts a number into a string.
73 string convertNumberToString( [in] long nKey,
74 [in] double fValue );
77 /** @returns
78 the color which is specified for the given value in the number format,
79 which is otherwise the value of <var>aDefaultColor</var>.
81 com::sun::star::util::Color queryColorForNumber( [in] long nKey,
82 [in] double fValue,
83 [in] com::sun::star::util::Color aDefaultColor );
86 /** converts a string into another string.
88 string formatString( [in] long nKey,
89 [in] string aString );
92 /** @returns
93 the color which is specified for the given string in the number format,
94 which is otherwise the value of <var>aDefaultColor</var>.
96 com::sun::star::util::Color queryColorForString( [in] long nKey,
97 [in] string aString,
98 [in] com::sun::star::util::Color aDefaultColor );
101 /** converts a number into a string with the specified format.
103 <p>This string can always be converted back to a number using the same
104 format.
105 </p>
107 string getInputString( [in] long nKey,
108 [in] double fValue );
113 }; }; }; };
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */