1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_util_XNumberFormatPreviewer_idl__ 24#define __com_sun_star_util_XNumberFormatPreviewer_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29 30#ifndef __com_sun_star_util_Color_idl__ 31#include <com/sun/star/util/Color.idl> 32#endif 33 34#ifndef __com_sun_star_lang_Locale_idl__ 35#include <com/sun/star/lang/Locale.idl> 36#endif 37 38#ifndef __com_sun_star_util_MalformedNumberFormatException_idl__ 39#include <com/sun/star/util/MalformedNumberFormatException.idl> 40#endif 41 42#ifndef __com_sun_star_util_Color_idl__ 43#include <com/sun/star/util/Color.idl> 44#endif 45 46 47//============================================================================= 48 49 module com { module sun { module star { module util { 50 51//============================================================================= 52 53/** represents a number formatter which can preview number 54 formats without inserting them. 55 56 @see NumberFormatter 57 */ 58published interface XNumberFormatPreviewer: com::sun::star::uno::XInterface 59{ 60 //------------------------------------------------------------------------- 61 62 /** formats a value using a format string, without inserting a 63 number format into the list. 64 65 @param aFormat 66 is the format string that is used for formatting. 67 68 @param fValue 69 is the value that is formatted. 70 71 @param nLocale 72 is the locale that is used to interpret the format string. 73 74 @param bAllowEnglish 75 specifies if English language number format strings are accepted 76 in addition to those from the selected locale. 77 78 @returns 79 the formatted string. 80 81 @throws com::sun::star::util::MalformedNumberFormatException 82 if the format string is invalid. 83 84 */ 85 string convertNumberToPreviewString( [in] string aFormat, 86 [in] double fValue, 87 [in] com::sun::star::lang::Locale nLocale, 88 [in] boolean bAllowEnglish ) 89 raises( com::sun::star::util::MalformedNumberFormatException ); 90 91 //------------------------------------------------------------------------- 92 93 /** returns the color which is to be used for a number. 94 95 @param aFormat 96 is the format string that is used for formatting. 97 98 @param fValue 99 is the value that is formatted. 100 101 @param nLocale 102 is the locale that is used to interpret the format string. 103 104 @param bAllowEnglish 105 specifies if English language number format strings are accepted 106 in addition to those from the selected locale. 107 108 @param aDefaultColor 109 is the color that should be returned if no color is set by 110 the number format. 111 112 @returns 113 the color that should used to output the formatted string. 114 115 @throws com::sun::star::util::MalformedNumberFormatException 116 if the format string is invalid. 117 118 */ 119 com::sun::star::util::Color queryPreviewColorForNumber( [in] string aFormat, 120 [in] double fValue, 121 [in] com::sun::star::lang::Locale nLocale, 122 [in] boolean bAllowEnglish, 123 [in] com::sun::star::util::Color aDefaultColor ) 124 raises( com::sun::star::util::MalformedNumberFormatException ); 125 126}; 127 128//============================================================================= 129 130}; }; }; }; 131 132#endif 133 134