Stellarium 0.15.2
Telescope.hpp
1 /*
2  * Copyright (C) 2009 Timothy Reaves
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef TELESCOPE_HPP_
20 #define TELESCOPE_HPP_
21 
22 #include <QObject>
23 #include <QString>
24 #include <QSettings>
25 
27 class Telescope : public QObject
28 {
29  Q_OBJECT
30  Q_PROPERTY(QString name READ name WRITE setName)
31  Q_PROPERTY(double diameter READ diameter WRITE setDiameter)
32  Q_PROPERTY(double focalLength READ focalLength WRITE setFocalLength)
33  Q_PROPERTY(bool hFlipped READ isHFlipped WRITE setHFlipped)
34  Q_PROPERTY(bool vFlipped READ isVFlipped WRITE setVFlipped)
35  Q_PROPERTY(bool equatorial READ isEquatorial WRITE setEquatorial)
36 public:
37  Telescope();
38  Q_INVOKABLE Telescope(const QObject& other);
39  virtual ~Telescope();
40  static Telescope* telescopeFromSettings(QSettings* theSettings, int telescopeIndex);
41  void writeToSettings(QSettings * settings, const int index);
42  static Telescope* telescopeModel();
43 
44  double diameter() const;
45  void setDiameter(double theValue);
46  double focalLength() const;
47  void setFocalLength(double theValue);
48  const QString name() const;
49  void setName(QString theValue);
50  bool isHFlipped() const;
51  void setHFlipped(bool flipped);
52  bool isVFlipped() const;
53  void setVFlipped(bool flipped);
54  bool isEquatorial() const;
55  void setEquatorial(bool eq);
56  QMap<int, QString> propertyMap();
57 private:
58  QString m_name;
59  double m_diameter;
60  double m_focalLength;
61  bool m_hFlipped;
62  bool m_vFlipped;
63  bool m_equatorial;
64 };
65 
66 #endif /*TELESCOPE_HPP_*/