Kstars

exportimagedialog.h
1 /*
2  SPDX-FileCopyrightText: 2011 Rafał Kułaga <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ui_exportimagedialog.h"
10 
11 #include "../printing/legend.h"
12 
13 #include <QDialog>
14 
15 class KStars;
16 class QString;
17 class QSize;
18 class ImageExporter;
19 
20 // ExportImageDialog user interface.
21 class ExportImageDialogUI : public QFrame, public Ui::ExportImageDialog
22 {
23  Q_OBJECT
24 
25  public:
26  explicit ExportImageDialogUI(QWidget *parent = nullptr);
27 };
28 
29 /** @short Export sky image dialog. This dialog enables user to set up basic legend
30  properties before image is exported.
31  */
32 class ExportImageDialog : public QDialog
33 {
34  Q_OBJECT
35 
36  public:
37  /**short Default constructor. Creates dialog operating on passed URL and
38  output image width and height.
39  *@param url URL for exported image.
40  *@param size size of exported image.
41  *@param imgExporter A pointer to an ImageExporter that we can use instead of creating our own. if 0, we will create our own.
42  */
43  ExportImageDialog(const QString &url, const QSize &size, ImageExporter *imgExporter = nullptr);
44 
45  ~ExportImageDialog() override = default;
46 
47  inline void setOutputUrl(const QString &url) { m_Url = url; }
48  inline void setOutputSize(const QSize &size) { m_Size = size; }
49 
50  private slots:
51  void switchLegendEnabled(bool enabled);
52  void previewImage();
53  void exportImage();
54 
55  void setupWidgets();
56  void updateLegendSettings();
57 
58  private:
59  KStars *m_KStars;
60  ExportImageDialogUI *m_DialogUI;
61  QString m_Url;
62  QSize m_Size;
63  ImageExporter *m_ImageExporter;
64 };
Q_OBJECTQ_OBJECT
Backends for exporting a sky image, either raster or vector, with a legend.
Definition: imageexporter.h:23
ExportImageDialog(const QString &url, const QSize &size, ImageExporter *imgExporter=nullptr)
short Default constructor.
Export sky image dialog.
This is the main window for KStars. In addition to the GUI elements, the class contains the program c...
Definition: kstars.h:92
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:50 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.