bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / svl / zforlist.hxx
blob032809b8f82ecbec8789b53291f0bcc12f5dff82
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)
247 // XXX When adding values here, follow the comment above about
248 // svx/source/items/numfmtsh.cxx
250 NF_INDEX_TABLE_ENTRIES // == 58, reserved up to #59 to not be used in i18npool locale data.
252 // XXX Adding values above may increment the reserved area that can't be
253 // used by i18npool's locale data FormatCode definitions, see the
254 // description at i18npool/source/localedata/data/locale.dtd for ELEMENT
255 // FormatCode what the current convention's value is. In that case, the
256 // used formatIndex values in i18npool/source/localedata/data/*.xml will
257 // have to be adjusted.
258 // Overlapping the area will bail out with a check in
259 // SvNumberFormatter::ImpInsertFormat() in debug builds.
263 // #45717# IsNumberFormat( "98-10-24", 30, x ), YMD Format set with DMY
264 // International settings doesn't recognize the string as a date.
265 /** enum values for <method>SvNumberFormatter::SetEvalDateFormat</method>
267 <p>How <method>ImpSvNumberInputScan::GetDateRef</method> shall take the
268 DateFormat order (YMD,DMY,MDY) into account, if called from IsNumberFormat
269 with a date format to match against.
271 enum NfEvalDateFormat
273 /** DateFormat only from International, default. */
274 NF_EVALDATEFORMAT_INTL,
276 /** DateFormat only from date format passed to function (if any).
277 If no date format is passed then the DateFormat is taken from International. */
278 NF_EVALDATEFORMAT_FORMAT,
280 /** First try the DateFormat from International. If it doesn't match a
281 valid date try the DateFormat from the date format passed. */
282 NF_EVALDATEFORMAT_INTL_FORMAT,
284 /** First try the DateFormat from the date format passed. If it doesn't
285 match a valid date try the DateFormat from International. */
286 NF_EVALDATEFORMAT_FORMAT_INTL
290 typedef std::map<sal_uInt32, SvNumberformat*> SvNumberFormatTable;
291 typedef std::map<sal_uInt16, sal_uInt32> SvNumberFormatterIndexTable;
293 typedef ::std::map< sal_uInt32, sal_uInt32> SvNumberFormatterMergeMap;
295 typedef ::std::set< LanguageType > NfInstalledLocales;
298 /** Language/country dependent currency entries
300 class SVL_DLLPUBLIC NfCurrencyEntry
302 OUString aSymbol; /// currency symbol
303 OUString aBankSymbol; /// currency abbreviation
304 LanguageType eLanguage; /// language/country value
305 sal_uInt16 nPositiveFormat; /// position of symbol
306 sal_uInt16 nNegativeFormat; /// position of symbol and type and position of negative sign
307 sal_uInt16 nDigits; /// count of decimal digits
308 sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits
310 NfCurrencyEntry( const NfCurrencyEntry& ) = delete;
311 NfCurrencyEntry& operator=( const NfCurrencyEntry& ) = delete;
313 private:
315 // nDecimalFormat := 0, 1, 2
316 // #,##0 or #,##0.00 or #,##0.-- is returned
317 SVL_DLLPRIVATE OUString Impl_BuildFormatStringNumChars( const LocaleDataWrapper&, sal_uInt16 nDecimalFormat) const;
319 public:
321 NfCurrencyEntry( const LocaleDataWrapper& rLocaleData,
322 LanguageType eLang );
323 NfCurrencyEntry( const css::i18n::Currency & rCurr,
324 const LocaleDataWrapper& rLocaleData,
325 LanguageType eLang );
327 /// Symbols and language identical
328 bool operator==( const NfCurrencyEntry& r ) const;
330 const OUString& GetSymbol() const { return aSymbol; }
331 const OUString& GetBankSymbol() const { return aBankSymbol; }
332 LanguageType GetLanguage() const { return eLanguage; }
333 sal_uInt16 GetPositiveFormat() const { return nPositiveFormat; }
334 sal_uInt16 GetNegativeFormat() const { return nNegativeFormat; }
335 sal_uInt16 GetDigits() const { return nDigits; }
337 /** [$DM-407] (bBank==false) or [$DEM] (bBank==true)
338 is returned. If bBank==false and
339 bWithoutExtension==true only [$DM] */
340 OUString BuildSymbolString(bool bBank, bool bWithoutExtension = false) const;
342 /** #,##0.00 [$DM-407] is returned, separators
343 from rLoc, incl. minus sign but without [RED] */
344 OUString BuildPositiveFormatString(bool bBank, const LocaleDataWrapper&,
345 sal_uInt16 nDecimalFormat = 1) const;
346 OUString BuildNegativeFormatString(bool bBank, const LocaleDataWrapper&,
347 sal_uInt16 nDecimalFormat = 1) const;
349 /** [$DM-407] (or [$DEM] if bBank==true)
350 is appended/prepended to rStr, incl. minus sign */
351 void CompletePositiveFormatString(OUStringBuffer& rStr, bool bBank,
352 sal_uInt16 nPosiFormat) const;
353 void CompleteNegativeFormatString(OUStringBuffer& rStr, bool bBank,
354 sal_uInt16 nNegaFormat) const;
356 /// rSymStr is appended/prepended to rStr, incl. minus sign
357 static void CompletePositiveFormatString(OUStringBuffer& rStr,
358 const OUString& rSymStr, sal_uInt16 nPosiFormat);
359 static void CompleteNegativeFormatString(OUStringBuffer& rStr,
360 const OUString& rSymStr, sal_uInt16 nNegaFormat);
362 /** Representation of a currency (symbol position and
363 negative sign) in other language settings */
364 static sal_uInt16 GetEffectivePositiveFormat( sal_uInt16 nIntlFormat,
365 sal_uInt16 nCurrFormat, bool bBank );
366 static sal_uInt16 GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat,
367 sal_uInt16 nCurrFormat, bool bBank );
369 /// General Unicode Euro symbol
370 static sal_Unicode GetEuroSymbol() { return u'\x20AC'; }
373 typedef std::vector< OUString > NfWSStringsDtor;
375 class SvNumberFormatterRegistry_Impl;
376 class NfCurrencyTable;
378 class SVL_DLLPUBLIC SvNumberFormatter
380 friend class SvNumberFormatterRegistry_Impl;
381 public:
383 * We can't technically have an "infinite" value, so we use an arbitrary
384 * upper precision threshold to represent the "unlimited" precision.
386 static const sal_uInt16 UNLIMITED_PRECISION;
389 * Precision suitable for numbers displayed in input bar, for instance
390 * Calc's formula input bar.
392 static const sal_uInt16 INPUTSTRING_PRECISION;
394 /// Preferred ctor with service manager and language/country enum
395 SvNumberFormatter(
396 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
397 LanguageType eLang
400 ~SvNumberFormatter();
402 /// Set CallBack to ColorTable
403 void SetColorLink( const Link<sal_uInt16,Color*>& rColorTableCallBack );
404 /// Do the CallBack to ColorTable
405 Color* GetUserDefColor(sal_uInt16 nIndex);
407 /// Change language/country, also input and format scanner
408 void ChangeIntl( LanguageType eLnge );
409 /// Change the reference null date
410 void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear);
411 /// Change standard precision
412 void ChangeStandardPrec(short nPrec);
413 /// Set zero value suppression
414 void SetNoZero(bool bNZ);
416 /** The language with which the formatter was initialized (system setting),
417 NOT the current language after a ChangeIntl() */
418 LanguageType GetLanguage() const;
420 // Determine whether two format types are input compatible or not
421 static bool IsCompatible(SvNumFormatType eOldType, SvNumFormatType eNewType);
423 /** Get table of formats of a specific type of a locale. A format FIndex is
424 tested whether it has the type and locale requested, if it doesn't
425 match FIndex returns the default format for the type/locale. If no
426 specific format is to be selected FIndex may be initialized to 0. */
427 SvNumberFormatTable& GetEntryTable(SvNumFormatType eType,
428 sal_uInt32& FIndex,
429 LanguageType eLnge);
431 /** Get table of formats of a specific type of a language/country.
432 FIndex returns the default format of that type.
433 If the language/country was never touched before new entries are generated */
434 SvNumberFormatTable& ChangeCL(SvNumFormatType eType,
435 sal_uInt32& FIndex,
436 LanguageType eLnge);
438 /** Get table of formats of the same type as FIndex; eType and rLnge are
439 set accordingly. An unknown format is set to Standard/General */
440 SvNumberFormatTable& GetFirstEntryTable(SvNumFormatType& eType,
441 sal_uInt32& FIndex,
442 LanguageType& rLnge);
444 /// Delete an entry including the format it is referring to
445 void DeleteEntry(sal_uInt32 nKey);
447 /** Create new entry of a format code string for language/country.
448 @return
449 <TRUE/> if string new and ok and inserted.
450 <FALSE/> if string already exists or an unresolvable parse error
451 occurred, in which case nCheckPos is the error position within rString.
452 If the error occurs at position 0 or rString is empty nCheckPos
453 will be 1, so an error in the string is always indicated by
454 nCheckPos not being zero.
455 The content of the rString variable can be changed and corrected
456 by the method.
457 nType contains the type of the format.
458 nKey contains the index key of the format.
460 bool PutEntry( OUString& rString, sal_Int32& nCheckPos, SvNumFormatType& nType, sal_uInt32& nKey,
461 LanguageType eLnge = LANGUAGE_DONTKNOW );
463 /** Same as <method>PutEntry</method> but the format code string is
464 considered to be of language/country eLnge and is converted to
465 language/country eNewLnge */
466 bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
467 SvNumFormatType& nType, sal_uInt32& nKey,
468 LanguageType eLnge, LanguageType eNewLnge,
469 bool bConvertDateOrder );
471 /** Same as <method>PutandConvertEntry</method> but the format code string
472 is considered to be of the System language/country eLnge and is
473 converted to another System language/country eNewLnge. In this case
474 the automatic currency is converted too. */
475 bool PutandConvertEntrySystem( OUString& rString, sal_Int32& nCheckPos,
476 SvNumFormatType& nType, sal_uInt32& nKey,
477 LanguageType eLnge, LanguageType eNewLnge );
479 /** Similar to <method>PutEntry</method> and
480 <method>PutandConvertEntry</method> or
481 <method>PutandConvertEntrySystem</method>, the format code string
482 passed is considered to be of language/country eLnge. If
483 eLnge==LANGUAGE_SYSTEM the format code has to match eSysLnge, and if
484 eSysLnge is not the current application locale the format code is
485 converted to the current locale. Additionally, if the format code
486 represents an old "automatic" currency format, it is converted to the
487 new default currency format of the eLnge locale. The rString format
488 code passed as an argument may get adapted in case eLnge was used (or
489 is LANGUAGE_SYSTEM and eSysLnge is identical); in case it wasn't the
490 method works on a copy instead, otherwise the resulting string would
491 not match eSysLnge anymore.
493 <p> This method was introduced to handle the legacy currency formats of
494 the "autotbl.fmt" file used by Calc and Writer and convert them to
495 fixed currency codes of the actual currency. Note that in the case of
496 legacy currency formats no special attribution is converted, only the
497 default currency format of the locale is chosen, and that new fixed
498 currency codes are of course not converted to other currencies. The
499 method may also be used as a general method taking, converting and
500 inserting almost arbitrary format codes. To insert or use, for example,
501 the default currency format code matching the current locale, the
502 method could be called with<br/>
504 <code>
505 GetIndexPuttingAndConverting( "0 $", LANGUAGE_SYSTEM, LANGUAGE_ENGLISH_US, ...);
506 </code>
508 @return
509 The index key of the resulting number format. If the format code
510 was empty, could not be converted or has errors, the eLnge locale's
511 standard number format is chosen instead. The index key is
512 guaranteed to represent some valid number format. If
513 rNewInserted==false and rCheckPos>0 the format code has errors
514 and/or could not be converted.
516 sal_uInt32 GetIndexPuttingAndConverting( OUString & rString, LanguageType eLnge,
517 LanguageType eSysLnge, SvNumFormatType & rType,
518 bool & rNewInserted, sal_Int32 & rCheckPos );
520 /** Create a format code string using format nIndex as a template and
521 applying other settings (passed from the dialog) */
522 OUString GenerateFormat(sal_uInt32 nIndex,
523 LanguageType eLnge = LANGUAGE_DONTKNOW,
524 bool bThousand = false, bool IsRed = false,
525 sal_uInt16 nPrecision = 0, sal_uInt16 nLeadingCnt = 1);
527 /** Analyze an input string
528 @return
529 <TRUE/> if input is a number or is matching a format F_Index
530 F_Index is set to a matching format if number, the value is
531 returned in fOutNumber
532 <FALSE/> if input is not a number
534 bool IsNumberFormat( const OUString& sString, sal_uInt32& F_Index, double& fOutNumber );
536 /// Format a number according to a format index, return string and color
537 void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex,
538 OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
540 /** Format a string according to a format index, return string and color.
541 Formats only if the format code is of type text or the 4th subcode
542 of a format code is specified, otherwise sOutString will be == "" */
543 void GetOutputString( const OUString& sString, sal_uInt32 nFIndex,
544 OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
546 /** Format a number according to the standard default format matching
547 the given format index */
548 void GetInputLineString( const double& fOutNumber,
549 sal_uInt32 nFIndex, OUString& rOutString );
551 /** Format a number according to a format code string to be scanned.
552 @return
553 <FALSE/> if format code contains an error
554 <TRUE/> else, in which case the string and color are returned.
556 bool GetPreviewString(const OUString& sFormatString,
557 double fPreviewNumber,
558 OUString& sOutString,
559 Color** ppColor,
560 LanguageType eLnge,
561 bool bUseStarFormat = false );
563 /** Same as <method>GetPreviewString</method> but the format code string
564 may be either language/country eLnge or en_US english US */
565 bool GetPreviewStringGuess( const OUString& sFormatString, double fPreviewNumber,
566 OUString& sOutString, Color** ppColor,
567 LanguageType eLnge = LANGUAGE_DONTKNOW );
569 /** Format a string according to a format code string to be scanned.
570 @return
571 <FALSE/> if format code contains an error
572 <TRUE/> else, in which case the string and color are returned.
574 bool GetPreviewString( const OUString& sFormatString, const OUString& sPreviewString,
575 OUString& sOutString, Color** ppColor,
576 LanguageType eLnge = LANGUAGE_DONTKNOW );
578 /** Test whether the format code string is already present in container
579 @return
580 NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index.
582 sal_uInt32 TestNewString( const OUString& sFormatString,
583 LanguageType eLnge = LANGUAGE_DONTKNOW );
585 /// Whether format index nFIndex is of type text or not
586 bool IsTextFormat(sal_uInt32 nFIndex) const;
588 /// Get additional info of a format index, e.g. for dialog box
589 void GetFormatSpecialInfo(sal_uInt32 nFormat, bool& bThousand, bool& IsRed,
590 sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt);
592 /// Count of decimals
593 sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const;
595 /// Count of integer digits
596 sal_uInt16 GetFormatIntegerDigits( sal_uInt32 nFormat ) const;
598 /** Get additional info of a format code string, e.g. for dialog box.
599 Uses a temporary parse, if possible use only if format code is not
600 present in container yet, otherwise ineffective.
601 @return
602 0 if format code string parsed without errors, otherwise error
603 position (like nCheckPos on <method>PutEntry</method>)
605 sal_uInt32 GetFormatSpecialInfo( const OUString&, bool& bThousand, bool& IsRed,
606 sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt,
607 LanguageType eLnge = LANGUAGE_DONTKNOW );
609 /// Check if format code string may be deleted by user
610 bool IsUserDefined( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
612 /** Return the format index of the format code string for language/country,
613 or NUMBERFORMAT_ENTRY_NOT_FOUND */
614 sal_uInt32 GetEntryKey( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
616 /// Return the format for a format index
617 const SvNumberformat* GetEntry( sal_uInt32 nKey ) const;
619 /// Obtain substituted GetFormatEntry(), i.e. system formats.
620 const SvNumberformat* GetSubstitutedEntry( sal_uInt32 nKey, sal_uInt32 & o_rNewKey ) const;
622 /// Return the format index of the standard default number format for language/country
623 sal_uInt32 GetStandardIndex(LanguageType eLnge = LANGUAGE_DONTKNOW);
625 /// Return the format index of the default format of a type for language/country
626 sal_uInt32 GetStandardFormat(SvNumFormatType eType, LanguageType eLnge = LANGUAGE_DONTKNOW);
628 /** Return the format index of the default format of a type for language/country.
629 Maybe not the default format but a special builtin format, e.g. for
630 NF_TIME_HH_MMSS00, if that format is passed in nFIndex. */
631 sal_uInt32 GetStandardFormat( sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge );
633 /** Return the format index of the default format of a type for language/country.
634 Maybe not the default format but a special builtin format, e.g. for
635 NF_TIME_HH_MMSS00, or NF_TIME_HH_MMSS if fNumber >= 1.0 */
636 sal_uInt32 GetStandardFormat( double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType,
637 LanguageType eLnge );
639 /// Whether nFIndex is a special builtin format
640 bool IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge );
642 /** Return a time format that best matches fNumber. */
643 sal_uInt32 GetTimeFormat( double fNumber, LanguageType eLnge, bool bForceDuration );
645 /** Return a format and type that best matches the value of fNumber if
646 fNumber is assumed to be a date, time or datetime value, but unknown
647 which. Originally introduced for Chart databrowser editor, probably
648 should not be used otherwise. */
649 sal_uInt32 GuessDateTimeFormat( SvNumFormatType& rType, double fNumber, LanguageType eLnge );
651 /** Return the corresponding edit format of a format. */
652 sal_uInt32 GetEditFormat( double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType,
653 LanguageType eLnge, SvNumberformat const * pFormat );
655 /// Return the reference date
656 const Date& GetNullDate() const;
657 /// Return the standard decimal precision
658 sal_uInt16 GetStandardPrec() const;
659 /// Return whether zero suppression is switched on
660 bool GetNoZero() const;
661 /** Get the type of a format (or css::util::NumberFormat::UNDEFINED if no entry),
662 but with css::util::NumberFormat::DEFINED masked out */
663 SvNumFormatType GetType(sal_uInt32 nFIndex) const;
665 /// As the name says
666 void ClearMergeTable();
667 /// Merge in all new entries from rNewTable and return a table of resulting new format indices
668 SvNumberFormatterIndexTable* MergeFormatter(SvNumberFormatter& rNewTable);
670 /// Whether a merge table is present or not
671 bool HasMergeFormatTable() const;
672 /// Return the new format index for an old format index, if a merge table exists
673 sal_uInt32 GetMergeFormatIndex( sal_uInt32 nOldFmt ) const;
675 /** Convert the ugly old tools' Table type bloated with new'ed sal_uInt32
676 entries merge table to ::std::map with old index key and new index key.
677 @ATTENTION! Also clears the old table using ClearMergeTable() */
678 SvNumberFormatterMergeMap ConvertMergeTableToMap();
680 /** Return the format index of a builtin format for a specific language/country.
681 If nFormat is not a builtin format nFormat is returned. */
682 sal_uInt32 GetFormatForLanguageIfBuiltIn( sal_uInt32 nFormat,
683 LanguageType eLnge = LANGUAGE_DONTKNOW );
685 /** Return the format index for a builtin format of a specific language
686 @see NfIndexTableOffset
688 sal_uInt32 GetFormatIndex( NfIndexTableOffset, LanguageType eLnge = LANGUAGE_DONTKNOW );
690 /** Return enum index of a format index of a builtin format,
691 NF_INDEX_TABLE_ENTRIES if it's not a builtin format.
692 @see NfIndexTableOffset
694 NfIndexTableOffset GetIndexTableOffset( sal_uInt32 nFormat ) const;
696 /** Set evaluation type and order of input date strings
697 @see NfEvalDateFormat
699 void SetEvalDateFormat( NfEvalDateFormat eEDF );
700 NfEvalDateFormat GetEvalDateFormat() const;
702 /** Set TwoDigitYearStart, how the input string scanner handles a two digit year.
703 Default from VCL: 1930, 30-99 19xx, 00-29 20xx
705 <p> Historically (prior to src513e) it was a two digit number determining
706 until which number the string scanner recognizes a year to be 20xx,
707 default <= 29 is used by SFX/OfaMiscCfg.
708 The name Year2000 is kept although the actual functionality is now a
709 TwoDigitYearStart which might be in any century.
711 void SetYear2000( sal_uInt16 nVal );
712 sal_uInt16 GetYear2000() const;
713 static sal_uInt16 GetYear2000Default();
715 sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear ) const;
716 static sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart );
718 /// Return the decimal separator matching the locale of the given format
719 OUString GetFormatDecimalSep( sal_uInt32 nFormat ) const;
721 /// Return a NfCurrencyTable with pointers to <type>NfCurrencyEntry</type> entries
722 static const NfCurrencyTable& GetTheCurrencyTable();
724 /** Searches, according to the default locale currency, an entry of the
725 CurrencyTable which is <bold>not</bold> the first (LANGUAGE_SYSTEM) entry.
726 @return
727 <NULL/> if not found
728 else pointer to NfCurrencyEntry
730 static const NfCurrencyEntry* MatchSystemCurrency();
732 /** Return a NfCurrencyEntry matching a language/country.
733 If language/country is LANGUAGE_SYSTEM a <method>MatchSystemCurrency</method>
734 call is tried to get an entry. If that fails or the corresponding
735 language/country is not present the entry for LANGUAGE_SYSTEM is returned.
737 static const NfCurrencyEntry& GetCurrencyEntry( LanguageType );
739 /** Return a NfCurrencyEntry pointer matching a language/country
740 and currency abbreviation (AKA banking symbol).
741 This method is meant for the configuration of the default currency.
742 @return
743 <NULL/> if not found
744 else pointer to NfCurrencyEntry
746 static const NfCurrencyEntry* GetCurrencyEntry( const OUString& rAbbrev,
747 LanguageType eLang );
749 /** Return a NfCurrencyEntry pointer matching the symbol
750 combination of a LegacyOnly currency. Note that this means only that
751 the currency matching both symbols was once used in the Office, but is
752 not offered in dialogs anymore. It doesn't even mean that the currency
753 symbol combination is valid, since the reason for removing it may have
754 been just that. #i61657#
755 @return
756 A matching entry, or else <NULL/>.
758 static const NfCurrencyEntry* GetLegacyOnlyCurrencyEntry( const OUString& rSymbol, const OUString& rAbbrev );
760 /** Set the default system currency. The combination of abbreviation and
761 language must match an existent element of theCurrencyTable. If not,
762 the SYSTEM (current locale) entry becomes the default.
763 This method is meant for the configuration of the default currency.
765 static void SetDefaultSystemCurrency( const OUString& rAbbrev, LanguageType eLang );
767 /** Get all standard formats for a specific currency, formats are
768 appended to the NfWSStringsDtor list.
769 @param bBank
770 <TRUE/>: generate only format strings with currency abbreviation
771 <FALSE/>: mixed format strings
772 @return
773 position of default format
775 sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&,
776 bool bBank ) const;
778 /** Whether nFormat is of type css::util::NumberFormat::CURRENCY and the format code
779 contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn].
780 If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is
781 returned, even if the format code only contains [$xxx] !
783 bool GetNewCurrencySymbolString( sal_uInt32 nFormat, OUString& rSymbol,
784 const NfCurrencyEntry** ppEntry,
785 bool* pBank = nullptr ) const;
787 /** Look up the corresponding NfCurrencyEntry matching
788 rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly
789 a rExtension (being yyy of [$xxx-yyy]) or a given language/country
790 value. Tries to match a rSymbol with rExtension first, then with
791 eFormatLanguage, then rSymbol only. This is because a currency entry
792 might have been constructed using I18N locale data where a used locale
793 of a currency format code must not necessarily match the locale of
794 the locale data itself, e.g. [$HK$-40C] (being "zh_HK" locale) in
795 zh_CN locale data. Here the rExtension would have the value 0x40c but
796 eFormatLanguage of the number format would have the value of zh_CN
797 locale, the value with which the corresponding CurrencyEntry is
798 constructed.
800 @param bFoundBank
801 Only used for output.
802 If the return value is not <NULL/> this value is set to <TRUE/> if
803 the matching entry was found by comparing rSymbol against the
804 CurrencyAbbreviation (AKA BankSymbol).
805 If the return value is <NULL/> the value of bFoundBank is undefined.
806 @param rSymbol
807 Currency symbol, preferably obtained of a format by a call to
808 <method>SvNumberformat::GetNewCurrencySymbol()</method>
809 @param rExtension
810 Currency extension, preferably obtained of a format by a call to
811 <method>SvNumberformat::GetNewCurrencySymbol()</method>
812 @param eFormatLanguage
813 The language/country value of the format of which rSymbol and
814 rExtension are obtained (<method>SvNumberformat::GetLanguage()</method>).
815 @param bOnlyStringLanguage
816 If <TRUE/> only entries with language/country of rExtension are
817 checked, no match on eFormatLanguage. If rExtension is empty all
818 entries are checked.
819 @return
820 The matching entry if unique (in which case bFoundBank is set),
821 else <NULL/>.
823 static const NfCurrencyEntry* GetCurrencyEntry( bool & bFoundBank,
824 const OUString& rSymbol,
825 const OUString& rExtension,
826 LanguageType eFormatLanguage,
827 bool bOnlyStringLanguage = false );
829 /// Get compatibility ("automatic" old style) currency from I18N locale data
830 void GetCompatibilityCurrency( OUString& rSymbol, OUString& rAbbrev ) const;
832 /// Fill rList with the language/country codes that have been allocated
833 void GetUsedLanguages( std::vector<LanguageType>& rList );
835 /// Fill a NfKeywordIndex table with keywords of a language/country
836 void FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang );
838 /** Fill a NfKeywordIndex table with keywords usable in Excel export with
839 GetFormatStringForExcel() or SvNumberformat::GetMappedFormatstring() */
840 void FillKeywordTableForExcel( NfKeywordTable& rKeywords );
842 /** Return a format code string suitable for Excel export.
844 @param rTempFormatter
845 SvNumberFormatter to use if a non-en-US format code needs to be
846 converted and put, should not be the same formatter to not
847 pollute the entries of this one here.
849 OUString GetFormatStringForExcel( sal_uInt32 nKey, const NfKeywordTable& rKeywords,
850 SvNumberFormatter& rTempFormatter ) const;
852 /** Return a keyword for a language/country and NfKeywordIndex
853 for XML import, to generate number format strings. */
854 OUString GetKeyword( LanguageType eLnge, sal_uInt16 nIndex );
856 /** Return the GENERAL keyword in proper case ("General") for a
857 language/country, used in XML import */
858 OUString GetStandardName( LanguageType eLnge );
860 /** Check if a specific locale has supported locale data. */
861 static bool IsLocaleInstalled( LanguageType eLang );
863 /** Obtain NfKeywordTable used with a format, possibly localized.
865 XXX NOTE: the content (actual keywords) is only valid as long as the
866 locale context of the associated ImpSvNumberformatScan instance does
867 not change to a locale with different keywords, which may happen
868 anytime with a call (implicit or explicit) to
869 SvNumberFormatter::ChangeIntl(). If needed longer, copy-create another
870 NfKeywordTable instance or copy individual elements.
872 If the format specified with nKey does not exist, the content of the
873 NfKeywordTable matches the locale with which the SvNumberFormatter
874 instance was created and initialized.
876 This function preliminary exists for unit tests and otherwise is
877 pretty much useless.
879 const NfKeywordTable & GetKeywords( sal_uInt32 nKey );
881 /** Access for unit tests. */
882 const NfKeywordTable & GetEnglishKeywords() const;
884 /** Access for unit tests. */
885 const std::vector<Color> & GetStandardColors() const;
887 /** Access for unit tests. */
888 size_t GetMaxDefaultColors() const;
890 struct InputScannerPrivateAccess { friend class ImpSvNumberInputScan; private: InputScannerPrivateAccess() {} };
891 /** Access for input scanner to temporarily (!) switch locales. */
892 OnDemandLocaleDataWrapper& GetOnDemandLocaleDataWrapper( const InputScannerPrivateAccess& ) { return xLocaleData; }
894 private:
895 mutable ::osl::Mutex m_aMutex;
896 css::uno::Reference< css::uno::XComponentContext > m_xContext;
897 LanguageTag maLanguageTag;
898 std::map<sal_uInt32, std::unique_ptr<SvNumberformat>> aFTable; // Table of format keys to format entries
899 typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
900 DefaultFormatKeysMap aDefaultFormatKeys; // Table of default standard to format keys
901 std::unique_ptr<SvNumberFormatTable> pFormatTable; // For the UI dialog
902 std::unique_ptr<SvNumberFormatterIndexTable> pMergeTable; // List of indices for merging two formatters
903 std::unique_ptr<CharClass> pCharClass; // CharacterClassification
904 OnDemandLocaleDataWrapper xLocaleData; // LocaleData switched between SYSTEM, ENGLISH and other
905 OnDemandTransliterationWrapper xTransliteration; // Transliteration loaded on demand
906 OnDemandCalendarWrapper xCalendar; // Calendar loaded on demand
907 OnDemandNativeNumberWrapper xNatNum; // Native number service loaded on demand
908 std::unique_ptr<ImpSvNumberInputScan> pStringScanner; // Input string scanner
909 std::unique_ptr<ImpSvNumberformatScan> pFormatScanner; // Format code string scanner
910 Link<sal_uInt16,Color*> aColorLink; // User defined color table CallBack
911 sal_uInt32 MaxCLOffset; // Max language/country offset used
912 sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale
913 LanguageType IniLnge; // Initialized setting language/country
914 LanguageType ActLnge; // Current setting language/country
915 NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation
916 bool bNoZero; // Zero value suppression
918 // cached locale data items needed almost any time
919 OUString aDecimalSep;
920 OUString aDecimalSepAlt;
921 OUString aThousandSep;
922 OUString aDateSep;
924 SVL_DLLPRIVATE static volatile bool bCurrencyTableInitialized;
925 SVL_DLLPRIVATE static sal_uInt16 nSystemCurrencyPosition;
926 SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry;
928 // get the registry, create one if none exists
929 SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl& GetFormatterRegistry();
931 // called by ctors
932 SVL_DLLPRIVATE void ImpConstruct( LanguageType eLang );
934 // Generate builtin formats provided by i18n behind CLOffset,
935 // if bNoAdditionalFormats==false also generate additional i18n formats.
936 SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditionalFormats );
938 // Generate additional formats provided by i18n
939 SVL_DLLPRIVATE void ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
940 css::uno::Reference< css::i18n::XNumberFormatCode > const & rNumberFormatCode,
941 bool bAfterChangingSystemCL );
943 SVL_DLLPRIVATE SvNumberformat* ImpInsertFormat( const css::i18n::NumberFormatCode& rCode,
944 sal_uInt32 nPos,
945 bool bAfterChangingSystemCL = false,
946 sal_Int16 nOrgIndex = 0 );
948 // Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country
949 SVL_DLLPRIVATE sal_uInt32 ImpGetCLOffset(LanguageType eLnge) const;
951 // Test whether format code already exists, then return index key,
952 // otherwise NUMBERFORMAT_ENTRY_NOT_FOUND
953 SVL_DLLPRIVATE sal_uInt32 ImpIsEntry( const OUString& rString,
954 sal_uInt32 CLOffset,
955 LanguageType eLnge );
957 // Create builtin formats for language/country if necessary, return CLOffset
958 SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge );
960 // Create theCurrencyTable with all <type>NfCurrencyEntry</type>
961 SVL_DLLPRIVATE static void ImpInitCurrencyTable();
963 // Return the format index of the currency format of the system locale.
964 // Format is created if not already present.
965 SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultSystemCurrencyFormat();
967 // Return the format index of the currency format of the current locale.
968 // Format is created if not already present.
969 SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultCurrencyFormat();
971 // Return the default format for a given type and current locale.
972 // May ONLY be called from within GetStandardFormat().
973 SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultFormat( SvNumFormatType nType );
975 // Return the index in a sequence of format codes matching an enum of
976 // NfIndexTableOffset. If not found 0 is returned. If the sequence doesn't
977 // contain any format code elements a default element is created and inserted.
978 SVL_DLLPRIVATE sal_Int32 ImpGetFormatCodeIndex( css::uno::Sequence< css::i18n::NumberFormatCode >& rSeq,
979 const NfIndexTableOffset nTabOff );
981 // Adjust a sequence of format codes to contain only one (THE) default
982 // instead of multiple defaults for short/medium/long types.
983 // If there is no medium but a short and a long default the long is taken.
984 // Non-PRODUCT version may check locale data for matching defaults in one
985 // FormatElement group.
986 SVL_DLLPRIVATE void ImpAdjustFormatCodeDefault( css::i18n::NumberFormatCode * pFormatArr,
987 sal_Int32 nCount );
989 // Obtain the format entry for a given key index.
990 SVL_DLLPRIVATE SvNumberformat* GetFormatEntry( sal_uInt32 nKey );
991 SVL_DLLPRIVATE const SvNumberformat* GetFormatEntry( sal_uInt32 nKey ) const;
993 // used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry()
994 static bool ImpLookupCurrencyEntryLoopBody(
995 const NfCurrencyEntry*& pFoundEntry, bool& bFoundBank, const NfCurrencyEntry* pData,
996 sal_uInt16 nPos, const OUString& rSymbol );
998 // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method>
999 DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, LinkParamNone*, void );
1001 // return position of a special character
1002 sal_Int32 ImpPosToken ( const OUStringBuffer & sFormat, sal_Unicode token, sal_Int32 nStartPos = 0 ) const;
1004 // Substitute a format during GetFormatEntry(), i.e. system formats.
1005 SvNumberformat* ImpSubstituteEntry( SvNumberformat* pFormat, sal_uInt32 * o_pRealKey = nullptr );
1007 // own mutex, may also be used by internal class SvNumberFormatterRegistry_Impl
1008 static ::osl::Mutex& GetGlobalMutex();
1009 ::osl::Mutex& GetInstanceMutex() const { return m_aMutex; }
1011 public:
1013 // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes
1014 void ResetDefaultSystemCurrency();
1016 // Called by SvNumberFormatterRegistry_Impl::Notify if the system locale's
1017 // date acceptance patterns change.
1018 void InvalidateDateAcceptancePatterns();
1020 // Replace the SYSTEM language/country format codes. Called upon change of
1021 // the user configurable locale.
1022 // Old compatibility codes are replaced, user defined are converted, and
1023 // new format codes are appended.
1024 void ReplaceSystemCL( LanguageType eOldLanguage );
1026 const css::uno::Reference<css::uno::XComponentContext>& GetComponentContext() const;
1028 //! The following method is not to be used from outside but must be
1029 //! public for the InputScanner.
1030 // return the current FormatScanner
1031 const ImpSvNumberformatScan* GetFormatScanner() const;
1033 //! The following methods are not to be used from outside but must be
1034 //! public for the InputScanner and FormatScanner.
1036 // return current (!) Locale
1037 const LanguageTag& GetLanguageTag() const;
1039 // return corresponding Transliteration wrapper
1040 const ::utl::TransliterationWrapper* GetTransliteration() const;
1042 // return the corresponding CharacterClassification wrapper
1043 const CharClass* GetCharClass() const;
1045 // return the corresponding LocaleData wrapper
1046 const LocaleDataWrapper* GetLocaleData() const;
1048 // return the corresponding Calendar wrapper
1049 CalendarWrapper* GetCalendar() const;
1051 // return the corresponding NativeNumberSupplier wrapper
1052 const NativeNumberWrapper* GetNatNum() const;
1054 // cached locale data items
1056 // return the corresponding decimal separator
1057 const OUString& GetNumDecimalSep() const;
1059 // return the corresponding decimal separator alternative
1060 const OUString& GetNumDecimalSepAlt() const;
1062 // return the corresponding group (AKA thousand) separator
1063 const OUString& GetNumThousandSep() const;
1065 // return the corresponding date separator
1066 const OUString& GetDateSep() const;
1068 // checks for decimal separator and optional alternative
1069 bool IsDecimalSep( const OUString& rStr ) const;
1072 #endif // INCLUDED_SVL_ZFORLIST_HXX
1074 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */