Stellarium 0.12.3
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 
30 class Lens : public QObject
31 {
32  Q_OBJECT
33  Q_PROPERTY(QString name READ name WRITE setName)
34  Q_PROPERTY(double multipler READ multipler WRITE setMultipler)
35 
36 public:
37  Lens();
38  Q_INVOKABLE Lens(const QObject& other);
39  virtual ~Lens();
40  static Lens* lensFromSettings(QSettings* theSettings, int lensIndex);
41  static Lens* lensModel();
42 
43  double multipler() const;
44  void setMultipler(double theValue);
45  const QString name() const;
46  void setName(const QString& theValue);
47  QMap<int, QString> propertyMap();
48 
49 private:
50  QString m_name;
51  double m_multipler;
52 };
53 
54 #endif