MythTV master
mythlocale.h
Go to the documentation of this file.
1#ifndef MYTHLOCALE_H
2#define MYTHLOCALE_H
3
4// QT
5#include <QString>
6#include <QMap>
7#include <QLocale>
8
9// libmythbase
10#include "mythbaseexp.h"
11
13{
14 public:
15 explicit MythLocale(const QString &localeName = QString());
16
17 void ReInit();
18
19 QString GetCountryCode() const;
20 QString GetCountry() const;
21 QString GetNativeCountry() const;
22
23 QString GetLanguageCode() const;
24 QString GetLanguage() const;
25 QString GetNativeLanguage() const;
26
27 QString GetLocaleCode() const { return m_localeCode; }
28
29 QLocale ToQLocale() const { return m_qtLocale; }
30
31 bool LoadDefaultsFromXML(void);
32 void SaveLocaleDefaults(bool overwrite = false);
33 void ResetToLocaleDefaults(void);
34 void ResetToStandardDefaults(void);
35
36 QString GetLocaleSetting(const QString &key);
37
38 private:
39 void Init(const QString &localeName = QString());
40
41 QString m_localeCode;
42 bool m_defaultsLoaded {false};
43 QLocale m_qtLocale;
44
45 using SettingsMap = QMap<QString, QString>;
48};
49
50#endif
SettingsMap m_globalSettings
Definition: mythlocale.h:46
QString m_localeCode
Definition: mythlocale.h:41
SettingsMap m_hostSettings
Definition: mythlocale.h:47
QLocale ToQLocale() const
Definition: mythlocale.h:29
QMap< QString, QString > SettingsMap
Definition: mythlocale.h:45
QLocale m_qtLocale
Definition: mythlocale.h:43
QString GetLocaleCode() const
Name of language in that language.
Definition: mythlocale.h:27
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15