src/BasicDialog/basicdialog.h

00001 /****************************************************************************
00002 ** Créé par Anacr0x : anacr0x@free.fr
00003 **
00004 ** Sous licence GPL v2 ou plus
00005 ****************************************************************************/
00006 
00007 #ifndef BASICDIALOG_H
00008 #define BASICDIALOG_H
00009 
00010 #include <QDialog>
00011 #include <QLineEdit>
00012 #include <QComboBox>
00013 #include <QListWidget>
00014 #include <QCheckBox>
00015 
00016 /*************************************************************************/
00018 
00021 /*************************************************************************/
00022 
00023 class BasicDialog:public QDialog
00024 {
00025         Q_OBJECT
00026 
00027 public:
00029         BasicDialog(QWidget * parent):QDialog(parent)
00030         {}
00031 
00033         void createInterface (const QString &icon, const QString &title,
00034                               const QString &firstLine, QWidget *widget, const QString &secondLine = "", bool SelectFileButton = false,
00035                               bool SelectDirButton = false, bool JusteOneButton = false);
00036 
00037 private slots:
00039         void selectFile();
00041         void selectDir();
00042 
00043 signals:
00044         void pathSelected(const QString &Path);
00045 
00046 };
00047 
00048 
00049 /*************************************************************************/
00051 
00054 /*************************************************************************/
00055 
00056 class BasicLineDialog:public BasicDialog
00057 {
00058         Q_OBJECT
00059 
00060 public:
00062         BasicLineDialog (const QString &icon, const QString &title,
00063                          const QString &firstLine, const QString &secondLine = "",
00064                          QWidget *parent = NULL, bool SelectFileButton = false, bool SelectDirButton = false);
00065 
00067         inline QLineEdit* lineEdit()
00068         {
00069                 return le;
00070         }
00071 
00072 private:
00074         QLineEdit *le;
00075 
00076 private slots:
00078         void changeEdit(const QString&);
00079 };
00080 
00081 
00082 /*************************************************************************/
00084 
00087 /*************************************************************************/
00088 
00089 class BasicComboDialog:public BasicDialog
00090 {
00091         Q_OBJECT
00092 
00093 public:
00095         BasicComboDialog (const QString &icon, const QString &title,
00096                           const QString &firstLine, const QString &secondLine = "",
00097                           QWidget *parent = NULL);
00098 
00100         inline QComboBox* comboBox()
00101         {
00102                 return cb;
00103         }
00104 
00105 private:
00107         QComboBox *cb;
00108 };
00109 
00110 
00111 /*************************************************************************/
00113 
00116 /*************************************************************************/
00117 
00118 class BasicListDialog:public BasicDialog
00119 {
00120         Q_OBJECT
00121 
00122 public:
00124         BasicListDialog (const QString &icon, const QString &title,
00125                          const QString &firstLine, const QStringList &choices, const QString &secondLine = "",
00126                          QWidget *parent = NULL);
00127 
00129         inline QListWidget* listWidget()
00130         {
00131                 return lw;
00132         }
00133 
00135         inline QString text()
00136         {
00137                 return lw->currentItem ()->text();
00138         }
00139 
00140 private:
00142         QListWidget *lw;
00143 };
00144 
00145 /*************************************************************************/
00147 
00150 /*************************************************************************/
00151 
00152 class BasicCheckBoxDialog:public BasicDialog
00153 {
00154         Q_OBJECT
00155 
00156 public:
00158         BasicCheckBoxDialog (const QString &icon, const QString &title,
00159                              const QString &firstLine, const QString &checkBoxLine,
00160                              QWidget *parent = NULL);
00161 
00163         inline QCheckBox* checkBox()
00164         {
00165                 return cb;
00166         }
00167 
00168 private:
00170         QCheckBox *cb;
00171 };
00172 
00173 #endif

Generated on Wed Jan 2 20:39:34 2008 for Scythia by  doxygen 1.5.4