Bump version to 6.4-15
[LibreOffice.git] / include / svl / zforlist.hxx
blob8091c2faea710be38085130dc2b304a2c29ef963
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 INCLUDED_SVL_ZFORLIST_HXX
20 #define INCLUDED_SVL_ZFORLIST_HXX
22 #include <svl/svldllapi.h>
23 #include <rtl/ustrbuf.hxx>
24 #include <rtl/ustring.hxx>
25 #include <o3tl/typed_flags_set.hxx>
26 #include <i18nlangtag/lang.h>
27 #include <com/sun/star/util/NumberFormat.hpp>
28 #include <unotools/localedatawrapper.hxx>
29 #include <tools/link.hxx>
30 #include <svl/ondemand.hxx>
31 #include <svl/nfkeytab.hxx>
33 #include <map>
34 #include <memory>
35 #include <set>
37 namespace com { namespace sun { namespace star { namespace i18n { class XNumberFormatCode; } } } }
38 namespace com { namespace sun { namespace star { namespace i18n { struct Currency; } } } }
39 namespace com { namespace sun { namespace star { namespace i18n { struct NumberFormatCode; } } } }
41 class Date;
42 class Color;
43 class CharClass;
44 class CalendarWrapper;
46 class ImpSvNumberformatScan;
47 class ImpSvNumberInputScan;
48 class SvNumberformat;
50 namespace com { namespace sun { namespace star {
51 namespace uno {
52 class XComponentContext;
54 }}}
56 #define SV_COUNTRY_LANGUAGE_OFFSET 10000 // Max count of formats per country/language
57 #define SV_MAX_COUNT_STANDARD_FORMATS 100 // Max count of builtin default formats per CL
59 constexpr size_t NF_MAX_FORMAT_SYMBOLS = 100;
61 /// The built-in @ Text format, offset within a locale, key in the locale the
62 /// number formatter was constructed with.
63 constexpr sal_uInt32 NF_STANDARD_FORMAT_TEXT = SV_MAX_COUNT_STANDARD_FORMATS;
65 constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND = 0xffffffff; /// MAX_ULONG
67 enum class SvNumFormatType : sal_Int16
69 /** selects all number formats.
71 ALL = css::util::NumberFormat::ALL, // 0
72 /** selects only user-defined number formats.
74 DEFINED = css::util::NumberFormat::DEFINED, // 1
75 /** selects date formats.
77 DATE = css::util::NumberFormat::DATE, // 2
78 /** selects time formats.
80 TIME = css::util::NumberFormat::TIME, // 4
81 /** selects currency formats.
83 CURRENCY = css::util::NumberFormat::CURRENCY, // 8
84 /** selects decimal number formats.
86 NUMBER = css::util::NumberFormat::NUMBER, // 16
87 /** selects scientific number formats.
89 SCIENTIFIC = css::util::NumberFormat::SCIENTIFIC, // 32
90 /** selects number formats for fractions.
92 FRACTION = css::util::NumberFormat::FRACTION, // 64
93 /** selects percentage number formats.
95 PERCENT = css::util::NumberFormat::PERCENT, // 128
96 /** selects text number formats.
98 TEXT = css::util::NumberFormat::TEXT, // 256
99 /** selects number formats which contain date and time.
101 DATETIME = DATE | TIME, // 6
102 /** selects boolean number formats.
104 LOGICAL = css::util::NumberFormat::LOGICAL, // 1024
105 /** is used as a return value if no format exists.
107 UNDEFINED = css::util::NumberFormat::UNDEFINED, // 2048
108 /** @internal is used to flag an empty sub format.
109 @since LibreOffice 5.1
111 EMPTY = css::util::NumberFormat::EMPTY, // 4096
112 /** @internal selects a time duration format.
113 8192 + TIME (4)
114 @since LibreOffice 6.2
116 DURATION = css::util::NumberFormat::DURATION, // 8196
118 namespace o3tl {
119 template<> struct typed_flags<SvNumFormatType> : is_typed_flags<SvNumFormatType, 0x3dff> {};
122 /** enum values for <method>SvNumberFormatter::GetFormatIndex</method>
125 Builtin standard formats, order should be also the arrangement in the
126 dialog list box representation.</p>
129 Date specials:<ul>
130 <li>SYSTEM: As set in System Regional Settings.
131 <li>SYS: short/long defined, order and separators from System Regional Settings.
132 <li>DEF: short/long and order defined, separators from System Regional Settings.
133 <li>DIN: all settings hard coded as DIN (Deutsche Industrie Norm) and EN (European Norm) require.
134 <li>all other: hard coded
135 </ul>
137 Do NOT insert any new values!
138 The values here correspond with those in offapi/com/sun/star/i18n/NumberFormatIndex.idl
139 You may append values though.
141 enum NfIndexTableOffset
143 NF_NUMERIC_START = 0,
145 NF_NUMBER_START = NF_NUMERIC_START,
146 NF_NUMBER_STANDARD = NF_NUMBER_START, // Standard/General
147 NF_NUMBER_INT, // 0
148 NF_NUMBER_DEC2, // 0.00
149 NF_NUMBER_1000INT, // #,##0
150 NF_NUMBER_1000DEC2, // #,##0.00
151 NF_NUMBER_SYSTEM, // #,##0.00 or whatever is set in System Regional Settings
152 NF_NUMBER_END = NF_NUMBER_SYSTEM,
154 NF_SCIENTIFIC_START,
155 NF_SCIENTIFIC_000E000 = NF_SCIENTIFIC_START, // 0.00E+000
156 NF_SCIENTIFIC_000E00, // 0.00E+00
157 NF_SCIENTIFIC_END = NF_SCIENTIFIC_000E00,
159 NF_PERCENT_START,
160 NF_PERCENT_INT = NF_PERCENT_START, // 0%
161 NF_PERCENT_DEC2, // 0.00%
162 NF_PERCENT_END = NF_PERCENT_DEC2,
164 NF_FRACTION_START,
165 NF_FRACTION_1D = NF_FRACTION_START, // # ?/?
166 NF_FRACTION_2D, // # ??/??
167 NF_FRACTION_END = NF_FRACTION_2D,
169 NF_NUMERIC_END = NF_FRACTION_END,
171 NF_CURRENCY_START,
172 NF_CURRENCY_1000INT = NF_CURRENCY_START,// #,##0 DM
173 NF_CURRENCY_1000DEC2, // #,##0.00 DM
174 NF_CURRENCY_1000INT_RED, // #,##0 DM negative in red
175 NF_CURRENCY_1000DEC2_RED, // #,##0.00 DM negative in red
176 NF_CURRENCY_1000DEC2_CCC, // #,##0.00 DEM currency abbreviation
177 NF_CURRENCY_1000DEC2_DASHED, // #,##0.-- DM
178 NF_CURRENCY_END = NF_CURRENCY_1000DEC2_DASHED,
180 NF_DATE_START,
181 NF_DATE_SYSTEM_SHORT = NF_DATE_START, // 08.10.97
182 NF_DATE_SYSTEM_LONG, // Wednesday, 8. October 1997
183 NF_DATE_SYS_DDMMYY, // 08.10.97
184 NF_DATE_SYS_DDMMYYYY, // 08.10.1997 THE edit format, formatindex="21"
185 NF_DATE_SYS_DMMMYY, // 8. Oct 97
186 NF_DATE_SYS_DMMMYYYY, // 8. Oct 1997
187 NF_DATE_DIN_DMMMYYYY, // 8. Oct. 1997 DIN
188 NF_DATE_SYS_DMMMMYYYY, // 8. October 1997
189 NF_DATE_DIN_DMMMMYYYY, // 8. October 1997 DIN
190 NF_DATE_SYS_NNDMMMYY, // Wed, 8. Okt 97
191 NF_DATE_DEF_NNDDMMMYY, // Wed 08.Okt 97
192 NF_DATE_SYS_NNDMMMMYYYY, // Wed, 8. Oktober 1997
193 NF_DATE_SYS_NNNNDMMMMYYYY, // Wednesday, 8. Oktober 1997
194 NF_DATE_DIN_MMDD, // 10-08 DIN
195 NF_DATE_DIN_YYMMDD, // 97-10-08 DIN
196 NF_DATE_DIN_YYYYMMDD, // 1997-10-08 DIN
197 NF_DATE_ISO_YYYYMMDD = NF_DATE_DIN_YYYYMMDD, // 1997-10-08 ISO clarify with name, formatindex="33"
198 NF_DATE_SYS_MMYY, // 10.97
199 NF_DATE_SYS_DDMMM, // 08.Oct
200 NF_DATE_MMMM, // October
201 NF_DATE_QQJJ, // 4. Quarter 97
202 NF_DATE_WW, // week of year
203 NF_DATE_END = NF_DATE_WW,
205 NF_TIME_START,
206 NF_TIME_HHMM = NF_TIME_START, // HH:MM
207 NF_TIME_HHMMSS, // HH:MM:SS
208 NF_TIME_HHMMAMPM, // HH:MM AM/PM
209 NF_TIME_HHMMSSAMPM, // HH:MM:SS AM/PM
210 NF_TIME_HH_MMSS, // [HH]:MM:SS formatindex="43"
211 NF_TIME_MMSS00, // MM:SS,00 formatindex="44"
212 NF_TIME_HH_MMSS00, // [HH]:MM:SS,00 formatindex="45"
213 NF_TIME_END = NF_TIME_HH_MMSS00,
215 NF_DATETIME_START,
216 NF_DATETIME_SYSTEM_SHORT_HHMM = NF_DATETIME_START, // 08.10.97 01:23
217 NF_DATETIME_SYS_DDMMYYYY_HHMMSS, // 08.10.1997 01:23:45 THE edit format, formatindex="47"
218 NF_DATETIME_END = NF_DATETIME_SYS_DDMMYYYY_HHMMSS,
220 NF_BOOLEAN, // BOOLEAN
221 NF_TEXT, // @
223 NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS, // == 50, old number of predefined entries, i18npool locale data additions start after this
225 // From here on are values of new built-in formats that are not in the
226 // original NumberFormatIndex.idl
228 // XXX Values appended here must also get a corresponding entry in
229 // svl/source/numbers/zforlist.cxx indexTable[] in the same order.
231 // XXX The dialog's number format shell assumes start/end spans
232 // (NF_..._START and NF_..._END above) to fill its categories with builtin
233 // formats, make new formats known to svx/source/items/numfmtsh.cxx
234 // SvxNumberFormatShell::FillEListWithStd_Impl(), otherwise they will not
235 // be listed at all. Yes that is ugly.
237 NF_FRACTION_3D = NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS, // # ???/???
238 NF_FRACTION_2, // # ?/2
239 NF_FRACTION_4, // # ?/4
240 NF_FRACTION_8, // # ?/8
241 NF_FRACTION_16, // # ??/16
242 NF_FRACTION_10, // # ??/10
243 NF_FRACTION_100, // # ??/100
245 NF_DATETIME_ISO_YYYYMMDD_HHMMSS, // 1997-10-08 01:23:45 ISO (with blank instead of T)
246 NF_DATETIME_ISO_YYYYMMDDTHHMMSS, // 1997-10-08T01:23:45 ISO
248 // XXX When adding values here, follow the comment above about
249 // svx/source/items/numfmtsh.cxx
251 NF_INDEX_TABLE_ENTRIES // == 59, reserved up to #59 to not be used in i18npool locale data.
253 // XXX Adding values above may increment the reserved area that can't be
254 // used by i18npool's locale data FormatCode definitions, see the
255 // description at i18npool/source/localedata/data/locale.dtd for ELEMENT
256 // FormatCode what the current convention's value is. In that case, the
257 // used formatIndex values in i18npool/source/localedata/data/*.xml will
258 // have to be adjusted.
259 // Overlapping the area will bail out with a check in
260 // SvNumberFormatter::ImpInsertFormat() in debug builds.
264 // #45717# IsNumberFormat( "98-10-24", 30, x ), YMD Format set with DMY
265 // International settings doesn't recognize the string as a date.
266 /** enum values for <method>SvNumberFormatter::SetEvalDateFormat</method>
268 <p>How <method>ImpSvNumberInputScan::GetDateRef</method> shall take the
269 DateFormat order (YMD,DMY,MDY) into account, if called from IsNumberFormat
270 with a date format to match against.
272 enum NfEvalDateFormat
274 /** DateFormat only from International, default. */
275 NF_EVALDATEFORMAT_INTL,
277 /** DateFormat only from date format passed to function (if any).
278 If no date format is passed then the DateFormat is taken from International. */
279 NF_EVALDATEFORMAT_FORMAT,
281 /** First try the DateFormat from International. If it doesn't match a
282 valid date try the DateFormat from the date format passed. */
283 NF_EVALDATEFORMAT_INTL_FORMAT,
285 /** First try the DateFormat from the date format passed. If it doesn't
286 match a valid date try the DateFormat from International. */
287 NF_EVALDATEFORMAT_FORMAT_INTL
291 typedef std::map<sal_uInt32, SvNumberformat*> SvNumberFormatTable;
292 typedef std::map<sal_uInt16, sal_uInt32> SvNumberFormatterIndexTable;
294 typedef ::std::map< sal_uInt32, sal_uInt32> SvNumberFormatterMergeMap;
296 typedef ::std::set< LanguageType > NfInstalledLocales;
299 /** Language/country dependent currency entries
301 class SVL_DLLPUBLIC NfCurrencyEntry
303 OUString aSymbol; /// currency symbol
304 OUString aBankSymbol; /// currency abbreviation
305 LanguageType eLanguage; /// language/country value
306 sal_uInt16 nPositiveFormat; /// position of symbol
307 sal_uInt16 nNegativeFormat; /// position of symbol and type and position of negative sign
308 sal_uInt16 nDigits; /// count of decimal digits
309 sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits
311 NfCurrencyEntry( const NfCurrencyEntry& ) = delete;
312 NfCurrencyEntry& operator=( const NfCurrencyEntry& ) = delete;
314 private:
316 // nDecimalFormat := 0, 1, 2
317 // #,##0 or #,##0.00 or #,##0.-- is returned
318 SVL_DLLPRIVATE OUString Impl_BuildFormatStringNumChars( const LocaleDataWrapper&, sal_uInt16 nDecimalFormat) const;
320 public:
322 NfCurrencyEntry( const LocaleDataWrapper& rLocaleData,
323 LanguageType eLang );
324 NfCurrencyEntry( const css::i18n::Currency & rCurr,
325 const LocaleDataWrapper& rLocaleData,
326 LanguageType eLang );
328 /// Symbols and language identical
329 bool operator==( const NfCurrencyEntry& r ) const;
331 const OUString& GetSymbol() const { return aSymbol; }
332 const OUString& GetBankSymbol() const { return aBankSymbol; }
333 LanguageType GetLanguage() const { return eLanguage; }
334 sal_uInt16 GetPositiveFormat() const { return nPositiveFormat; }
335 sal_uInt16 GetNegativeFormat() const { return nNegativeFormat; }
336 sal_uInt16 GetDigits() const { return nDigits; }
338 /** [$DM-407] (bBank==false) or [$DEM] (bBank==true)
339 is returned. If bBank==false and
340 bWithoutExtension==true only [$DM] */
341 OUString BuildSymbolString(bool bBank, bool bWithoutExtension = false) const;
343 /** #,##0.00 [$DM-407] is returned, separators
344 from rLoc, incl. minus sign but without [RED] */
345 OUString BuildPositiveFormatString(bool bBank, const LocaleDataWrapper&,
346 sal_uInt16 nDecimalFormat = 1) const;
347 OUString BuildNegativeFormatString(bool bBank, const LocaleDataWrapper&,
348 sal_uInt16 nDecimalFormat = 1) const;
350 /** [$DM-407] (or [$DEM] if bBank==true)
351 is appended/prepended to rStr, incl. minus sign */
352 void CompletePositiveFormatString(OUStringBuffer& rStr, bool bBank,
353 sal_uInt16 nPosiFormat) const;
354 void CompleteNegativeFormatString(OUStringBuffer& rStr, bool bBank,
355 sal_uInt16 nNegaFormat) const;
357 /// rSymStr is appended/prepended to rStr, incl. minus sign
358 static void CompletePositiveFormatString(OUStringBuffer& rStr,
359 const OUString& rSymStr, sal_uInt16 nPosiFormat);
360 static void CompleteNegativeFormatString(OUStringBuffer& rStr,
361 const OUString& rSymStr, sal_uInt16 nNegaFormat);
363 /** Representation of a currency (symbol position and
364 negative sign) in other language settings */
365 static sal_uInt16 GetEffectivePositiveFormat( sal_uInt16 nIntlFormat,
366 sal_uInt16 nCurrFormat, bool bBank );
367 static sal_uInt16 GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat,
368 sal_uInt16 nCurrFormat, bool bBank );
370 /// General Unicode Euro symbol
371 static sal_Unicode GetEuroSymbol() { return u'\x20AC'; }
374 typedef std::vector< OUString > NfWSStringsDtor;
376 /** Input options to be used with IsNumberFormat() */
377 enum class SvNumInputOptions : sal_uInt16
379 NONE = 0,
380 LAX_TIME = 1 ///< allow input of minutes or seconds >59
382 namespace o3tl {
383 template<> struct typed_flags<SvNumInputOptions> : is_typed_flags<SvNumInputOptions, 0x0001> {};
386 class SvNumberFormatterRegistry_Impl;
387 class NfCurrencyTable;
389 class SVL_DLLPUBLIC SvNumberFormatter
391 friend class SvNumberFormatterRegistry_Impl;
392 public:
394 * We can't technically have an "infinite" value, so we use an arbitrary
395 * upper precision threshold to represent the "unlimited" precision.
397 static const sal_uInt16 UNLIMITED_PRECISION;
400 * Precision suitable for numbers displayed in input bar, for instance
401 * Calc's formula input bar.
403 static const sal_uInt16 INPUTSTRING_PRECISION;
405 /// Preferred ctor with service manager and language/country enum
406 SvNumberFormatter(
407 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
408 LanguageType eLang
411 ~SvNumberFormatter();
413 /// Set CallBack to ColorTable
414 void SetColorLink( const Link<sal_uInt16,Color*>& rColorTableCallBack );
415 /// Do the CallBack to ColorTable
416 Color* GetUserDefColor(sal_uInt16 nIndex);
418 /// Change language/country, also input and format scanner
419 void ChangeIntl( LanguageType eLnge );
420 /// Change the reference null date
421 void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear);
422 /// Change standard precision
423 void ChangeStandardPrec(short nPrec);
424 /// Set zero value suppression
425 void SetNoZero(bool bNZ);
427 /** The language with which the formatter was initialized (system setting),
428 NOT the current language after a ChangeIntl() */
429 LanguageType GetLanguage() const;
431 // Determine whether two format types are input compatible or not
432 static bool IsCompatible(SvNumFormatType eOldType, SvNumFormatType eNewType);
434 /** Get table of formats of a specific type of a locale. A format FIndex is
435 tested whether it has the type and locale requested, if it doesn't
436 match FIndex returns the default format for the type/locale. If no
437 specific format is to be selected FIndex may be initialized to 0. */
438 SvNumberFormatTable& GetEntryTable(SvNumFormatType eType,
439 sal_uInt32& FIndex,
440 LanguageType eLnge);
442 /** Get table of formats of a specific type of a language/country.
443 FIndex returns the default format of that type.
444 If the language/country was never touched before new entries are generated */
445 SvNumberFormatTable& ChangeCL(SvNumFormatType eType,
446 sal_uInt32& FIndex,
447 LanguageType eLnge);
449 /** Get table of formats of the same type as FIndex; eType and rLnge are
450 set accordingly. An unknown format is set to Standard/General */
451 SvNumberFormatTable& GetFirstEntryTable(SvNumFormatType& eType,
452 sal_uInt32& FIndex,
453 LanguageType& rLnge);
455 /// Delete an entry including the format it is referring to
456 void DeleteEntry(sal_uInt32 nKey);
458 /** Create new entry of a format code string for language/country.
459 @return
460 <TRUE/> if string new and ok and inserted.
461 <FALSE/> if string already exists or an unresolvable parse error
462 occurred, in which case nCheckPos is the error position within rString.
463 If the error occurs at position 0 or rString is empty nCheckPos
464 will be 1, so an error in the string is always indicated by
465 nCheckPos not being zero.
466 The content of the rString variable can be changed and corrected
467 by the method.
468 nType contains the type of the format.
469 nKey contains the index key of the format.
471 bool PutEntry( OUString& rString, sal_Int32& nCheckPos, SvNumFormatType& nType, sal_uInt32& nKey,
472 LanguageType eLnge = LANGUAGE_DONTKNOW );
474 /** Same as <method>PutEntry</method> but the format code string is
475 considered to be of language/country eLnge and is converted to
476 language/country eNewLnge */
477 bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
478 SvNumFormatType& nType, sal_uInt32& nKey,
479 LanguageType eLnge, LanguageType eNewLnge,
480 bool bConvertDateOrder );
482 /** Same as <method>PutandConvertEntry</method> but the format code string
483 is considered to be of the System language/country eLnge and is
484 converted to another System language/country eNewLnge. In this case
485 the automatic currency is converted too. */
486 bool PutandConvertEntrySystem( OUString& rString, sal_Int32& nCheckPos,
487 SvNumFormatType& nType, sal_uInt32& nKey,
488 LanguageType eLnge, LanguageType eNewLnge );
490 /** Similar to <method>PutEntry</method> and
491 <method>PutandConvertEntry</method> or
492 <method>PutandConvertEntrySystem</method>, the format code string
493 passed is considered to be of language/country eLnge. If
494 eLnge==LANGUAGE_SYSTEM the format code has to match eSysLnge, and if
495 eSysLnge is not the current application locale the format code is
496 converted to the current locale. Additionally, if the format code
497 represents an old "automatic" currency format, it is converted to the
498 new default currency format of the eLnge locale. The rString format
499 code passed as an argument may get adapted in case eLnge was used (or
500 is LANGUAGE_SYSTEM and eSysLnge is identical); in case it wasn't the
501 method works on a copy instead, otherwise the resulting string would
502 not match eSysLnge anymore.
504 <p> This method was introduced to handle the legacy currency formats of
505 the "autotbl.fmt" file used by Calc and Writer and convert them to
506 fixed currency codes of the actual currency. Note that in the case of
507 legacy currency formats no special attribution is converted, only the
508 default currency format of the locale is chosen, and that new fixed
509 currency codes are of course not converted to other currencies. The
510 method may also be used as a general method taking, converting and
511 inserting almost arbitrary format codes. To insert or use, for example,
512 the default currency format code matching the current locale, the
513 method could be called with<br/>
515 <code>
516 GetIndexPuttingAndConverting( "0 $", LANGUAGE_SYSTEM, LANGUAGE_ENGLISH_US, ...);
517 </code>
519 @return
520 The index key of the resulting number format. If the format code
521 was empty, could not be converted or has errors, the eLnge locale's
522 standard number format is chosen instead. The index key is
523 guaranteed to represent some valid number format. If
524 rNewInserted==false and rCheckPos>0 the format code has errors
525 and/or could not be converted.
527 sal_uInt32 GetIndexPuttingAndConverting( OUString & rString, LanguageType eLnge,
528 LanguageType eSysLnge, SvNumFormatType & rType,
529 bool & rNewInserted, sal_Int32 & rCheckPos );
531 /** Create a format code string using format nIndex as a template and
532 applying other settings (passed from the dialog) */
533 OUString GenerateFormat(sal_uInt32 nIndex,
534 LanguageType eLnge = LANGUAGE_DONTKNOW,
535 bool bThousand = false, bool IsRed = false,
536 sal_uInt16 nPrecision = 0, sal_uInt16 nLeadingCnt = 1);
538 /** Analyze an input string
539 @return
540 <TRUE/> if input is a number or is matching a format F_Index
541 F_Index is set to a matching format if number, the value is
542 returned in fOutNumber
543 <FALSE/> if input is not a number
545 bool IsNumberFormat( const OUString& sString, sal_uInt32& F_Index, double& fOutNumber,
546 SvNumInputOptions eInputOptions = SvNumInputOptions::NONE );
548 /// Format a number according to a format index, return string and color
549 void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex,
550 OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
552 /** Format a string according to a format index, return string and color.
553 Formats only if the format code is of type text or the 4th subcode
554 of a format code is specified, otherwise sOutString will be == "" */
555 void GetOutputString( const OUString& sString, sal_uInt32 nFIndex,
556 OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
558 /** Format a number according to the standard default format matching
559 the given format index */
560 void GetInputLineString( const double& fOutNumber,
561 sal_uInt32 nFIndex, OUString& rOutString );
563 /** Format a number according to a format code string to be scanned.
564 @return
565 <FALSE/> if format code contains an error
566 <TRUE/> else, in which case the string and color are returned.
568 bool GetPreviewString(const OUString& sFormatString,
569 double fPreviewNumber,
570 OUString& sOutString,
571 Color** ppColor,
572 LanguageType eLnge,
573 bool bUseStarFormat = false );
575 /** Same as <method>GetPreviewString</method> but the format code string
576 may be either language/country eLnge or en_US english US */
577 bool GetPreviewStringGuess( const OUString& sFormatString, double fPreviewNumber,
578 OUString& sOutString, Color** ppColor,
579 LanguageType eLnge = LANGUAGE_DONTKNOW );
581 /** Format a string according to a format code string to be scanned.
582 @return
583 <FALSE/> if format code contains an error
584 <TRUE/> else, in which case the string and color are returned.
586 bool GetPreviewString( const OUString& sFormatString, const OUString& sPreviewString,
587 OUString& sOutString, Color** ppColor,
588 LanguageType eLnge = LANGUAGE_DONTKNOW );
590 /** Test whether the format code string is already present in container
591 @return
592 NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index.
594 sal_uInt32 TestNewString( const OUString& sFormatString,
595 LanguageType eLnge = LANGUAGE_DONTKNOW );
597 /// Whether format index nFIndex is of type text or not
598 bool IsTextFormat(sal_uInt32 nFIndex) const;
600 /// Get additional info of a format index, e.g. for dialog box
601 void GetFormatSpecialInfo(sal_uInt32 nFormat, bool& bThousand, bool& IsRed,
602 sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt);
604 /// Count of decimals
605 sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const;
607 /// Count of integer digits
608 sal_uInt16 GetFormatIntegerDigits( sal_uInt32 nFormat ) const;
610 /** Get additional info of a format code string, e.g. for dialog box.
611 Uses a temporary parse, if possible use only if format code is not
612 present in container yet, otherwise ineffective.
613 @return
614 0 if format code string parsed without errors, otherwise error
615 position (like nCheckPos on <method>PutEntry</method>)
617 sal_uInt32 GetFormatSpecialInfo( const OUString&, bool& bThousand, bool& IsRed,
618 sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt,
619 LanguageType eLnge = LANGUAGE_DONTKNOW );
621 /// Check if format code string may be deleted by user
622 bool IsUserDefined( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
624 /** Return the format index of the format code string for language/country,
625 or NUMBERFORMAT_ENTRY_NOT_FOUND */
626 sal_uInt32 GetEntryKey( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
628 /// Return the format for a format index
629 const SvNumberformat* GetEntry( sal_uInt32 nKey ) const;
631 /// Obtain substituted GetFormatEntry(), i.e. system formats.
632 const SvNumberformat* GetSubstitutedEntry( sal_uInt32 nKey, sal_uInt32 & o_rNewKey ) const;
634 /// Return the format index of the standard default number format for language/country
635 sal_uInt32 GetStandardIndex(LanguageType eLnge = LANGUAGE_DONTKNOW);
637 /// Return the format index of the default format of a type for language/country
638 sal_uInt32 GetStandardFormat(SvNumFormatType eType, LanguageType eLnge = LANGUAGE_DONTKNOW);
640 /** Return the format index of the default format of a type for language/country.
641 Maybe not the default format but a special builtin format, e.g. for
642 NF_TIME_HH_MMSS00, if that format is passed in nFIndex. */
643 sal_uInt32 GetStandardFormat( sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge );
645 /** Return the format index of the default format of a type for language/country.
646 Maybe not the default format but a special builtin format, e.g. for
647 NF_TIME_HH_MMSS00, or NF_TIME_HH_MMSS if fNumber >= 1.0 */
648 sal_uInt32 GetStandardFormat( double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType,
649 LanguageType eLnge );
651 /// Whether nFIndex is a special builtin format
652 bool IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge );
654 /** Return a time format that best matches fNumber. */
655 sal_uInt32 GetTimeFormat( double fNumber, LanguageType eLnge, bool bForceDuration );
657 /** Return a format and type that best matches the value of fNumber if
658 fNumber is assumed to be a date, time or datetime value, but unknown
659 which. Originally introduced for Chart databrowser editor, probably
660 should not be used otherwise. */
661 sal_uInt32 GuessDateTimeFormat( SvNumFormatType& rType, double fNumber, LanguageType eLnge );
663 /** Return the corresponding edit format of a format. */
664 sal_uInt32 GetEditFormat( double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType,
665 LanguageType eLnge, SvNumberformat const * pFormat );
667 /// Return the reference date
668 const Date& GetNullDate() const;
669 /// Return the standard decimal precision
670 sal_uInt16 GetStandardPrec() const;
671 /// Return whether zero suppression is switched on
672 bool GetNoZero() const;
673 /** Get the type of a format (or css::util::NumberFormat::UNDEFINED if no entry),
674 but with css::util::NumberFormat::DEFINED masked out */
675 SvNumFormatType GetType(sal_uInt32 nFIndex) const;
677 /// As the name says
678 void ClearMergeTable();
679 /// Merge in all new entries from rNewTable and return a table of resulting new format indices
680 SvNumberFormatterIndexTable* MergeFormatter(SvNumberFormatter& rNewTable);
682 /// Whether a merge table is present or not
683 bool HasMergeFormatTable() const;
684 /// Return the new format index for an old format index, if a merge table exists
685 sal_uInt32 GetMergeFormatIndex( sal_uInt32 nOldFmt ) const;
687 /** Convert the ugly old tools' Table type bloated with new'ed sal_uInt32
688 entries merge table to ::std::map with old index key and new index key.
689 @ATTENTION! Also clears the old table using ClearMergeTable() */
690 SvNumberFormatterMergeMap ConvertMergeTableToMap();
692 /** Return the format index of a builtin format for a specific language/country.
693 If nFormat is not a builtin format nFormat is returned. */
694 sal_uInt32 GetFormatForLanguageIfBuiltIn( sal_uInt32 nFormat,
695 LanguageType eLnge = LANGUAGE_DONTKNOW );
697 /** Return the format index for a builtin format of a specific language
698 @see NfIndexTableOffset
700 sal_uInt32 GetFormatIndex( NfIndexTableOffset, LanguageType eLnge = LANGUAGE_DONTKNOW );
702 /** Return enum index of a format index of a builtin format,
703 NF_INDEX_TABLE_ENTRIES if it's not a builtin format.
704 @see NfIndexTableOffset
706 NfIndexTableOffset GetIndexTableOffset( sal_uInt32 nFormat ) const;
708 /** Set evaluation type and order of input date strings
709 @see NfEvalDateFormat
711 void SetEvalDateFormat( NfEvalDateFormat eEDF );
712 NfEvalDateFormat GetEvalDateFormat() const;
714 /** Set TwoDigitYearStart, how the input string scanner handles a two digit year.
715 Default from VCL: 1930, 30-99 19xx, 00-29 20xx
717 <p> Historically (prior to src513e) it was a two digit number determining
718 until which number the string scanner recognizes a year to be 20xx,
719 default <= 29 is used by SFX/OfaMiscCfg.
720 The name Year2000 is kept although the actual functionality is now a
721 TwoDigitYearStart which might be in any century.
723 void SetYear2000( sal_uInt16 nVal );
724 sal_uInt16 GetYear2000() const;
725 static sal_uInt16 GetYear2000Default();
727 sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear ) const;
728 static sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart );
730 /// Return the decimal separator matching the locale of the given format
731 OUString GetFormatDecimalSep( sal_uInt32 nFormat ) const;
733 /// Return the decimal separator matching the given locale / LanguageType.
734 OUString GetLangDecimalSep( LanguageType nLang ) const;
736 static void resetTheCurrencyTable();
738 /// Return a NfCurrencyTable with pointers to <type>NfCurrencyEntry</type> entries
739 static const NfCurrencyTable& GetTheCurrencyTable();
741 /** Searches, according to the default locale currency, an entry of the
742 CurrencyTable which is <bold>not</bold> the first (LANGUAGE_SYSTEM) entry.
743 @return
744 <NULL/> if not found
745 else pointer to NfCurrencyEntry
747 static const NfCurrencyEntry* MatchSystemCurrency();
749 /** Return a NfCurrencyEntry matching a language/country.
750 If language/country is LANGUAGE_SYSTEM a <method>MatchSystemCurrency</method>
751 call is tried to get an entry. If that fails or the corresponding
752 language/country is not present the entry for LANGUAGE_SYSTEM is returned.
754 static const NfCurrencyEntry& GetCurrencyEntry( LanguageType );
756 /** Return a NfCurrencyEntry pointer matching a language/country
757 and currency abbreviation (AKA banking symbol).
758 This method is meant for the configuration of the default currency.
759 @return
760 <NULL/> if not found
761 else pointer to NfCurrencyEntry
763 static const NfCurrencyEntry* GetCurrencyEntry( const OUString& rAbbrev,
764 LanguageType eLang );
766 /** Return a NfCurrencyEntry pointer matching the symbol
767 combination of a LegacyOnly currency. Note that this means only that
768 the currency matching both symbols was once used in the Office, but is
769 not offered in dialogs anymore. It doesn't even mean that the currency
770 symbol combination is valid, since the reason for removing it may have
771 been just that. #i61657#
772 @return
773 A matching entry, or else <NULL/>.
775 static const NfCurrencyEntry* GetLegacyOnlyCurrencyEntry( const OUString& rSymbol, const OUString& rAbbrev );
777 /** Set the default system currency. The combination of abbreviation and
778 language must match an existent element of theCurrencyTable. If not,
779 the SYSTEM (current locale) entry becomes the default.
780 This method is meant for the configuration of the default currency.
782 static void SetDefaultSystemCurrency( const OUString& rAbbrev, LanguageType eLang );
784 /** Get all standard formats for a specific currency, formats are
785 appended to the NfWSStringsDtor list.
786 @param bBank
787 <TRUE/>: generate only format strings with currency abbreviation
788 <FALSE/>: mixed format strings
789 @return
790 position of default format
792 sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&,
793 bool bBank ) const;
795 /** Whether nFormat is of type css::util::NumberFormat::CURRENCY and the format code
796 contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn].
797 If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is
798 returned, even if the format code only contains [$xxx] !
800 bool GetNewCurrencySymbolString( sal_uInt32 nFormat, OUString& rSymbol,
801 const NfCurrencyEntry** ppEntry,
802 bool* pBank = nullptr ) const;
804 /** Look up the corresponding NfCurrencyEntry matching
805 rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly
806 a rExtension (being yyy of [$xxx-yyy]) or a given language/country
807 value. Tries to match a rSymbol with rExtension first, then with
808 eFormatLanguage, then rSymbol only. This is because a currency entry
809 might have been constructed using I18N locale data where a used locale
810 of a currency format code must not necessarily match the locale of
811 the locale data itself, e.g. [$HK$-40C] (being "zh_HK" locale) in
812 zh_CN locale data. Here the rExtension would have the value 0x40c but
813 eFormatLanguage of the number format would have the value of zh_CN
814 locale, the value with which the corresponding CurrencyEntry is
815 constructed.
817 @param bFoundBank
818 Only used for output.
819 If the return value is not <NULL/> this value is set to <TRUE/> if
820 the matching entry was found by comparing rSymbol against the
821 CurrencyAbbreviation (AKA BankSymbol).
822 If the return value is <NULL/> the value of bFoundBank is undefined.
823 @param rSymbol
824 Currency symbol, preferably obtained of a format by a call to
825 <method>SvNumberformat::GetNewCurrencySymbol()</method>
826 @param rExtension
827 Currency extension, preferably obtained of a format by a call to
828 <method>SvNumberformat::GetNewCurrencySymbol()</method>
829 @param eFormatLanguage
830 The language/country value of the format of which rSymbol and
831 rExtension are obtained (<method>SvNumberformat::GetLanguage()</method>).
832 @param bOnlyStringLanguage
833 If <TRUE/> only entries with language/country of rExtension are
834 checked, no match on eFormatLanguage. If rExtension is empty all
835 entries are checked.
836 @return
837 The matching entry if unique (in which case bFoundBank is set),
838 else <NULL/>.
840 static const NfCurrencyEntry* GetCurrencyEntry( bool & bFoundBank,
841 const OUString& rSymbol,
842 const OUString& rExtension,
843 LanguageType eFormatLanguage,
844 bool bOnlyStringLanguage = false );
846 /// Get compatibility ("automatic" old style) currency from I18N locale data
847 void GetCompatibilityCurrency( OUString& rSymbol, OUString& rAbbrev ) const;
849 /// Fill rList with the language/country codes that have been allocated
850 void GetUsedLanguages( std::vector<LanguageType>& rList );
852 /// Fill a NfKeywordIndex table with keywords of a language/country
853 void FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang );
855 /** Fill a NfKeywordIndex table with keywords usable in Excel export with
856 GetFormatStringForExcel() or SvNumberformat::GetMappedFormatstring() */
857 void FillKeywordTableForExcel( NfKeywordTable& rKeywords );
859 /** Return a format code string suitable for Excel export.
861 @param rTempFormatter
862 SvNumberFormatter to use if a non-en-US format code needs to be
863 converted and put, should not be the same formatter to not
864 pollute the entries of this one here.
866 OUString GetFormatStringForExcel( sal_uInt32 nKey, const NfKeywordTable& rKeywords,
867 SvNumberFormatter& rTempFormatter ) const;
869 /** Return a keyword for a language/country and NfKeywordIndex
870 for XML import, to generate number format strings. */
871 OUString GetKeyword( LanguageType eLnge, sal_uInt16 nIndex );
873 /** Return the GENERAL keyword in proper case ("General") for a
874 language/country, used in XML import */
875 OUString GetStandardName( LanguageType eLnge );
877 /** Check if a specific locale has supported locale data. */
878 static bool IsLocaleInstalled( LanguageType eLang );
880 /** Obtain NfKeywordTable used with a format, possibly localized.
882 XXX NOTE: the content (actual keywords) is only valid as long as the
883 locale context of the associated ImpSvNumberformatScan instance does
884 not change to a locale with different keywords, which may happen
885 anytime with a call (implicit or explicit) to
886 SvNumberFormatter::ChangeIntl(). If needed longer, copy-create another
887 NfKeywordTable instance or copy individual elements.
889 If the format specified with nKey does not exist, the content of the
890 NfKeywordTable matches the locale with which the SvNumberFormatter
891 instance was created and initialized.
893 This function preliminary exists for unit tests and otherwise is
894 pretty much useless.
896 const NfKeywordTable & GetKeywords( sal_uInt32 nKey );
898 /** Access for unit tests. */
899 const NfKeywordTable & GetEnglishKeywords() const;
901 /** Access for unit tests. */
902 const std::vector<Color> & GetStandardColors() const;
904 /** Access for unit tests. */
905 size_t GetMaxDefaultColors() const;
907 struct InputScannerPrivateAccess { friend class ImpSvNumberInputScan; private: InputScannerPrivateAccess() {} };
908 /** Access for input scanner to temporarily (!) switch locales. */
909 OnDemandLocaleDataWrapper& GetOnDemandLocaleDataWrapper( const InputScannerPrivateAccess& ) { return xLocaleData; }
911 private:
912 mutable ::osl::Mutex m_aMutex;
913 css::uno::Reference< css::uno::XComponentContext > m_xContext;
914 LanguageTag maLanguageTag;
915 std::map<sal_uInt32, std::unique_ptr<SvNumberformat>> aFTable; // Table of format keys to format entries
916 typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
917 DefaultFormatKeysMap aDefaultFormatKeys; // Table of default standard to format keys
918 std::unique_ptr<SvNumberFormatTable> pFormatTable; // For the UI dialog
919 std::unique_ptr<SvNumberFormatterIndexTable> pMergeTable; // List of indices for merging two formatters
920 std::unique_ptr<CharClass> pCharClass; // CharacterClassification
921 OnDemandLocaleDataWrapper xLocaleData; // LocaleData switched between SYSTEM, ENGLISH and other
922 OnDemandTransliterationWrapper xTransliteration; // Transliteration loaded on demand
923 OnDemandCalendarWrapper xCalendar; // Calendar loaded on demand
924 OnDemandNativeNumberWrapper xNatNum; // Native number service loaded on demand
925 std::unique_ptr<ImpSvNumberInputScan> pStringScanner; // Input string scanner
926 std::unique_ptr<ImpSvNumberformatScan> pFormatScanner; // Format code string scanner
927 Link<sal_uInt16,Color*> aColorLink; // User defined color table CallBack
928 sal_uInt32 MaxCLOffset; // Max language/country offset used
929 sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale
930 LanguageType IniLnge; // Initialized setting language/country
931 LanguageType ActLnge; // Current setting language/country
932 NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation
933 bool bNoZero; // Zero value suppression
935 // cached locale data items needed almost any time
936 OUString aDecimalSep;
937 OUString aDecimalSepAlt;
938 OUString aThousandSep;
939 OUString aDateSep;
941 SVL_DLLPRIVATE static volatile bool bCurrencyTableInitialized;
942 SVL_DLLPRIVATE static sal_uInt16 nSystemCurrencyPosition;
943 SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry;
945 // get the registry, create one if none exists
946 SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl& GetFormatterRegistry();
948 // called by ctors
949 SVL_DLLPRIVATE void ImpConstruct( LanguageType eLang );
951 // Generate builtin formats provided by i18n behind CLOffset,
952 // if bNoAdditionalFormats==false also generate additional i18n formats.
953 SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditionalFormats );
955 // Generate additional formats provided by i18n
956 SVL_DLLPRIVATE void ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
957 css::uno::Reference< css::i18n::XNumberFormatCode > const & rNumberFormatCode,
958 bool bAfterChangingSystemCL );
960 SVL_DLLPRIVATE SvNumberformat* ImpInsertFormat( const css::i18n::NumberFormatCode& rCode,
961 sal_uInt32 nPos,
962 bool bAfterChangingSystemCL = false,
963 sal_Int16 nOrgIndex = 0 );
965 // Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country
966 SVL_DLLPRIVATE sal_uInt32 ImpGetCLOffset(LanguageType eLnge) const;
968 // Test whether format code already exists, then return index key,
969 // otherwise NUMBERFORMAT_ENTRY_NOT_FOUND
970 SVL_DLLPRIVATE sal_uInt32 ImpIsEntry( const OUString& rString,
971 sal_uInt32 CLOffset,
972 LanguageType eLnge );
974 // Create builtin formats for language/country if necessary, return CLOffset
975 SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge );
977 // Create theCurrencyTable with all <type>NfCurrencyEntry</type>
978 SVL_DLLPRIVATE static void ImpInitCurrencyTable();
980 // Return the format index of the currency format of the system locale.
981 // Format is created if not already present.
982 SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultSystemCurrencyFormat();
984 // Return the format index of the currency format of the current locale.
985 // Format is created if not already present.
986 SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultCurrencyFormat();
988 // Return the default format for a given type and current locale.
989 // May ONLY be called from within GetStandardFormat().
990 SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultFormat( SvNumFormatType nType );
992 // Return the index in a sequence of format codes matching an enum of
993 // NfIndexTableOffset. If not found 0 is returned. If the sequence doesn't
994 // contain any format code elements a default element is created and inserted.
995 SVL_DLLPRIVATE sal_Int32 ImpGetFormatCodeIndex( css::uno::Sequence< css::i18n::NumberFormatCode >& rSeq,
996 const NfIndexTableOffset nTabOff );
998 // Adjust a sequence of format codes to contain only one (THE) default
999 // instead of multiple defaults for short/medium/long types.
1000 // If there is no medium but a short and a long default the long is taken.
1001 // Non-PRODUCT version may check locale data for matching defaults in one
1002 // FormatElement group.
1003 SVL_DLLPRIVATE void ImpAdjustFormatCodeDefault( css::i18n::NumberFormatCode * pFormatArr,
1004 sal_Int32 nCount );
1006 // Obtain the format entry for a given key index.
1007 SVL_DLLPRIVATE SvNumberformat* GetFormatEntry( sal_uInt32 nKey );
1008 SVL_DLLPRIVATE const SvNumberformat* GetFormatEntry( sal_uInt32 nKey ) const;
1010 // used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry()
1011 static bool ImpLookupCurrencyEntryLoopBody(
1012 const NfCurrencyEntry*& pFoundEntry, bool& bFoundBank, const NfCurrencyEntry* pData,
1013 sal_uInt16 nPos, const OUString& rSymbol );
1015 // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method>
1016 DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, LinkParamNone*, void );
1018 // return position of a special character
1019 sal_Int32 ImpPosToken ( const OUStringBuffer & sFormat, sal_Unicode token, sal_Int32 nStartPos = 0 ) const;
1021 // Substitute a format during GetFormatEntry(), i.e. system formats.
1022 SvNumberformat* ImpSubstituteEntry( SvNumberformat* pFormat, sal_uInt32 * o_pRealKey = nullptr );
1024 // own mutex, may also be used by internal class SvNumberFormatterRegistry_Impl
1025 static ::osl::Mutex& GetGlobalMutex();
1026 ::osl::Mutex& GetInstanceMutex() const { return m_aMutex; }
1028 public:
1030 // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes
1031 void ResetDefaultSystemCurrency();
1033 // Called by SvNumberFormatterRegistry_Impl::Notify if the system locale's
1034 // date acceptance patterns change.
1035 void InvalidateDateAcceptancePatterns();
1037 // Replace the SYSTEM language/country format codes. Called upon change of
1038 // the user configurable locale.
1039 // Old compatibility codes are replaced, user defined are converted, and
1040 // new format codes are appended.
1041 void ReplaceSystemCL( LanguageType eOldLanguage );
1043 const css::uno::Reference<css::uno::XComponentContext>& GetComponentContext() const;
1045 //! The following method is not to be used from outside but must be
1046 //! public for the InputScanner.
1047 // return the current FormatScanner
1048 const ImpSvNumberformatScan* GetFormatScanner() const;
1050 //! The following methods are not to be used from outside but must be
1051 //! public for the InputScanner and FormatScanner.
1053 // return current (!) Locale
1054 const LanguageTag& GetLanguageTag() const;
1056 // return corresponding Transliteration wrapper
1057 const ::utl::TransliterationWrapper* GetTransliteration() const;
1059 // return the corresponding CharacterClassification wrapper
1060 const CharClass* GetCharClass() const;
1062 // return the corresponding LocaleData wrapper
1063 const LocaleDataWrapper* GetLocaleData() const;
1065 // return the corresponding Calendar wrapper
1066 CalendarWrapper* GetCalendar() const;
1068 // return the corresponding NativeNumberSupplier wrapper
1069 const NativeNumberWrapper* GetNatNum() const;
1071 // cached locale data items
1073 // return the corresponding decimal separator
1074 const OUString& GetNumDecimalSep() const;
1076 // return the corresponding decimal separator alternative
1077 const OUString& GetNumDecimalSepAlt() const;
1079 // return the corresponding group (AKA thousand) separator
1080 const OUString& GetNumThousandSep() const;
1082 // return the corresponding date separator
1083 const OUString& GetDateSep() const;
1085 // checks for decimal separator and optional alternative
1086 bool IsDecimalSep( const OUString& rStr ) const;
1089 #endif // INCLUDED_SVL_ZFORLIST_HXX
1091 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */