ImageExportDialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ImageExportDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006,2007 by Ion Vasilief, Knut Franke
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, knut.franke*gmx.de
00007     Description          : QFileDialog extended with options for image export
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef IMAGEEXPORTDIALOG_H
00030 #define IMAGEEXPORTDIALOG_H
00031 
00032 #include <ExtensibleFileDialog.h>
00033 
00034 #include <QSpinBox>
00035 #include <QCheckBox>
00036 #include <QComboBox>
00037 #include <QPrinter>
00038 
00039 class QLabel;
00040 class QStackedWidget;
00041 class QGroupBox;
00042 class MdiSubWindow;
00043 class DoubleSpinBox;
00044 class Graph;
00045 
00047 class ImageExportDialog: public ExtensibleFileDialog
00048 {
00049     Q_OBJECT
00050 
00051 private:
00053     void initAdvancedOptions();
00054 
00056     MdiSubWindow *d_window;
00058     QWidget *d_advanced_options;
00059     // vector format options
00061     QGroupBox *d_vector_options;
00062     QSpinBox *d_vector_resolution;
00063     QCheckBox *d_color;
00064     // raster format options
00066     QGroupBox *d_raster_options;
00067     QSpinBox *d_quality;
00068     QCheckBox *d_transparency;
00069     QSpinBox *d_bitmap_resolution;
00070 
00071     QComboBox *d_3D_text_export_mode;
00072     QComboBox *d_3D_export_sort;
00073 
00075     QGroupBox *d_custom_size_box;
00076     DoubleSpinBox *widthBox, *heightBox, *scaleFontsBox;
00077     QComboBox *unitBox;
00078     QLabel *resolutionLabel;
00079     QCheckBox *keepRatioBox;
00080     QCheckBox *d_escape_tex_strings;
00081     QCheckBox *d_tex_font_sizes;
00082 
00083     double aspect_ratio;
00084     Graph *d_layer;
00085 
00086 public:
00088 
00095     ImageExportDialog(MdiSubWindow *window, QWidget * parent = 0, bool extended = true, Graph *g = 0, Qt::WFlags flags = 0 );
00097     int vectorResolution() const { return d_vector_resolution->value(); };
00099     bool color() const { return d_color->isChecked(); };
00101     bool escapeStrings(){return d_escape_tex_strings->isChecked();};
00103     bool exportFontSizes(){return d_tex_font_sizes->isChecked();};
00104 
00106     int bitmapResolution() const { return d_bitmap_resolution->value(); };
00107 
00109     int quality() const { return d_quality->value(); };
00111     bool transparency() const;
00113     int textExportMode() const {return d_3D_text_export_mode->currentIndex();};
00115     int sortMode() const {return d_3D_export_sort->currentIndex();};
00116 
00117     void selectFilter(const QString & filter);
00119     QSizeF customExportSize();
00121     int sizeUnit(){return unitBox->currentIndex();};
00123     double scaleFontsFactor();
00124 
00125 public slots:
00126     void accept();
00127 
00128 protected slots:
00129     void closeEvent(QCloseEvent*);
00131     void updateAdvancedOptions (const QString &filter);
00132     void adjustWidth(double height);
00133     void adjustHeight(double width);
00134 };
00135 
00136 #endif