Kstars

printingwizard.h
1 /*
2  SPDX-FileCopyrightText: 2011 Rafał Kułaga <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef PRINTINGWIZARD_H
8 #define PRINTINGWIZARD_H
9 
10 #include "ui_pwizwelcome.h"
11 
12 #include "QDialog"
13 #include "simplefovexporter.h"
14 #include "fovsnapshot.h"
15 #include "QSize"
16 
17 class KStars;
19 class PWizFovBrowseUI;
21 class PWizFovConfigUI;
22 class PWizFovManualUI;
23 class PWizFovShUI;
24 class PWizChartConfigUI;
26 class PWizPrintUI;
27 class FinderChart;
28 class SkyObject;
29 class QStackedWidget;
30 class QPrinter;
31 
32 /**
33  * \class PWizWelcomeUI
34  * \brief User interface for the first step of the Printing Wizard.
35  * \author Rafał Kułaga
36  */
37 class PWizWelcomeUI : public QFrame, public Ui::PWizWelcome
38 {
39  Q_OBJECT
40  public:
41  /**
42  * \brief Constructor.
43  */
44  explicit PWizWelcomeUI(QWidget *parent = nullptr);
45 };
46 
47 /**
48  * \class PrintingWizard
49  * \brief Class representing Printing Wizard for KStars printed documents (currently only finder charts).
50  * \author Rafał Kułaga
51  */
52 class PrintingWizard : public QDialog
53 {
54  Q_OBJECT
55  public:
56  /**
57  * \brief Wizard steps enumeration.
58  */
60  {
61  PW_WELCOME = 0,
62  PW_OBJECT_SELECTION = 1,
63  PW_CHART_CONFIG = 2,
64  PW_FOV_TYPE = 3,
65  PW_FOV_CONFIG = 4,
66  PW_FOV_MANUAL = 5,
67  PW_FOV_SH = 6,
68  PW_FOV_BROWSE = 7,
69  PW_CHART_CONTENTS = 8,
70  PW_CHART_PRINT = 9
71  };
72 
73  /**
74  * \brief FOV export method type enumeration.
75  */
76  enum FOV_TYPE
77  {
78  FT_MANUAL,
79  FT_STARHOPPER,
80  FT_UNDEFINED
81  };
82 
83  /**
84  * \brief Constructor.
85  */
86  explicit PrintingWizard(QWidget *parent = nullptr);
87 
88  /**
89  * \brief Destructor.
90  */
91  ~PrintingWizard() override;
92 
93  /**
94  * \brief Get used FOV export method.
95  * \return Selected FOV export method.
96  */
97  FOV_TYPE getFovType() { return m_FovType; }
98 
99  /**
100  * \brief Get printer used by Printing Wizard.
101  * \return Used printer.
102  */
103  QPrinter *getPrinter() { return m_Printer; }
104 
105  /**
106  * \brief Get used FinderChart document.
107  * \return Used FinderChart document.
108  */
109  FinderChart *getFinderChart() { return m_FinderChart; }
110 
111  /**
112  * \brief Get selected SkyObject, for which FinderChart is created.
113  * \return Selected SkyObject.
114  */
115  SkyObject *getSkyObject() { return m_SkyObject; }
116 
117  /**
118  * \brief Get FovSnapshot list.
119  * \return Used FovSnapshot list.
120  */
121  QList<FovSnapshot *> *getFovSnapshotList() { return &m_FovSnapshots; }
122 
123  /**
124  * \brief Get FOV snapshot image size.
125  * \return Size of the FOV snapshot image.
126  */
127  QSize getFovImageSize() { return m_FovImageSize; }
128 
129  /**
130  * \brief Get pointer to the SimpleFovExporter class instance.
131  * \return Pointer to the SimpleFovExporter instance used by Printing Wizard.
132  */
133  SimpleFovExporter *getFovExporter() { return &m_SimpleFovExporter; }
134 
135  /**
136  * \brief Get object at which star hopping will begin.
137  * \return Source object for star hopper.
138  */
139  SkyObject *getShBeginObject() { return m_ShBeginObject; }
140 
141  /**
142  * \brief Set SkyObject for which FinderChart is created.
143  * \return SkyObject for which finder chart is created.
144  */
145  void setSkyObject(SkyObject *obj) { m_SkyObject = obj; }
146 
147  /**
148  * \brief Set SkyObject at which star hopper will begin.
149  * \return SkyObject at which star hopper will begin.
150  */
151  void setShBeginObject(SkyObject *obj) { m_ShBeginObject = obj; }
152 
153  /**
154  * \brief Update Next/Previous step buttons.
155  */
156  void updateStepButtons();
157 
158  /**
159  * \brief Set SkyMap to pointing mode and hide Printing Wizard.
160  */
161  void beginPointing();
162 
163  /**
164  * \brief Enter star hopping begin pointing mode.
165  */
166  void beginShBeginPointing();
167 
168  /**
169  * \brief Quit object pointing mode and set the pointed object.
170  * \param obj Pointer to the SkyObject that was pointed on SkyMap.
171  */
172  void pointingDone(SkyObject *obj);
173 
174  /**
175  * \brief Hide Printing Wizard and put SkyMap in FOV capture mode.
176  */
177  void beginFovCapture();
178 
179  /**
180  * \brief Hide Printing Wizard and put SkyMap in FOV capture mode.
181  * \param center Point at which SkyMap should be centered.
182  * \param fov Field of view symbol, used to calculate zoom factor.
183  */
184  void beginFovCapture(SkyPoint *center, FOV *fov = nullptr);
185 
186  /**
187  * \brief Capture current contents of FOV symbol.
188  */
189  void captureFov();
190 
191  /**
192  * \brief Disable FOV capture mode.
193  */
194  void fovCaptureDone();
195 
196  /**
197  * \brief Capture FOV snapshots using star hopper-based method.
198  */
199  void beginShFovCapture();
200 
201  /**
202  * \brief Recapture FOV snapshot of passed index.
203  * \param idx Index of the element to be recaptured.
204  */
205  void recaptureFov(int idx);
206 
207  private slots:
208  /**
209  * \brief Slot: go to the previous page of Printing Wizard.
210  */
211  void slotPrevPage();
212 
213  /**
214  * \brief Slot: go to the next page of Printing Wizard.
215  */
216  void slotNextPage();
217 
218  private:
219  /**
220  * \brief Setup widget properties.
221  */
222  void setupWidgets();
223 
224  /**
225  * \brief Update Previous/Next buttons.
226  */
227  void updateButtons();
228 
229  /**
230  * \brief Private method, used to center SkyMap around passed SkyPoint, and enter FOV capture mode.
231  * \param center Point at which SkyMap should be centered.
232  * \param fov Field of view symbol, used to calculate zoom factor.
233  */
234  void slewAndBeginCapture(SkyPoint *center, FOV *fov = nullptr);
235 
236  /**
237  * \brief Create finder chart using settings from all steps.
238  */
239  void createFinderChart();
240 
241  KStars *m_KStars;
242  FinderChart *m_FinderChart;
243  SkyObject *m_SkyObject;
244  QStackedWidget *m_WizardStack;
245  QPrinter *m_Printer;
246 
247  FOV_TYPE m_FovType;
248  QSize m_FovImageSize;
249  SimpleFovExporter m_SimpleFovExporter;
250 
251  QList<FovSnapshot *> m_FovSnapshots;
252 
253  SkyObject *m_ShBeginObject;
254  bool m_PointingShBegin;
255 
256  bool m_SwitchColors;
257  QString m_PrevSchemeName;
258 
259  bool m_RecapturingFov;
260  int m_RecaptureIdx;
261 
262  QPushButton *nextB, *backB;
263 
264  PWizWelcomeUI *m_WizWelcomeUI;
265  PWizObjectSelectionUI *m_WizObjectSelectionUI;
266  PWizFovTypeSelectionUI *m_WizFovTypeSelectionUI;
267  PWizFovConfigUI *m_WizFovConfigUI;
268  PWizFovManualUI *m_WizFovManualUI;
269  PWizFovShUI *m_WizFovShUI;
270  PWizFovBrowseUI *m_WizFovBrowseUI;
271  PWizChartConfigUI *m_WizChartConfigUI;
272  PWizChartContentsUI *m_WizChartContentsUI;
273  PWizPrintUI *m_WizPrintUI;
274 };
275 
276 #endif // PRINTINGWIZARD_H
Q_OBJECTQ_OBJECT
Definition: fov.h:27
SimpleFovExporter class is used for FOV representation exporting. Central point is defined by passed ...
User interface for last "Print and export finder chart" step of the Printing Wizard.
Definition: pwizprint.h:21
SkyObject * getShBeginObject()
Get object at which star hopping will begin.
Class that represents finder chart document. FinderChart class is a subclass of KStarsDocument class,...
Definition: finderchart.h:29
SkyObject * getSkyObject()
Get selected SkyObject, for which FinderChart is created.
User interface for the first step of the Printing Wizard.
~PrintingWizard() override
Destructor.
Class representing Printing Wizard for KStars printed documents (currently only finder charts).
QPrinter * getPrinter()
Get printer used by Printing Wizard.
User interface for "Configure basic finder chart settings" step of the Printing Wizard.
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
void fovCaptureDone()
Disable FOV capture mode.
void beginShFovCapture()
Capture FOV snapshots using star hopper-based method.
void beginFovCapture()
Hide Printing Wizard and put SkyMap in FOV capture mode.
SimpleFovExporter * getFovExporter()
Get pointer to the SimpleFovExporter class instance.
void updateStepButtons()
Update Next/Previous step buttons.
PWizWelcomeUI(QWidget *parent=nullptr)
Constructor.
User interface for "Configure common FOV export options" step of the Printing Wizard.
Definition: pwizfovconfig.h:18
PrintingWizard(QWidget *parent=nullptr)
Constructor.
User interface for "Select FOV capture method" step of the Printing Wizard.
WIZARD_STEPS
Wizard steps enumeration.
User interface for "Select observed object" step of the Printing Wizard.
User interface for "Configure chart contents" step of the Printing Wizard.
void beginShBeginPointing()
Enter star hopping begin pointing mode.
User interface for "Manual FOV capture" step of the Printing Wizard.
Definition: pwizfovmanual.h:19
QSize getFovImageSize()
Get FOV snapshot image size.
This is the main window for KStars. In addition to the GUI elements, the class contains the program c...
Definition: kstars.h:92
User interface for "Browse captured FOV images" step of Printing Wizard.
Definition: pwizfovbrowse.h:19
FinderChart * getFinderChart()
Get used FinderChart document.
FOV_TYPE getFovType()
Get used FOV export method.
void setSkyObject(SkyObject *obj)
Set SkyObject for which FinderChart is created.
void beginPointing()
Set SkyMap to pointing mode and hide Printing Wizard.
void pointingDone(SkyObject *obj)
Quit object pointing mode and set the pointed object.
void captureFov()
Capture current contents of FOV symbol.
QList< FovSnapshot * > * getFovSnapshotList()
Get FovSnapshot list.
void setShBeginObject(SkyObject *obj)
Set SkyObject at which star hopper will begin.
Information about an object in the sky.
Definition: skyobject.h:41
QObject * parent() const const
FOV_TYPE
FOV export method type enumeration.
User interface for "Star hopper FOV snapshot capture" step of the Printing Wizard.
Definition: pwizfovsh.h:20
void recaptureFov(int idx)
Recapture FOV snapshot of passed index.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:13:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.