StelLocaleMgr.hpp   StelLocaleMgr.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELLOCALEMGR_HPP_ #ifndef _STELLOCALEMGR_HPP_
#define _STELLOCALEMGR_HPP_ #define _STELLOCALEMGR_HPP_
#include "Translator.hpp" #include "StelTranslator.hpp"
//! @class StelLocaleMgr //! @class StelLocaleMgr
//! Manage i18n operations such as message translation and date/time locali zation. //! Manage i18n operations such as message translation and date/time locali zation.
//! @author Fabien Chereau //! @author Fabien Chereau
class StelLocaleMgr class StelLocaleMgr
{ {
public: public:
StelLocaleMgr(); StelLocaleMgr();
~StelLocaleMgr(); ~StelLocaleMgr();
skipping to change at line 46 skipping to change at line 46
//! - Setting the time and date formats //! - Setting the time and date formats
//! - Setting up the time zone //! - Setting up the time zone
void init(); void init();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// MESSAGES TRANSLATIONS // MESSAGES TRANSLATIONS
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//! Get the application language currently used for GUI etc. //! Get the application language currently used for GUI etc.
//! This function has no permanent effect on the global locale. //! This function has no permanent effect on the global locale.
//! @return the abbreviated name of the language (e.g "fr"). //! @return the abbreviated name of the language (e.g "fr").
QString getAppLanguage() const { return Translator::globalTranslator .getTrueLocaleName(); } QString getAppLanguage() const { return StelTranslator::globalTransl ator.getTrueLocaleName(); }
//! Set the application language. //! Set the application language.
//! This applies to GUI etc. This function has no permanent effect o //! This applies to GUI etc. This function has no permanent effect o
n the n the global locale.
//! global locale. //! @param newAppLangName the abbreviated name of the language (e.g
//! @param newAppLocaleName the abbreviated name of the language (e. fr).
g fr).
void setAppLanguage(const QString& newAppLangName); void setAppLanguage(const QString& newAppLangName);
//! Get the Translator object currently used for global application. //! Get the StelTranslator object currently used for global applicat
Translator& getAppTranslator() const; ion.
StelTranslator& getAppStelTranslator() const;
//! Get the language currently used for sky objects. //! Get the language currently used for sky objects.
//! This function has no permanent effect on the global locale. //! This function has no permanent effect on the global locale.
//! @return the name of the language (e.g fr). //! @return the name of the language (e.g fr).
QString getSkyLanguage() const; QString getSkyLanguage() const;
//! Set the sky language and reload the sky object names with the ne w //! Set the sky language and reload the sky object names with the ne w
//! translation. This function has no permanent effect on the globa l locale. //! translation. This function has no permanent effect on the globa l locale.
//! @param newSkyLangName The abbreviated name of the locale (e.g fr ) to use //! @param newSkyLangName The abbreviated name of the locale (e.g fr ) to use
//! for sky object labels. //! for sky object labels.
void setSkyLanguage(const QString& newSkyLangName); void setSkyLanguage(const QString& newSkyLangName);
//! Get a reference to the Translator object currently used for sky //! Get a reference to the StelTranslator object currently used for
objects. sky objects.
Translator& getSkyTranslator(); StelTranslator& getSkyTranslator();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// DATE & TIME LOCALIZATION // DATE & TIME LOCALIZATION
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//! Get the format string which describes the current time format. //! Get the format string which describes the current time format.
//! Valid values are: //! Valid values are:
//! - "system_default" //! - "system_default"
//! - "24h" //! - "24h"
//! - "12h" //! - "12h"
//! //!
//! These values correspond to the similarly named values in the STi meFormat enum. //! These values correspond to the similarly named values in the STi meFormat enum.
QString getTimeFormatStr(void) const {return sTimeFormatToString(tim eFormat);} QString getTimeFormatStr(void) const {return sTimeFormatToString(tim eFormat);}
//! Set the time format from a format string. //! Set the time format from a format string.
//! @tf value values are the same as the return values for getTimeFo rmatStr(). //! @param tf values are the same as the return values for getTimeFo rmatStr().
void setTimeFormatStr(const QString& tf) {timeFormat=stringToSTimeFo rmat(tf);} void setTimeFormatStr(const QString& tf) {timeFormat=stringToSTimeFo rmat(tf);}
//! Get the format string which describes the current date format. //! Get the format string which describes the current date format.
//! Valid values: //! Valid values:
//! - "mmddyyyy" //! - "mmddyyyy"
//! - "ddmmyyyy" //! - "ddmmyyyy"
//! - "system_default" //! - "system_default"
//! - "yyyymmdd" //! - "yyyymmdd"
//! //!
//! These values correspond to the similarly named values in the SDa teFormat enum. //! These values correspond to the similarly named values in the SDa teFormat enum.
QString getDateFormatStr(void) const {return sDateFormatToString(dat eFormat);} QString getDateFormatStr(void) const {return sDateFormatToString(dat eFormat);}
skipping to change at line 159 skipping to change at line 158
return timeZoneMode; return timeZoneMode;
} }
//! Return the time in ISO 8601 format that is : %Y-%m-%dT%H:%M:%S //! Return the time in ISO 8601 format that is : %Y-%m-%dT%H:%M:%S
//! @param JD the time and date expressed as a Julian date value. //! @param JD the time and date expressed as a Julian date value.
QString getISO8601TimeLocal(double JD) const; QString getISO8601TimeLocal(double JD) const;
//! Return the JD time for a local time ISO 8601 format that is: //! Return the JD time for a local time ISO 8601 format that is:
//! %Y-%m-%dT%H:%M:%S, but %Y can be a large number with sign, and //! %Y-%m-%dT%H:%M:%S, but %Y can be a large number with sign, and
//! %Y can be zero. //! %Y can be zero.
//! @param JD the time and date expressed as a Julian date value. //! @param str the local time in ISO 8601 format
double getJdFromISO8601TimeLocal(const QString&) const; double getJdFromISO8601TimeLocal(const QString& str) const;
//! Convert a 2 letter country code to string //! Convert a 2 letter country code to string
static QString countryCodeToString(const QString& countryCode); static QString countryCodeToString(const QString& countryCode);
//! Return a list of all the known country names //! Return a list of all the known country names
static QStringList getAllCountryNames(); static QStringList getAllCountryNames();
private: private:
// The translator used for astronomical object naming // The translator used for astronomical object naming
Translator skyTranslator; StelTranslator skyTranslator;
// Date and time variables // Date and time variables
STimeFormat timeFormat; STimeFormat timeFormat;
SDateFormat dateFormat; SDateFormat dateFormat;
STzFormat timeZoneMode; // Can be the system default or a us er defined value STzFormat timeZoneMode; // Can be the system default or a us er defined value
QString customTzName; // Something like "Europe/Pa ris" QString customTzName; // Something like "Europe/Pa ris"
float GMTShift; // Time shift between GMT ti me and local time in hour. (positive for Est of GMT) float GMTShift; // Time shift between GMT ti me and local time in hour. (positive for Est of GMT)
// Convert the time format enum to its associated string and reverse // Convert the time format enum to its associated string and reverse
 End of changes. 8 change blocks. 
16 lines changed or deleted 16 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/