/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #pragma once
//! The following method is not to be used from outside but must be //! public for the InputScanner. // return the current FormatScanner const ImpSvNumberformatScan* GetFormatScanner() const;
// return current (!) Locale const LanguageTag& GetLanguageTag() const;
/// Get compatibility ("automatic" old style) currency from I18N locale data void GetCompatibilityCurrency(OUString& rSymbol, OUString& rAbbrev) const;
// cached locale data items
// return the corresponding decimal separator const OUString& GetNumDecimalSep() const;
// return the corresponding decimal separator alternative const OUString& GetNumDecimalSepAlt() const;
// return the corresponding group (AKA thousand) separator const OUString& GetNumThousandSep() const;
// return the corresponding date separator const OUString& GetDateSep() const;
// checks for decimal separator and optional alternative bool IsDecimalSep(std::u16string_view rStr) const;
/// Return the decimal separator matching the given locale / LanguageType.
OUString GetLangDecimalSep(LanguageType nLang);
/// Change language/country, also input and format scanner void ChangeIntl(LanguageType eLnge);
/** Set evaluation type and order of input date strings @see NfEvalDateFormat
*/ void SetEvalDateFormat(NfEvalDateFormat eEDF) { eEvalDateFormat = eEDF; }
NfEvalDateFormat GetEvalDateFormat() const { return eEvalDateFormat; }
/** The language with which the formatter was initialized (system setting),
NOT the current language after a ChangeIntl() */
LanguageType GetIniLanguage() const { return IniLnge; }
class SVL_DLLPUBLIC SvNFFormatData
{ public: typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
private: typedef std::map<sal_uInt32, std::unique_ptr<SvNumberformat>> FormatEntryMap;
FormatEntryMap aFTable; // Table of format keys to format entries
DefaultFormatKeysMap aDefaultFormatKeys; // Table of default standard to format keys
sal_uInt32 MaxCLOffset; // Max language/country offset used
sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale bool bNoZero; // Zero value suppression
/** Whether nFormat is of type css::util::NumberFormat::CURRENCY and the format code contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn]. If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is returned, even if the format code only contains [$xxx] !
*/ bool GetNewCurrencySymbolString(sal_uInt32 nFormat, OUString& rSymbol, const NfCurrencyEntry** ppEntry, bool* pBank = nullptr) const;
// Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country
SVL_DLLPRIVATE sal_uInt32 ImpGetCLOffset(LanguageType eLnge) const;
// Generate builtin formats provided by i18n behind CLOffset, // if bNoAdditionalFormats==false also generate additional i18n formats.
SVL_DLLPRIVATE void ImpGenerateFormats(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, sal_uInt32 CLOffset, bool bNoAdditionalFormats);
// Create builtin formats for language/country if necessary, return CLOffset
SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum, LanguageType eLnge);
// Return the format index of the currency format of the current locale. // Format is created if not already present.
SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultCurrencyFormat(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum,
sal_uInt32 CLOffset, LanguageType eLnge);
// Return the format index of the currency format of the system locale. // Format is created if not already present.
SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultSystemCurrencyFormat(SvNFLanguageData& rCurrentLanguage, const NativeNumberWrapper& rNatNum);
/// Return the decimal separator matching the locale of the given format static OUString GetFormatDecimalSep(SvNFLanguageData& rCurrentLanguage, const SvNFFormatData& rFormatData, sal_uInt32 nFormat);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.