Stellarium 0.90.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 <QObject>
24 #include <QMap>
25 #include <QString>
26 #include <QStringList>
27 
31 {
32 public:
34  QString englishName;
36  QString author;
39 };
40 
49 class StelSkyCultureMgr : public QObject
50 {
51  Q_OBJECT
52  Q_PROPERTY(QString currentSkyCultureID
53  READ getCurrentSkyCultureID
54  WRITE setCurrentSkyCultureID
55  NOTIFY currentSkyCultureChanged)
56 
57 public:
60 
64  void init();
65 
67  StelSkyCulture getSkyCulture() const {return currentSkyCulture;}
68 
69 public slots:
71  QString getCurrentSkyCultureEnglishName() const;
73  QString getCurrentSkyCultureNameI18() const;
76  bool setCurrentSkyCultureNameI18(const QString& cultureName);
77 
79  QString getCurrentSkyCultureID() const {return currentSkyCultureDir;}
83  bool setCurrentSkyCultureID(const QString& id);
84 
91  int getCurrentSkyCultureBoundariesIdx() const;
92 
95  QString getCurrentSkyCultureHtmlDescription() const;
96 
98  QString getDefaultSkyCultureID() {return defaultSkyCultureID;}
102  bool setDefaultSkyCultureID(const QString& id);
103 
106  QString getSkyCultureListEnglish(void);
107 
110  QStringList getSkyCultureListI18(void);
111 
113  QStringList getSkyCultureListIDs(void);
114 
116  QMap<QString, StelSkyCulture> getDirToNameMap() const { return dirToNameEnglish; }
117 
118 signals:
121  void defaultSkyCultureChanged(const QString& id);
122 
124  void currentSkyCultureChanged(const QString& id);
125 
126 private:
130  QString directoryToSkyCultureEnglish(const QString& directory);
131 
136  QString directoryToSkyCultureI18(const QString& directory) const;
137 
141  QString skyCultureI18ToDirectory(const QString& cultureName) const;
142 
143  QMap<QString, StelSkyCulture> dirToNameEnglish;
144 
145  // The directory containing data for the culture used for constellations, etc..
146  QString currentSkyCultureDir;
147  StelSkyCulture currentSkyCulture;
148 
149  QString defaultSkyCultureID;
150 };
151 
152 #endif // _STELSKYCULTUREMGR_HPP_
QString getCurrentSkyCultureID() const
Get the current sky culture ID.
QString englishName
English name.
StelSkyCulture getSkyCulture() const
Get the current sky culture.
int boundariesIdx
Type of the boundaries (-1=none;0=generic;1=own)
Manage sky cultures for stellarium.
Store basic info about a sky culture for stellarium.
QMap< QString, StelSkyCulture > getDirToNameMap() const
Returns a map from sky culture IDs/folders to sky culture names.
QString getDefaultSkyCultureID()
Get the default sky culture ID.
QString author
Name of the author.