Stellarium 0.13.3
StelSkyCultureMgr.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2006 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _STELSKYCULTUREMGR_HPP_
21 #define _STELSKYCULTUREMGR_HPP_
22 
23 #include <QMap>
24 #include <QString>
25 #include <QStringList>
26 
30 {
31 public:
33  QString englishName;
35  QString author;
36 };
37 
46 class StelSkyCultureMgr : public QObject
47 {
48  Q_OBJECT
49 
50 public:
53 
57  void init();
58 
60  StelSkyCulture getSkyCulture() const {return currentSkyCulture;}
61 
62 public slots:
64  QString getCurrentSkyCultureEnglishName() const;
66  QString getCurrentSkyCultureNameI18() const;
69  bool setCurrentSkyCultureNameI18(const QString& cultureName) {return setCurrentSkyCultureID(skyCultureI18ToDirectory(cultureName));}
70 
72  QString getCurrentSkyCultureID() {return currentSkyCultureDir;}
76  bool setCurrentSkyCultureID(const QString& id);
77 
79  QString getDefaultSkyCultureID() {return defaultSkyCultureID;}
83  bool setDefaultSkyCultureID(const QString& id);
84 
87  QString getSkyCultureListEnglish(void);
88 
91  QStringList getSkyCultureListI18(void);
92 
94  QStringList getSkyCultureListIDs(void);
95 
96 private:
100  QString directoryToSkyCultureEnglish(const QString& directory);
101 
106  QString directoryToSkyCultureI18(const QString& directory) const;
107 
111  QString skyCultureI18ToDirectory(const QString& cultureName) const;
112 
113  QMap<QString, StelSkyCulture> dirToNameEnglish;
114 
115  // The directory containing data for the culture used for constellations, etc..
116  QString currentSkyCultureDir;
117  StelSkyCulture currentSkyCulture;
118 
119  QString defaultSkyCultureID;
120 };
121 
122 #endif // _STELSKYCULTUREMGR_HPP_
QStringList getSkyCultureListIDs(void)
Get a list of sky culture IDs.
QString getCurrentSkyCultureNameI18() const
Get the current sky culture translated name.
QString englishName
English name.
QString getCurrentSkyCultureEnglishName() const
Get the current sky culture English name.
bool setDefaultSkyCultureID(const QString &id)
Set the default sky culture from the ID.
StelSkyCulture getSkyCulture() const
Get the current sky culture.
bool setCurrentSkyCultureID(const QString &id)
Set the current sky culture from the ID.
Manage sky cultures for stellarium.
QString getCurrentSkyCultureID()
Get the current sky culture ID.
Store basic info about a sky culture for stellarium.
void init()
Initialize the StelSkyCultureMgr object.
QString getSkyCultureListEnglish(void)
Get a list of sky culture names in English.
QString getDefaultSkyCultureID()
Get the default sky culture ID.
QStringList getSkyCultureListI18(void)
Get a list of sky culture names in the current language.
bool setCurrentSkyCultureNameI18(const QString &cultureName)
Set the sky culture from i18n name.
QString author
Name of the author.