QElectroTech  0.70
exportdialog.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech 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 QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef EXPORTDIALOG_H
19 #define EXPORTDIALOG_H
20 #include <QtWidgets>
21 #include "diagram.h"
22 #include "qetproject.h"
23 class QSvgGenerator;
30 class ExportDialog : public QDialog {
31  Q_OBJECT
32 
33  // constructors, destructor
34  public:
35  ExportDialog(QETProject *, QWidget * = nullptr);
36  ~ExportDialog() override;
37 
38  private:
39  ExportDialog(const ExportDialog &);
40 
41  // methods
42  public:
43  int diagramsToExportCount() const;
44  static QPointF rotation_transformed(qreal, qreal, qreal, qreal, qreal);
45 
46  private:
48  public:
49  ExportDiagramLine(Diagram *, QSize);
50  virtual ~ExportDiagramLine();
51  QBoxLayout *sizeLayout();
53  QCheckBox *must_export;
54  QLabel *title_label;
55  QLineEdit *file_name;
56  QSpinBox *width;
57  QLabel *x_label;
58  QSpinBox *height;
59  QPushButton *keep_ratio;
60  QPushButton *reset_size;
61  QPushButton *preview;
62  QPushButton *clipboard;
63  };
64 
65  // attributes
66  private:
67  QHash<int, ExportDialog::ExportDiagramLine *> diagram_lines_;
68  // visual items
69  QGridLayout *diagrams_list_layout_;
71  QDialogButtonBox *buttons;
72 
73  QPushButton *selectAll;
74  QPushButton *deSelectAll;
75 
76  // mappers
77  QSignalMapper *preview_mapper_;
78  QSignalMapper *width_mapper_;
79  QSignalMapper *height_mapper_;
80  QSignalMapper *ratio_mapper_;
81  QSignalMapper *reset_mapper_;
82  QSignalMapper *clipboard_mapper_;
83 
84  // project whose diagrams are to be exported
86 
87  // methods
88  private:
89  QWidget *initDiagramsListPart();
90  void saveReloadDiagramParameters(Diagram *, bool = true);
91  void generateSvg(Diagram *, int, int, bool, QIODevice &);
92  void generateDxf(Diagram *, int, int, bool, QString &);
93  void fillRow(const QString&, const QRectF &, QString, const QString&, QString, QString);
94  QImage generateImage(Diagram *, int, int, bool);
96  qreal diagramRatio(Diagram *);
97  QSize diagramSize(Diagram *);
98 
99  public slots:
100  void slot_correctWidth(int);
101  void slot_correctHeight(int);
102  void slot_keepRatioChanged(int);
103  void slot_resetSize(int);
104  void slot_export();
105  void slot_changeUseBorder();
107  void slot_changeFilesExtension(bool = false);
108  void slot_previewDiagram(int);
109  void slot_exportToClipBoard(int);
110  void slot_selectAllClicked();
112 };
113 #endif
void slot_keepRatioChanged(int)
QPushButton * deSelectAll
Definition: exportdialog.h:74
QHash< int, ExportDialog::ExportDiagramLine * > diagram_lines_
Definition: exportdialog.h:67
void saveReloadDiagramParameters(Diagram *, bool=true)
~ExportDialog() override
void generateDxf(Diagram *, int, int, bool, QString &)
QSignalMapper * preview_mapper_
Definition: exportdialog.h:77
void slot_deSelectAllClicked()
QWidget * initDiagramsListPart()
QSignalMapper * reset_mapper_
Definition: exportdialog.h:81
void fillRow(const QString &, const QRectF &, QString, const QString &, QString, QString)
void slot_exportToClipBoard(int)
void generateSvg(Diagram *, int, int, bool, QIODevice &)
void slot_checkDiagramsCount()
QPushButton * selectAll
Definition: exportdialog.h:73
void slot_changeUseBorder()
QETProject * project_
Definition: exportdialog.h:85
void slot_selectAllClicked()
void slot_resetSize(int)
void exportDiagram(ExportDiagramLine *)
QSize diagramSize(Diagram *)
void slot_correctWidth(int)
ExportPropertiesWidget * epw
Definition: exportdialog.h:70
static QPointF rotation_transformed(qreal, qreal, qreal, qreal, qreal)
QDialogButtonBox * buttons
Definition: exportdialog.h:71
QSignalMapper * height_mapper_
Definition: exportdialog.h:79
void slot_export()
ExportDialog(QETProject *, QWidget *=nullptr)
void slot_correctHeight(int)
void slot_changeFilesExtension(bool=false)
qreal diagramRatio(Diagram *)
int diagramsToExportCount() const
QImage generateImage(Diagram *, int, int, bool)
QGridLayout * diagrams_list_layout_
Definition: exportdialog.h:69
QSignalMapper * clipboard_mapper_
Definition: exportdialog.h:82
QSignalMapper * ratio_mapper_
Definition: exportdialog.h:80
void slot_previewDiagram(int)
QSignalMapper * width_mapper_
Definition: exportdialog.h:78