Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / i18nlangtag / languagetagicu.hxx
blob2d0aabdd34ea0c7f5ac0fff8426b2e5209ab24ae
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/.
8 */
10 #ifndef INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX
11 #define INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX
13 #include <sal/config.h>
14 #include <i18nlangtag/i18nlangtagdllapi.h>
15 #include <rtl/ustring.hxx>
16 #include <unicode/locid.h>
18 class LanguageTag;
21 /** Interface LanguageTag to ICU's icu::Locale
23 Separated from LanguageTag to not pollute the entire code base (and thus
24 makefiles) with ICU header file inclusion, only the few code actually using
25 this needs to know about ICU, which it did anyway.
27 class SAL_WARN_UNUSED I18NLANGTAG_DLLPUBLIC LanguageTagIcu
29 public:
31 /** Obtain language tag as ICU icu::Locale.
33 If the language tag is a "pure" ISO locale (see
34 LanguageTag::getLocale()) that is directly constructed, otherwise it is
35 converted using the available ICU mechanisms.
37 Always resolves an empty tag to the system locale.
39 static icu::Locale getIcuLocale( const LanguageTag & rLanguageTag );
41 /** Obtain language tag as ICU icu::Locale, adding variant data.
43 From the LanguageTag only language and country are used to construct
44 the icu:Locale, the variant field is copied from rVariant. For example
45 needed to create an icu::Collator instance where the variant field
46 denotes the algorithm to be used.
48 Always resolves an empty tag to the system locale.
50 static icu::Locale getIcuLocale( const LanguageTag & rLanguageTag, const OUString & rVariant );
53 #endif // INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */