Stellarium 0.11.4 | |||
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, 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 : public QObject 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 StelSkyCultureMgr(); 00051 ~StelSkyCultureMgr(); 00052 00056 void init(); 00057 00059 StelSkyCulture getSkyCulture() const {return currentSkyCulture;} 00060 00061 public slots: 00063 QString getCurrentSkyCultureNameI18() const; 00066 bool setCurrentSkyCultureNameI18(const QString& cultureName) {return setCurrentSkyCultureID(skyCultureI18ToDirectory(cultureName));} 00067 00069 QString getCurrentSkyCultureID() {return currentSkyCultureDir;} 00073 bool setCurrentSkyCultureID(const QString& id); 00074 00076 QString getDefaultSkyCultureID() {return defaultSkyCultureID;} 00080 bool setDefaultSkyCultureID(const QString& id); 00081 00084 QString getSkyCultureListEnglish(void); 00085 00088 QStringList getSkyCultureListI18(void); 00089 00091 QStringList getSkyCultureListIDs(void); 00092 00093 private: 00097 QString directoryToSkyCultureEnglish(const QString& directory); 00098 00103 QString directoryToSkyCultureI18(const QString& directory) const; 00104 00108 QString skyCultureI18ToDirectory(const QString& cultureName) const; 00109 00110 QMap<QString, StelSkyCulture> dirToNameEnglish; 00111 00112 // The directory containing data for the culture used for constellations, etc.. 00113 QString currentSkyCultureDir; 00114 StelSkyCulture currentSkyCulture; 00115 00116 QString defaultSkyCultureID; 00117 }; 00118 00119 #endif // _STELSKYCULTUREMGR_HPP_