Kstars

printingwizard.h
1/*
2 SPDX-FileCopyrightText: 2011 Rafał Kułaga <rl.kulaga@gmail.com>
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
17class KStars;
19class PWizFovBrowseUI;
21class PWizFovConfigUI;
22class PWizFovManualUI;
23class PWizFovShUI;
26class PWizPrintUI;
27class FinderChart;
28class SkyObject;
29class QStackedWidget;
30class QPrinter;
31
32/**
33 * \class PWizWelcomeUI
34 * \brief User interface for the first step of the Printing Wizard.
35 * \author Rafał Kułaga
36 */
37class PWizWelcomeUI : public QFrame, public Ui::PWizWelcome
38{
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 */
52class PrintingWizard : public QDialog
53{
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 */
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 */
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
A simple class encapsulating a Field-of-View symbol.
Definition fov.h:28
Class that represents finder chart document.
Definition finderchart.h:30
This is the main window for KStars.
Definition kstars.h:89
User interface for "Configure basic finder chart settings" step of the Printing Wizard.
User interface for "Configure chart contents" step of the Printing Wizard.
User interface for "Browse captured FOV images" step of Printing Wizard.
User interface for "Configure common FOV export options" step of the Printing Wizard.
User interface for "Manual FOV capture" step of the Printing Wizard.
User interface for "Star hopper FOV snapshot capture" step of the Printing Wizard.
Definition pwizfovsh.h:21
User interface for "Select FOV capture method" step of the Printing Wizard.
User interface for "Select observed object" step of the Printing Wizard.
User interface for last "Print and export finder chart" step of the Printing Wizard.
Definition pwizprint.h:22
User interface for the first step of the Printing Wizard.
PWizWelcomeUI(QWidget *parent=nullptr)
Constructor.
Class representing Printing Wizard for KStars printed documents (currently only finder charts).
SkyObject * getShBeginObject()
Get object at which star hopping will begin.
void setSkyObject(SkyObject *obj)
Set SkyObject for which FinderChart is created.
PrintingWizard(QWidget *parent=nullptr)
Constructor.
void fovCaptureDone()
Disable FOV capture mode.
QSize getFovImageSize()
Get FOV snapshot image size.
void setShBeginObject(SkyObject *obj)
Set SkyObject at which star hopper will begin.
SimpleFovExporter * getFovExporter()
Get pointer to the SimpleFovExporter class instance.
void recaptureFov(int idx)
Recapture FOV snapshot of passed index.
void beginFovCapture()
Hide Printing Wizard and put SkyMap in FOV capture mode.
SkyObject * getSkyObject()
Get selected SkyObject, for which FinderChart is created.
void beginPointing()
Set SkyMap to pointing mode and hide Printing Wizard.
~PrintingWizard() override
Destructor.
void updateStepButtons()
Update Next/Previous step buttons.
QList< FovSnapshot * > * getFovSnapshotList()
Get FovSnapshot list.
void beginShBeginPointing()
Enter star hopping begin pointing mode.
void pointingDone(SkyObject *obj)
Quit object pointing mode and set the pointed object.
WIZARD_STEPS
Wizard steps enumeration.
void captureFov()
Capture current contents of FOV symbol.
FOV_TYPE getFovType()
Get used FOV export method.
void beginShFovCapture()
Capture FOV snapshots using star hopper-based method.
FOV_TYPE
FOV export method type enumeration.
FinderChart * getFinderChart()
Get used FinderChart document.
QPrinter * getPrinter()
Get printer used by Printing Wizard.
SimpleFovExporter class is used for FOV representation exporting.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
The sky coordinates of a point in the sky.
Definition skypoint.h:45
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:05:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.