00001 #ifndef MYTHLOCALE_H
00002 #define MYTHLOCALE_H
00003
00004
00005 #include <QString>
00006 #include <QMap>
00007 #include <QLocale>
00008
00009
00010 #include "iso3166.h"
00011 #include "iso639.h"
00012 #include "mythbaseexp.h"
00013
00014 class MBASE_PUBLIC MythLocale
00015 {
00016 public:
00017 MythLocale(QString localeName = QString());
00018 ~MythLocale() { };
00019
00020 void ReInit();
00021
00022 QString GetCountryCode() const;
00023 QString GetCountry() const;
00024 QString GetNativeCountry() const;
00025
00026 QString GetLanguageCode() const;
00027 QString GetLanguage() const;
00028 QString GetNativeLanguage() const;
00029
00030 QString GetLocaleCode() const { return m_localeCode; }
00031
00032 const QLocale ToQLocale() const { return m_qtLocale; }
00033
00034 bool LoadDefaultsFromXML(void);
00035 void SaveLocaleDefaults(bool overwrite = false);
00036 void ResetToLocaleDefaults(void);
00037 void ResetToStandardDefaults(void);
00038
00039 QString GetLocaleSetting(const QString &key);
00040
00041 private:
00042 void Init(const QString &localeName = QString());
00043
00044 QString m_localeCode;
00045 bool m_defaultsLoaded;
00046 QLocale m_qtLocale;
00047
00048 typedef QMap<QString, QString> SettingsMap;
00049 SettingsMap m_globalSettings;
00050 SettingsMap m_hostSettings;
00051 };
00052
00053 #endif
00054