source: calamares/trunk/fuentes/src/modules/locale/LocaleConfiguration.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.0 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2016, Teo Mrnjavac <teo@kde.org>
4 *   Copyright 2017, Adriaan de Groot <groot@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LOCALECONFIGURATION_H
21#define LOCALECONFIGURATION_H
22
23#include <QString>
24#include <QMap>
25
26class LocaleConfiguration
27{
28public:
29    explicit LocaleConfiguration();
30
31    static LocaleConfiguration createDefault();
32    static LocaleConfiguration fromLanguageAndLocation( const QString& language,
33                                                        const QStringList& availableLocales,
34                                                        const QString& countryCode );
35
36    bool isEmpty() const;
37
38    QMap< QString, QString > toMap() const;
39    // Note that the documentation how this works is in packages.conf
40    QString toBcp47() const;
41
42    // These become all uppercase in locale.conf, but we keep them lowercase here to
43    // avoid confusion with locale.h.
44    QString lang, lc_numeric, lc_time, lc_monetary, lc_paper, lc_name, lc_address,
45            lc_telephone, lc_measurement, lc_identification;
46
47    // If the user has explicitly selected language (from the dialog)
48    // or numbers format, set these to avoid implicit changes to them.
49    bool explicit_lang, explicit_lc;
50
51private:
52    QString myLanguageLocaleBcp47;
53};
54
55#endif // LOCALECONFIGURATION_H
Note: See TracBrowser for help on using the repository browser.