Stellarium 0.12.3
OcularDialog.hpp
1 /*
2  * Copyright (C) 2009 Timothy Reaves
3  * Copyright (C) 2011 Bogdan Marinov
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 _OCULARDIALOG_HPP_
21 #define _OCULARDIALOG_HPP_
22 
23 #include <QObject>
24 #include "CCD.hpp"
25 #include "Ocular.hpp"
26 #include "PropertyBasedTableModel.hpp"
27 #include "StelDialog.hpp"
28 #include "StelStyle.hpp"
29 #include "Telescope.hpp"
30 #include "Lens.hpp"
31 
32 class Ui_ocularDialogForm;
33 
34 QT_BEGIN_NAMESPACE
35 class QDataWidgetMapper;
36 class QDoubleValidator;
37 class QIntValidator;
38 class QRegExpValidator;
39 class QModelIndex;
40 class QStandardItemModel;
41 QT_END_NAMESPACE
42 
43 class Oculars;
44 
45 class OcularDialog : public StelDialog
46 {
47  Q_OBJECT
48 
49 public:
50  OcularDialog(Oculars* plugin, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes, QList<Lens *>* lense);
51  virtual ~OcularDialog();
53  void styleChanged();
54  void updateStyle();
55 
56 public slots:
57  void closeWindow();
58  void deleteSelectedCCD();
59  void deleteSelectedOcular();
60  void deleteSelectedTelescope();
61  void deleteSelectedLens();
62  void insertNewCCD();
63  void insertNewOcular();
64  void insertNewTelescope();
65  void insertNewLens();
66  void moveUpSelectedSensor();
67  void moveUpSelectedOcular();
68  void moveUpSelectedTelescope();
69  void moveUpSelectedLens();
70  void moveDownSelectedSensor();
71  void moveDownSelectedOcular();
72  void moveDownSelectedTelescope();
73  void moveDownSelectedLens();
74  void retranslate();
75 
76 signals:
77  void requireSelectionChanged(bool state);
78  void scaleImageCircleChanged(bool state);
79 
80 protected:
82  virtual void createDialogContent();
83  Ui_ocularDialogForm* ui;
84 
85 private slots:
86  void keyBindingTogglePluginChanged(const QString& newString);
87  void keyBindingPopupNavigatorConfigChanged(const QString& newString);
88  void initAboutText();
89  void requireSelectionStateChanged(int state);
90  void scaleImageCircleStateChanged(int state);
91 
92 private:
93  Oculars* plugin;
94 
95  QDataWidgetMapper* ccdMapper;
96  QList<CCD *>* ccds;
97  PropertyBasedTableModel* ccdTableModel;
98  QDataWidgetMapper* ocularMapper;
99  QList<Ocular *>* oculars;
100  PropertyBasedTableModel* ocularTableModel;
101  QDataWidgetMapper* telescopeMapper;
102  QList<Telescope *>* telescopes;
103  PropertyBasedTableModel* telescopeTableModel;
104  QDataWidgetMapper* lensMapper;
105  QList<Lens *>* lense;
106  PropertyBasedTableModel* lensTableModel;
107  QDoubleValidator* validatorOcularAFOV;
108  QDoubleValidator* validatorOcularEFL;
109  QDoubleValidator* validatorTelescopeDiameter;
110  QDoubleValidator* validatorTelescopeFL;
111  QDoubleValidator* validatorLensMultipler;
112  QRegExpValidator* validatorName;
113  QIntValidator* validatorPositiveInt;
114  QDoubleValidator* validatorPositiveDouble;
115 };
116 
117 #endif // _OCULARDIALOG_HPP_