00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef KINPUTDIALOG_H
00021 #define KINPUTDIALOG_H
00022 
00023 class QValidator;
00024 
00025 class KLineEdit;
00026 class KIntSpinBox;
00027 class KDoubleSpinBox;
00028 class KComboBox;
00029 class KInputDialogPrivate;
00030 
00031 #include <kdialogbase.h>
00032 
00045 class KInputDialog : public KDialogBase
00046 {
00047   Q_OBJECT
00048 
00049   private:
00050 
00055     KInputDialog( const QString &caption, const QString &label,
00056       const QString &value, QWidget *parent, const char *name,
00057       QValidator *validator, const QString &mask );
00058     KInputDialog( const QString &caption, const QString &label, int value,
00059       int minValue, int maxValue, int step, int base, QWidget *parent,
00060       const char *name );
00061     KInputDialog( const QString &caption, const QString &label, double value,
00062       double minValue, double maxValue, double step, int decimals,
00063       QWidget *parent, const char *name );
00064     KInputDialog( const QString &caption, const QString &label,
00065       const QStringList &list, int current, bool editable, QWidget *parent,
00066       const char *name );
00067     KInputDialog( const QString &caption, const QString &label,
00068       const QStringList &list, const QStringList &select, bool editable,
00069       QWidget *parent, const char *name );
00070 
00071     ~KInputDialog();
00072 
00073     KLineEdit *lineEdit() const;
00074     KIntSpinBox *intSpinBox() const;
00075     KDoubleSpinBox *doubleSpinBox() const;
00076     KComboBox *comboBox() const;
00077     KListBox *listBox() const;
00078 
00079   private slots:
00080 
00081     void slotEditTextChanged( const QString& );
00082     void slotUpdateButtons( const QString& );
00083 
00084   public:
00085 
00114     static QString getText( const QString &caption, const QString &label,
00115         const QString &value=QString::null, bool *ok=0, QWidget *parent=0,
00116         const char *name=0, QValidator *validator=0,
00117         const QString &mask=QString::null );
00118 
00143     static int getInteger( const QString &caption, const QString &label,
00144         int value=0, int minValue=-2147483647, int maxValue=2147483647,
00145         int step=1, int base=10, bool *ok=0, QWidget *parent=0,
00146         const char *name=0 );
00147 
00152     static int getInteger( const QString &caption, const QString &label,
00153         int value=0, int minValue=-2147483647, int maxValue=2147483647,
00154         int step=1, bool *ok=0, QWidget *parent=0, const char *name=0 );
00155 
00179     static double getDouble( const QString &caption, const QString &label,
00180         double value=0, double minValue=-2147483647, 
00181         double maxValue=2147483647, double step=0.1, int decimals=1,
00182         bool *ok=0, QWidget *parent=0, const char *name=0 );
00183 
00188     static double getDouble( const QString &caption, const QString &label,
00189         double value=0, double minValue=-2147483647, 
00190         double maxValue=2147483647, int decimals=1, bool *ok=0,
00191         QWidget *parent=0, const char *name=0 );
00192 
00213     static QString getItem( const QString &caption, const QString &label,
00214         const QStringList &list, int current=0, bool editable=false,
00215         bool *ok=0, QWidget *parent=0, const char *name=0 );
00216 
00237     static QStringList getItemList( const QString &caption,
00238         const QString &label, const QStringList &list=QStringList(),
00239         const QStringList &select=QStringList(), bool multiple=false,
00240         bool *ok=0, QWidget *parent=0, const char *name=0 );
00241 
00242   private:
00243 
00244     KInputDialogPrivate *d;
00245     friend class KInputDialogPrivate;
00246 };
00247 
00248 #endif // KINPUTDIALOG_H
00249 
00250 
00251