Stellarium  0.90.0
Lens.hpp
1 /*
2  * Copyright (C) 2009 Timothy Reaves
3  * Copyright (C) 2013 Pawel Stolowski
4  * Copyright (C) 2013 Alexander Wolf
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef LENS_HPP_
22 #define LENS_HPP_
23 
24 #include <QObject>
25 #include <QString>
26 #include <QMap>
27 
28 class QSettings;
29 
31 class Lens : public QObject
32 {
33  Q_OBJECT
34  Q_PROPERTY(QString name READ getName WRITE setName)
35  Q_PROPERTY(double multipler READ getMultipler WRITE setMultipler)
36 
37 public:
38  Lens();
39  Q_INVOKABLE Lens(const QObject& other);
40  virtual ~Lens();
41  static Lens* lensFromSettings(QSettings* theSettings, int lensIndex);
42  void writeToSettings(QSettings * settings, const int index);
43  static Lens* lensModel();
44 
45  double getMultipler() const;
46  void setMultipler(double theValue);
47  const QString getName() const;
48  void setName(const QString& theValue);
49  QMap<int, QString> propertyMap();
50 
51 private:
52  QString m_name;
53  double m_multipler;
54 };
55 
56 #endif
Definition: Lens.hpp:31