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
MythLocale
Definition: mythlocale.h:12
mythbaseexp.h
MythLocale::ToQLocale
QLocale ToQLocale() const
Definition: mythlocale.h:29
MythLocale::m_globalSettings
SettingsMap m_globalSettings
Definition: mythlocale.h:46
MythLocale::m_qtLocale
QLocale m_qtLocale
Definition: mythlocale.h:43
MBASE_PUBLIC
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
MythLocale::m_hostSettings
SettingsMap m_hostSettings
Definition: mythlocale.h:47
MythLocale::GetLocaleCode
QString GetLocaleCode() const
Name of language in that language.
Definition: mythlocale.h:27
MythLocale::m_localeCode
QString m_localeCode
Definition: mythlocale.h:41
MythLocale::SettingsMap
QMap< QString, QString > SettingsMap
Definition: mythlocale.h:45