3
* Copyright (C) 2006 Fabien Chereau
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#ifndef STELSKYCULTUREMGR_H
21
#define STELSKYCULTUREMGR_H
31
//! @class StelSkyCultureMgr
32
//! Manage sky cultures for stellarium.
33
//! Different human cultures have used different names for stars, and visualised
34
//! different constellations in the sky (and in different parts of the sky). The
35
//! StelSkyCultureMgr class handles the different sky cultures.
36
//! @author Fabien Chereau
37
class StelSkyCultureMgr{
42
//! Initialize the StelSkyCultureMgr object.
43
//! Gets the default sky culture name from the ini parser object and
44
//! sets that sky culture by calling setSkyCultureDir().
45
//! @param conf The ini parser object which contains the default sky
47
void init(const InitParser& conf);
49
//! Set the sky culture from i18n name.
50
//! @return true on success; false and doesn't change if skyculture is invalid.
51
bool setSkyCulture(const wstring& cultureName) {return setSkyCultureDir(skyCultureToDirectory(cultureName));}
53
//! Get the current sky culture i18n name.
54
wstring getSkyCulture() const;
56
//! Set the current sky culture from the passed directory.
57
//! In in the installatiom data directory and user data directory,
58
//! we have the "skycultures" sub-directory. Inside this there is
59
//! one sub-directory per sky culture. This sub-directory name
60
//! is that we refer to here.
61
//! @param cultureDir The sub-directory name inside the "skycultures"
63
//! @return true on success; else false.
64
bool setSkyCultureDir(const QString& cultureDir);
66
//! Get the current sky culture directory name.
67
QString getSkyCultureDir() {return skyCultureDir;}
69
//! Get a hash of translated culture names and directories.
70
//! @return A newline delimited list of translated culture names and directories
71
//! e.g. "name1\ndir1\name2\ndir2".
72
wstring getSkyCultureHash() const;
74
//! Get a list of sky culture names in English.
75
//! @return A new-line delimited list of English sky culture names.
76
string getSkyCultureListEnglish(void);
78
//! Get a list of sky culture names in the current language.
79
//! @return A new-line delimited list of translated sky culture names.
80
wstring getSkyCultureListI18(void);
82
//! Get the culture name in English associated with a specified directory.
83
//! @param directory The directory name.
84
//! @return The English name for the culture associated with directory.
85
string directoryToSkyCultureEnglish(const QString& directory);
87
//! Get the culture name translated to current language associated with
88
//! a specified directory.
89
//! @param directory The directory name.
90
//! @return The translated name for the culture associated with directory.
91
wstring directoryToSkyCultureI18(const QString& directory) const;
93
//! Get the directory associated with a specified translated culture name.
94
//! @param cultureName The culture name in the current language.
95
//! @return The directory assocuated with cultureName.
96
QString skyCultureToDirectory(const wstring& cultureName);
99
map<QString, string> dirToNameEnglish;
101
// The directory containing data for the culture used for constellations, etc..
102
QString skyCultureDir;