Stellarium 0.13.0
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 
45 class StelSkyCultureMgr : public QObject
46 {
47  Q_OBJECT
48 
49 public:
52 
56  void init();
57 
59  StelSkyCulture getSkyCulture() const {return currentSkyCulture;}
60 
61 public slots:
63  QString getCurrentSkyCultureEnglishName() const;
65  QString getCurrentSkyCultureNameI18() const;
68  bool setCurrentSkyCultureNameI18(const QString& cultureName) {return setCurrentSkyCultureID(skyCultureI18ToDirectory(cultureName));}
69 
71  QString getCurrentSkyCultureID() {return currentSkyCultureDir;}
75  bool setCurrentSkyCultureID(const QString& id);
76 
78  QString getDefaultSkyCultureID() {return defaultSkyCultureID;}
82  bool setDefaultSkyCultureID(const QString& id);
83 
86  QString getSkyCultureListEnglish(void);
87 
90  QStringList getSkyCultureListI18(void);
91 
93  QStringList getSkyCultureListIDs(void);
94 
95 private:
99  QString directoryToSkyCultureEnglish(const QString& directory);
100 
105  QString directoryToSkyCultureI18(const QString& directory) const;
106 
110  QString skyCultureI18ToDirectory(const QString& cultureName) const;
111 
112  QMap<QString, StelSkyCulture> dirToNameEnglish;
113 
114  // The directory containing data for the culture used for constellations, etc..
115  QString currentSkyCultureDir;
116  StelSkyCulture currentSkyCulture;
117 
118  QString defaultSkyCultureID;
119 };
120 
121 #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.
Definition: StelSkyCultureMgr.hpp:33
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.
Definition: StelSkyCultureMgr.hpp:59
bool setCurrentSkyCultureID(const QString &id)
Set the current sky culture from the ID.
Manage sky cultures for stellarium.
Definition: StelSkyCultureMgr.hpp:45
QString getCurrentSkyCultureID()
Get the current sky culture ID.
Definition: StelSkyCultureMgr.hpp:71
Store basic info about a sky culture for stellarium.
Definition: StelSkyCultureMgr.hpp:29
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.
Definition: StelSkyCultureMgr.hpp:78
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.
Definition: StelSkyCultureMgr.hpp:68
QString author
Name of the author.
Definition: StelSkyCultureMgr.hpp:35