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 #include <QProcess>
00036 
00037 class QComboBox;
00038 class QGroupBox;
00039 class QHttp;
00040 class QLabel;
00041 class QPushButton;
00042 class QTextEdit;
00043 class QTabWidget;
00044 class QCheckBox;
00045 class QLineEdit;
00046 class QCheckBox;
00047 class QSpinBox;
00048 class QNetworkProxy;
00049 
00050 class Graph;
00051 class FrameWidget;
00052 class LegendWidget;
00053 class ColorButton;
00054 class DoubleSpinBox;
00055 class PatternBox;
00056 class PenStyleBox;
00057 class RectangleWidget;
00058 class TextFormatButtons;
00059 
00060 class EnrichmentDialog : public QDialog
00061 {
00062     Q_OBJECT
00063 
00064 public:
00065     enum WidgetType{Frame, Text, Image, Tex, MDIWindow, Ellipse};
00066 
00067     EnrichmentDialog(WidgetType wt, Graph *g, QWidget *parent = 0);
00068     ~EnrichmentDialog();
00069 
00070     void setWidget(QWidget *w);
00071 
00072 private slots:
00073     void clearForm();
00074     void fetchImage();
00075     void updateForm(bool error);
00076     void apply();
00077     void customButtons(QWidget *w);
00078     void chooseImageFile(const QString& fn = QString::null);
00079     void displayCoordinates(int unit);
00080     void adjustHeight(double width);
00081     void adjustWidth(double height);
00082     void saveImagesInternally(bool save);
00083     void setBestSize();
00084     void frameApplyTo();
00085     void patternApplyTo();
00086     void textFormatApplyTo();
00087     void customFont();
00088     void updateTransparency(int alpha);
00089     void setTextDefaultValues();
00090     void setFrameDefaultValues();
00091     void setRectangleDefaultValues();
00092     void finishedCompiling(int, QProcess::ExitStatus);
00093     void displayCompileError(QProcess::ProcessError error);
00094     void createImage();
00095     void updateCompilerInterface(int);
00096     void updateButtons();
00097 
00098 private:
00099     void initTextPage();
00100     void initEditorPage();
00101     void initImagePage();
00102     void initFramePage();
00103     void initGeometryPage();
00104     void initPatternPage();
00105     void setCoordinates(int unit);
00106     void setFrameTo(FrameWidget *fw);
00107     void setPatternTo(FrameWidget *r);
00108     void setTextFormatTo(LegendWidget *l);
00109     void setText(QTextEdit *editor, const QString & t);
00110     QString createTempTexFile();
00111 
00112     QHttp *http;
00113     QProcess *compileProcess, *dvipngProcess;
00114 
00115     QLabel *outputLabel;
00116     QPushButton *clearButton;
00117     QPushButton *updateButton;
00118     QPushButton *cancelButton;
00119     QPushButton *bestSizeButton;
00120     QTextEdit *equationEditor, *textEditBox;
00121     QComboBox *frameBox;
00122     QTabWidget* tabWidget;
00123     QWidget *editPage, *framePage, *geometryPage, *imagePage, *patternPage, *textPage;
00124     ColorButton *frameColorBtn, *backgroundColorBtn, *patternColorBtn;
00125     QCheckBox *boxSaveImagesInternally;
00126     QLineEdit *imagePathBox;
00127     DoubleSpinBox *xBox, *yBox, *widthBox, *heightBox, *boxFrameWidth;
00128     QComboBox *unitBox;
00129     PenStyleBox *boxFrameLineStyle;
00130     QCheckBox *keepAspectBox, *useFrameColorBox;
00131     QSpinBox *boxTransparency, *boxTextAngle;
00132     PatternBox *patternBox;
00133     QPushButton *textApplyToBtn;
00134     QComboBox *frameApplyToBox, *patternApplyToBox, *textApplyToBox;
00135     ColorButton *textColorBtn, *textBackgroundBtn;
00136     QPushButton *textFontBtn;
00137     QSpinBox *boxBackgroundTransparency;
00138     TextFormatButtons *formatButtons, *texFormatButtons;
00139     QPushButton *textDefaultBtn, *frameDefaultBtn, *rectangleDefaultBtn;
00140     QCheckBox *autoUpdateTextBox, *texOutputBox;
00141     QComboBox *texCompilerBox;
00142     QComboBox* attachToBox;
00143 
00144     QFont textFont;
00145 
00146     Graph *d_plot;
00147     QWidget *d_widget;
00148     WidgetType d_widget_type;
00149     double aspect_ratio;
00150 };
00151 
00152 #endif

Generated by  doxygen 1.6.2