![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
00001 /* 00002 * Stellarium 00003 * Copyright (C) 2006 Fabien Chereau 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _STELSKYCULTUREMGR_HPP_ 00021 #define _STELSKYCULTUREMGR_HPP_ 00022 00023 #include <QMap> 00024 #include <QString> 00025 #include <QStringList> 00026 00029 class StelSkyCulture 00030 { 00031 public: 00033 QString englishName; 00035 QString author; 00036 }; 00037 00045 class StelSkyCultureMgr{ 00046 public: 00047 StelSkyCultureMgr(); 00048 ~StelSkyCultureMgr(); 00049 00053 void init(); 00054 00056 StelSkyCulture getSkyCulture() const {return currentSkyCulture;} 00057 00058 public slots: 00060 QString getCurrentSkyCultureNameI18() const; 00063 bool setCurrentSkyCultureNameI18(const QString& cultureName) {return setCurrentSkyCultureID(skyCultureI18ToDirectory(cultureName));} 00064 00066 QString getCurrentSkyCultureID() {return currentSkyCultureDir;} 00070 bool setCurrentSkyCultureID(const QString& id); 00071 00073 QString getDefaultSkyCultureID() {return defaultSkyCultureID;} 00077 bool setDefaultSkyCultureID(const QString& id); 00078 00081 QString getSkyCultureListEnglish(void); 00082 00085 QStringList getSkyCultureListI18(void); 00086 00087 private: 00091 QString directoryToSkyCultureEnglish(const QString& directory); 00092 00097 QString directoryToSkyCultureI18(const QString& directory) const; 00098 00102 QString skyCultureI18ToDirectory(const QString& cultureName) const; 00103 00104 QMap<QString, StelSkyCulture> dirToNameEnglish; 00105 00106 // The directory containing data for the culture used for constellations, etc.. 00107 QString currentSkyCultureDir; 00108 StelSkyCulture currentSkyCulture; 00109 00110 QString defaultSkyCultureID; 00111 }; 00112 00113 #endif // _STELSKYCULTUREMGR_HPP_