SciDAVis  1.D4
ImageExportDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ImageExportDialog.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006,2007 by Ion Vasilief,
6  Tilman Benkert, Knut Franke
7  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net,
8  knut.franke*gmx.de
9  Description : QFileDialog extended with options for image export
10 
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  * This program is distributed in the hope that it will be useful, *
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
23  * GNU General Public License for more details. *
24  * *
25  * You should have received a copy of the GNU General Public License *
26  * along with this program; if not, write to the Free Software *
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
28  * Boston, MA 02110-1301 USA *
29  * *
30  ***************************************************************************/
31 #ifndef IMAGEEXPORTDIALOG_H
32 #define IMAGEEXPORTDIALOG_H
33 
34 #include "ExtensibleFileDialog.h"
35 
36 #include <QSpinBox>
37 #include <QCheckBox>
38 #include <QComboBox>
39 #include <QPrinter>
40 
41 class QStackedWidget;
42 class QGroupBox;
43 
46 {
47  Q_OBJECT
48 
49 private:
51  void initAdvancedOptions();
52 
54  QStackedWidget *d_advanced_options;
55  // vector format options
57  QGroupBox *d_vector_options;
58  QSpinBox *d_resolution;
59  QCheckBox *d_color;
60  QCheckBox *d_keep_aspect;
61  QCheckBox *d_standard_page;
62  QComboBox *d_box_page_size;
64  // raster format options
66  QGroupBox *d_raster_options;
67  QSpinBox *d_quality;
68  QCheckBox *d_transparency;
69 
70 public:
72 
78  ImageExportDialog(QWidget * parent = 0, bool vector_options = true, bool extended = true, Qt::WFlags flags = 0 );
80  int resolution() const { return d_resolution->value(); }
82  bool color() const { return d_color->isChecked(); }
84  bool keepAspect() const { return d_keep_aspect->isChecked(); }
86  QPrinter::PageSize pageSize() const;
87  void setPageSize(QPrinter::PageSize size);
88  QPrinter::Orientation pageOrientation() const;
89  void setOrientation(QPrinter::Orientation orientation);
91  int quality() const { return d_quality->value(); }
93  bool transparency() const { return d_transparency->isChecked(); }
94 
95  void selectFilter(const QString & filter);
96 
97 protected slots:
98  void closeEvent(QCloseEvent*);
100  void updateAdvancedOptions (const QString &filter);
101 };
102 
103 #endif