Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : */
9 :
10 : #ifndef INCLUDED_XMLOFF_LANGUAGETAGODF_HXX
11 : #define INCLUDED_XMLOFF_LANGUAGETAGODF_HXX
12 :
13 : #include <sal/config.h>
14 : #include <rtl/ustring.hxx>
15 : #include <i18nlangtag/languagetag.hxx>
16 :
17 : /** Helper to gather the single language tag relevant attributes during reading
18 : ODF and form a resulting LanguageTag when done.
19 :
20 : For example fo:language, fo:script, fo:country, style:rfc-language-tag
21 : */
22 14256 : struct LanguageTagODF
23 : {
24 : OUString maRfcLanguageTag;
25 : OUString maLanguage;
26 : OUString maScript;
27 : OUString maCountry;
28 :
29 14258 : bool isEmpty() const { return maRfcLanguageTag.isEmpty() &&
30 13369 : maLanguage.isEmpty() && maScript.isEmpty() && maCountry.isEmpty(); }
31 :
32 : /** Best call this only once per instance, it recreates a LanguageTag
33 : instance on every call.
34 : */
35 889 : LanguageTag getLanguageTag() const { return LanguageTag( maRfcLanguageTag, maLanguage, maScript, maCountry); }
36 : };
37 :
38 : #endif // INCLUDED_XMLOFF_LANGUAGETAGODF_HXX
39 :
40 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|