EnrichmentDialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : EnrichmentDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2008 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : A general properties dialog for the FrameWidget, using article
00008                           "Using a Simple Web Service with Qt" in Qt Quaterly, Issue 23, Q3 2007
00009 
00010  ***************************************************************************/
00011 
00012 /***************************************************************************
00013  *                                                                         *
00014  *  This program is free software; you can redistribute it and/or modify   *
00015  *  it under the terms of the GNU General Public License as published by   *
00016  *  the Free Software Foundation; either version 2 of the License, or      *
00017  *  (at your option) any later version.                                    *
00018  *                                                                         *
00019  *  This program is distributed in the hope that it will be useful,        *
00020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00022  *  GNU General Public License for more details.                           *
00023  *                                                                         *
00024  *   You should have received a copy of the GNU General Public License     *
00025  *   along with this program; if not, write to the Free Software           *
00026  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00027  *   Boston, MA  02110-1301  USA                                           *
00028  *                                                                         *
00029  ***************************************************************************/
00030 
00031 #ifndef TEXWIDGETDIALOG_H
00032 #define TEXWIDGETDIALOG_H
00033 
00034 #include <QDialog>
00035 
00036 class QComboBox;
00037 class QHttp;
00038 class QLabel;
00039 class QPushButton;
00040 class QTextEdit;
00041 class QTabWidget;
00042 class QCheckBox;
00043 class QLineEdit;
00044 class QCheckBox;
00045 class QSpinBox;
00046 
00047 class Graph;
00048 class FrameWidget;
00049 class LegendWidget;
00050 class ColorButton;
00051 class DoubleSpinBox;
00052 class PatternBox;
00053 class PenStyleBox;
00054 class RectangleWidget;
00055 class TextFormatButtons;
00056 
00057 class EnrichmentDialog : public QDialog
00058 {
00059     Q_OBJECT
00060 
00061 public:
00062     enum WidgetType{Frame, Text, Image, Tex, MDIWindow};
00063 
00064     EnrichmentDialog(WidgetType wt, Graph *g, QWidget *parent = 0);
00065     ~EnrichmentDialog();
00066 
00067     void setWidget(QWidget *w);
00068 
00069 private slots:
00070     void clearForm();
00071     void fetchImage();
00072     void updateForm(bool error);
00073     void apply();
00074     void customButtons(QWidget *w);
00075     void chooseImageFile(const QString& fn = QString::null);
00076     void displayCoordinates(int unit);
00077     void adjustHeight(double width);
00078     void adjustWidth(double height);
00079     void saveImagesInternally(bool save);
00080     void setBestSize();
00081     void frameApplyTo();
00082     void patternApplyTo();
00083     void textFormatApplyTo();
00084     void customFont();
00085     void updateTransparency(int alpha);
00086     void setTextDefaultValues();
00087     void setFrameDefaultValues();
00088     void setRectangleDefaultValues();
00089 
00090 private:
00091     void initTextPage();
00092     void initEditorPage();
00093     void initImagePage();
00094     void initFramePage();
00095     void initGeometryPage();
00096     void initPatternPage();
00097     void setCoordinates(int unit);
00098     void setFrameTo(FrameWidget *fw);
00099     void setPatternTo(RectangleWidget *r);
00100     void setTextFormatTo(LegendWidget *l);
00101     void setText(const QString & t);
00102 
00103     QHttp *http;
00104     QLabel *outputLabel;
00105     QPushButton *clearButton;
00106     QPushButton *updateButton;
00107     QPushButton *cancelButton;
00108     QPushButton *bestSizeButton;
00109     QTextEdit *equationEditor, *textEditBox;
00110     QComboBox *frameBox;
00111     QTabWidget* tabWidget;
00112     QWidget *editPage, *framePage, *geometryPage, *imagePage, *patternPage, *textPage;
00113     ColorButton *frameColorBtn, *backgroundColorBtn, *patternColorBtn;
00114     QCheckBox *boxSaveImagesInternally;
00115     QLineEdit *imagePathBox;
00116     DoubleSpinBox *xBox, *yBox, *widthBox, *heightBox;
00117     QComboBox *unitBox;
00118     PenStyleBox *boxFrameLineStyle;
00119     QCheckBox *keepAspectBox, *useFrameColorBox;
00120     QSpinBox *boxTransparency, *boxFrameWidth, *boxTextAngle;
00121     PatternBox *patternBox;
00122     QPushButton *textApplyToBtn;
00123     QComboBox *frameApplyToBox, *patternApplyToBox, *textApplyToBox;
00124     ColorButton *textColorBtn, *textBackgroundBtn;
00125     QPushButton *textFontBtn;
00126     QSpinBox *boxBackgroundTransparency;
00127     TextFormatButtons *formatButtons;
00128     QPushButton *textDefaultBtn, *frameDefaultBtn, *rectangleDefaultBtn;
00129     QCheckBox *autoUpdateTextBox;
00130     QFont textFont;
00131 
00132     Graph *d_plot;
00133     QWidget *d_widget;
00134     WidgetType d_widget_type;
00135     double aspect_ratio;
00136 };
00137 
00138 #endif

Generated on Tue Nov 3 10:48:51 2009 for QtiPlot by  doxygen 1.6.1