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  ~MythLocale() = default;
17 
18  void ReInit();
19 
20  QString GetCountryCode() const;
21  QString GetCountry() const;
22  QString GetNativeCountry() const;
23 
24  QString GetLanguageCode() const;
25  QString GetLanguage() const;
26  QString GetNativeLanguage() const;
27 
28  QString GetLocaleCode() const { return m_localeCode; }
29 
30  const QLocale ToQLocale() const { return m_qtLocale; }
31 
32  bool LoadDefaultsFromXML(void);
33  void SaveLocaleDefaults(bool overwrite = false);
34  void ResetToLocaleDefaults(void);
35  void ResetToStandardDefaults(void);
36 
37  QString GetLocaleSetting(const QString &key);
38 
39  private:
40  void Init(const QString &localeName = QString());
41 
42  QString m_localeCode;
43  bool m_defaultsLoaded {false};
44  QLocale m_qtLocale;
45 
46  typedef QMap<QString, QString> SettingsMap;
49 };
50 
51 #endif
QString GetLocaleCode() const
Name of language in that language.
Definition: mythlocale.h:28
QMap< QString, QString > SettingsMap
Definition: mythlocale.h:46
QLocale m_qtLocale
Definition: mythlocale.h:44
const QLocale ToQLocale() const
Definition: mythlocale.h:30
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
SettingsMap m_globalSettings
Definition: mythlocale.h:47
SettingsMap m_hostSettings
Definition: mythlocale.h:48
QString m_localeCode
Definition: mythlocale.h:42