Stellarium 0.14.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 <QObject>
24 #include <QMap>
25 #include <QString>
26 #include <QStringList>
27 
31 {
32 public:
34  QString englishName;
36  QString author;
37 };
38 
47 class StelSkyCultureMgr : public QObject
48 {
49  Q_OBJECT
50 
51 public:
54 
58  void init();
59 
61  StelSkyCulture getSkyCulture() const {return currentSkyCulture;}
62 
63 public slots:
65  QString getCurrentSkyCultureEnglishName() const;
67  QString getCurrentSkyCultureNameI18() const;
70  bool setCurrentSkyCultureNameI18(const QString& cultureName) {return setCurrentSkyCultureID(skyCultureI18ToDirectory(cultureName));}
71 
73  QString getCurrentSkyCultureID() {return currentSkyCultureDir;}
77  bool setCurrentSkyCultureID(const QString& id);
78 
80  QString getDefaultSkyCultureID() {return defaultSkyCultureID;}
84  bool setDefaultSkyCultureID(const QString& id);
85 
88  QString getSkyCultureListEnglish(void);
89 
92  QStringList getSkyCultureListI18(void);
93 
95  QStringList getSkyCultureListIDs(void);
96 
97 private:
101  QString directoryToSkyCultureEnglish(const QString& directory);
102 
107  QString directoryToSkyCultureI18(const QString& directory) const;
108 
112  QString skyCultureI18ToDirectory(const QString& cultureName) const;
113 
114  QMap<QString, StelSkyCulture> dirToNameEnglish;
115 
116  // The directory containing data for the culture used for constellations, etc..
117  QString currentSkyCultureDir;
118  StelSkyCulture currentSkyCulture;
119 
120  QString defaultSkyCultureID;
121 };
122 
123 #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.