Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://astro.uni-altai.ru/~aw/stellarium/api/classStelLocaleMgr.html
Дата изменения: Unknown Дата индексирования: Fri Feb 28 07:29:04 2014 Кодировка: Поисковые слова: m 5 |
Stellarium 0.12.3
|
Manage i18n operations such as message translation and date/time localization. More...
#include <StelLocaleMgr.hpp>
Public Types | |
enum | STimeFormat { STime24h, STime12h, STimeSystemDefault } |
The time display format. More... | |
enum | SDateFormat { SDateMMDDYYYY, SDateDDMMYYYY, SDateSystemDefault, SDateYYYYMMDD } |
The date display format. More... | |
enum | STzFormat { STzCustom, STzGMTShift, STzSystemDefault } |
Public Member Functions | |
void | init () |
Initialize object. More... | |
QString | getAppLanguage () const |
Get the application language currently used for GUI etc. More... | |
void | setAppLanguage (const QString &newAppLangName) |
Set the application language. More... | |
StelTranslator & | getAppStelTranslator () const |
Get the StelTranslator object currently used for global application. More... | |
QString | getSkyLanguage () const |
Get the language currently used for sky objects. More... | |
void | setSkyLanguage (const QString &newSkyLangName) |
Set the sky language and reload the sky object names with the new translation. More... | |
StelTranslator & | getSkyTranslator () |
Get a reference to the StelTranslator object currently used for sky objects. More... | |
QString | getTimeFormatStr (void) const |
Get the format string which describes the current time format. More... | |
void | setTimeFormatStr (const QString &tf) |
Set the time format from a format string. More... | |
QString | getDateFormatStr (void) const |
Get the format string which describes the current date format. More... | |
void | setDateFormatStr (const QString &df) |
void | setCustomTimezone (QString tZ) |
Set the time zone. More... | |
QString | getPrintableDateLocal (double JD) const |
Get a localized, formatted string representation of the date component of a Julian date. More... | |
QString | getPrintableTimeLocal (double JD) const |
Get a localized, formatted string representation of the time component of a Julian date. More... | |
void | setGMTShift (int t) |
Get the current time shift at observator time zone with respect to GMT time. More... | |
float | getGMTShift (double JD=0) const |
Get the current time shift in hours at observator time zone with respect to GMT time. More... | |
void | setCustomTzName (const QString &tzname) |
Set the timezone by a TZ-style string (see tzset in the libc manual). More... | |
QString | getCustomTzName (void) const |
Get the timezone name (a TZ-style string - see tzset in the libc manual). More... | |
STzFormat | getTzFormat (void) const |
Get the current timezone format mode. More... | |
QString | getISO8601TimeLocal (double JD) const |
Return the time in ISO 8601 format that is : Y-m-dTH:M:S. More... | |
double | getJdFromISO8601TimeLocal (const QString &str, bool *ok) const |
Return the JD time for a local time ISO 8601 format that is: Y-m-dTH:M:S, but Y can be a large number with sign, and Y can be zero. More... | |
Static Public Member Functions | |
static QString | countryCodeToString (const QString &countryCode) |
Convert a 2 letter country code to string. More... | |
static QStringList | getAllCountryNames () |
Return an alphabetically ordered list of all the known country names. More... | |
Manage i18n operations such as message translation and date/time localization.
Definition at line 28 of file StelLocaleMgr.hpp.
The date display format.
Definition at line 110 of file StelLocaleMgr.hpp.
The time display format.
Enumerator | |
---|---|
STime24h |
24 hour clock, e.g. "18:22:00" |
STime12h |
12 hour clock, e.g. "06:22:00 pm" |
STimeSystemDefault |
use the system default format. |
Definition at line 102 of file StelLocaleMgr.hpp.
Enumerator | |
---|---|
STzCustom |
User-specified timezone. |
STzGMTShift |
GMT + offset. |
STzSystemDefault |
System default. |
Definition at line 124 of file StelLocaleMgr.hpp.
|
static |
Convert a 2 letter country code to string.
|
static |
Return an alphabetically ordered list of all the known country names.
|
inline |
Get the application language currently used for GUI etc.
This function has no permanent effect on the global locale.
Definition at line 46 of file StelLocaleMgr.hpp.
StelTranslator& StelLocaleMgr::getAppStelTranslator | ( | ) | const |
Get the StelTranslator object currently used for global application.
|
inline |
Get the timezone name (a TZ-style string - see tzset in the libc manual).
Definition at line 141 of file StelLocaleMgr.hpp.
|
inline |
Get the format string which describes the current date format.
Valid values:
These values correspond to the similarly named values in the SDateFormat enum.
Definition at line 92 of file StelLocaleMgr.hpp.
float StelLocaleMgr::getGMTShift | ( | double | JD = 0 | ) | const |
Get the current time shift in hours at observator time zone with respect to GMT time.
QString StelLocaleMgr::getISO8601TimeLocal | ( | double | JD | ) | const |
Return the time in ISO 8601 format that is : Y-m-dTH:M:S.
JD | the time and date expressed as a Julian date value. |
double StelLocaleMgr::getJdFromISO8601TimeLocal | ( | const QString & | str, |
bool * | ok | ||
) | const |
Return the JD time for a local time ISO 8601 format that is: Y-m-dTH:M:S, but Y can be a large number with sign, and Y can be zero.
str | the local time in ISO 8601 format. |
ok | set to false if the string was an invalid date. |
QString StelLocaleMgr::getPrintableDateLocal | ( | double | JD | ) | const |
Get a localized, formatted string representation of the date component of a Julian date.
QString StelLocaleMgr::getPrintableTimeLocal | ( | double | JD | ) | const |
Get a localized, formatted string representation of the time component of a Julian date.
QString StelLocaleMgr::getSkyLanguage | ( | ) | const |
Get the language currently used for sky objects.
This function has no permanent effect on the global locale.
StelTranslator& StelLocaleMgr::getSkyTranslator | ( | ) |
Get a reference to the StelTranslator object currently used for sky objects.
|
inline |
Get the format string which describes the current time format.
Valid values are:
These values correspond to the similarly named values in the STimeFormat enum.
Definition at line 80 of file StelLocaleMgr.hpp.
|
inline |
Get the current timezone format mode.
Definition at line 146 of file StelLocaleMgr.hpp.
void StelLocaleMgr::init | ( | ) |
Initialize object.
This process includes:
void StelLocaleMgr::setAppLanguage | ( | const QString & | newAppLangName | ) |
Set the application language.
This applies to GUI etc. This function has no permanent effect on the global locale.
newAppLangName | the abbreviated name of the language (e.g fr). |
|
inline |
Set the time zone.
tZ | the time zone string as parsed from the TZ environment varibale by the tzset function from libc. |
Definition at line 98 of file StelLocaleMgr.hpp.
void StelLocaleMgr::setCustomTzName | ( | const QString & | tzname | ) |
Set the timezone by a TZ-style string (see tzset in the libc manual).
|
inline |
Get the current time shift at observator time zone with respect to GMT time.
Definition at line 132 of file StelLocaleMgr.hpp.
void StelLocaleMgr::setSkyLanguage | ( | const QString & | newSkyLangName | ) |
Set the sky language and reload the sky object names with the new translation.
This function has no permanent effect on the global locale.
newSkyLangName | The abbreviated name of the locale (e.g fr) to use for sky object labels. |
|
inline |
Set the time format from a format string.
tf | values are the same as the return values for getTimeFormatStr(). |
Definition at line 83 of file StelLocaleMgr.hpp.