lib/PrefDialog.h

Go to the documentation of this file.
00001 /*
00002  *  Qtstalker stock charter
00003  *
00004  *  Copyright (C) 2001-2007 Stefan S. Stratigakos
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00019  *  USA.
00020  */
00021 
00022 #ifndef PREFDIALOG_HPP
00023 #define PREFDIALOG_HPP
00024 
00025 #include "ColorButton.h"
00026 #include "FontButton.h"
00027 #include "FileButton.h"
00028 #include "SymbolButton.h"
00029 #include <qtabdialog.h>
00030 #include <qlayout.h>
00031 #include <qwidget.h>
00032 #include <qpushbutton.h>
00033 #include <qdict.h>
00034 #include <qspinbox.h>
00035 #include <qlineedit.h>
00036 #include <qvalidator.h>
00037 #include <qcheckbox.h>
00038 #include <qcombobox.h>
00039 #include <qfont.h>
00040 #include <qdatetimeedit.h>
00041 #include <qdatetime.h>
00042 #include <qstringlist.h>
00043 #include <qstring.h>
00044 #include <qlabel.h>
00045 
00046 class PrefDialog : public QTabDialog
00047 {
00048   Q_OBJECT
00049 
00050   public:
00051     PrefDialog (QWidget *);
00052     PrefDialog ();
00053     ~PrefDialog ();
00054     void init ();
00055     void createPage (QString &);
00056     void deletePage (QString &);
00057     void setHelpFile (QString &);
00058     void addColorItem (QString &, QString &, QColor &);
00059     void addColorPrefItem (QString &, QString &, QColor &);
00060     void getColor (QString &, QColor &);
00061     void addDoubleItem (QString &, QString &, double, double, double);
00062     void addDoubleItem (QString &, QString &, double);
00063     double getDouble (QString &);
00064     void addIntItem (QString &, QString &, int);
00065     void addIntItem (QString &, QString &, int, int, int);
00066     int getInt (QString &);
00067     void addCheckItem (QString &, QString &, bool);
00068     void addCheckItem (QString &, QString &, QString &);
00069     bool getCheck (QString &);
00070     void getCheckString (QString &, QString &);
00071     void addFontItem (QString &, QString &, QFont &);
00072     void getFont (QString &, QFont &);
00073     void addTextItem (QString &, QString &, QString &);
00074     void getText (QString &, QString &);
00075     void addComboItem (QString &, QString &, QStringList &, QString &);
00076     void addComboItem (QString &, QString &, QStringList &, int);
00077     void getCombo (QString &, QString &);
00078     int getComboIndex (QString &);
00079     QComboBox * getComboWidget (QString &);
00080     void addDateItem (QString &, QString &, QDateTime &);
00081     void getDate (QString &, QDateTime &);
00082     void addFileItem (QString &, QString &, QStringList &, QString &);
00083     void getFile (QString &, QStringList &);
00084     void addSymbolItem (QString &, QString &, QString &, QString &);
00085     void getSymbol (QString &, QString &);
00086     void addLabelItem (QString &, QString &, QString &);
00087     void getItem (QString &, QString &);
00088     void addTimeItem (QString &, QString &, QDateTime &);
00089     void getTime (QString &, QDateTime &);
00090     
00091   public slots:
00092     void help ();
00093 
00094   private:
00095     QDict<QWidget> widgetList;
00096     QDict<QGridLayout> gridList;
00097     QDict<ColorButton> colorButtonList;
00098     QDict<QSpinBox> intList;
00099     QDict<QLineEdit> doubleList;
00100     QDict<QCheckBox> checkList;
00101     QDict<FontButton> fontButtonList;
00102     QDict<QLineEdit> textList;
00103     QDict<QComboBox> comboList;
00104     QDict<QDateEdit> dateList;
00105     QDict<FileButton> fileList;
00106     QDict<SymbolButton> symbolList;
00107     QDict<QDoubleValidator> dvList;
00108     QDict<QLabel> labelList;
00109     QDict<QTimeEdit> timeList;
00110     QString helpFile;
00111 };
00112 
00113 #endif