00001 /*************************************************************************** 00002 File : ImageExportDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006,2007 by Ion Vasilief, 00006 Tilman Hoener zu Siederdissen, Knut Franke 00007 Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net, 00008 knut.franke*gmx.de 00009 Description : QFileDialog extended with options for image export 00010 00011 ***************************************************************************/ 00012 00013 /*************************************************************************** 00014 * * 00015 * This program is free software; you can redistribute it and/or modify * 00016 * it under the terms of the GNU General Public License as published by * 00017 * the Free Software Foundation; either version 2 of the License, or * 00018 * (at your option) any later version. * 00019 * * 00020 * This program is distributed in the hope that it will be useful, * 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00023 * GNU General Public License for more details. * 00024 * * 00025 * You should have received a copy of the GNU General Public License * 00026 * along with this program; if not, write to the Free Software * 00027 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00028 * Boston, MA 02110-1301 USA * 00029 * * 00030 ***************************************************************************/ 00031 #ifndef IMAGEEXPORTDIALOG_H 00032 #define IMAGEEXPORTDIALOG_H 00033 00034 #include "../../ExtensibleFileDialog.h" 00035 00036 #include <QSpinBox> 00037 #include <QCheckBox> 00038 #include <QComboBox> 00039 #include <QPrinter> 00040 00041 class QStackedWidget; 00042 class QGroupBox; 00043 00045 class ImageExportDialog: public ExtensibleFileDialog 00046 { 00047 Q_OBJECT 00048 00049 private: 00051 void initAdvancedOptions(); 00052 00054 QStackedWidget *d_advanced_options; 00055 // vector format options 00057 QGroupBox *d_vector_options; 00058 QSpinBox *d_resolution; 00059 QCheckBox *d_color; 00060 QCheckBox *d_keep_aspect; 00061 QCheckBox *d_standard_page; 00062 QComboBox *boxPageSize; 00063 // raster format options 00065 QGroupBox *d_raster_options; 00066 QSpinBox *d_quality; 00067 QCheckBox *d_transparency; 00068 00069 public: 00071 00077 ImageExportDialog(QWidget * parent = 0, bool vector_options = true, bool extended = true, Qt::WFlags flags = 0 ); 00079 int resolution() const { return d_resolution->value(); } 00081 bool color() const { return d_color->isChecked(); } 00083 bool keepAspect() const { return d_keep_aspect->isChecked(); } 00085 QPrinter::PageSize pageSize() const; 00086 void setPageSize(int size); 00088 int quality() const { return d_quality->value(); } 00090 bool transparency() const { return d_transparency->isChecked(); } 00091 00092 void selectFilter(const QString & filter); 00093 00094 protected slots: 00095 void closeEvent(QCloseEvent*); 00097 void updateAdvancedOptions (const QString &filter); 00098 }; 00099 00100 #endif