File indexing completed on 2024-04-21 14:55:55

0001 /*
0002   Copyright (C) 2003 Nadeem Hasan <nhasan@kde.org>
0003 
0004   This library is free software; you can redistribute it and/or
0005   modify it under the terms of the GNU Library General Public
0006   License as published by the Free Software Foundation; either
0007   version 2 of the License, or (at your option) any later version.
0008 
0009   This library is distributed in the hope that it will be useful,
0010   but WITHOUT ANY WARRANTY; without even the implied warranty of
0011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012   Library General Public License for more details.
0013 
0014   You should have received a copy of the GNU Library General Public License
0015   along with this library; see the file COPYING.LIB.  If not, write to
0016   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017   Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KINPUTDIALOG_P_H
0021 #define KINPUTDIALOG_P_H
0022 
0023 class QLabel;
0024 class QValidator;
0025 class QDialogButtonBox;
0026 class QDoubleSpinBox;
0027 class QListWidget;
0028 class QSpinBox;
0029 
0030 class KComboBox;
0031 class KLineEdit;
0032 class KTextEdit;
0033 
0034 #include <QDialog>
0035 
0036 /**
0037  * @author Nadeem Hasan <nhasan@kde.org>
0038  */
0039 class KInputDialogHelper : public QDialog
0040 {
0041     Q_OBJECT
0042 
0043 public:
0044 
0045     KInputDialogHelper(const QString &caption, const QString &label,
0046                        const QString &value, QWidget *parent,
0047                        QValidator *validator, const QString &mask);
0048     KInputDialogHelper(const QString &caption, const QString &label,
0049                        const QString &value, QWidget *parent);
0050     KInputDialogHelper(const QString &caption, const QString &label, int value,
0051                        int minValue, int maxValue, int step, int base, QWidget *parent);
0052     KInputDialogHelper(const QString &caption, const QString &label, double value,
0053                        double minValue, double maxValue, double step, int decimals,
0054                        QWidget *parent);
0055     KInputDialogHelper(const QString &caption, const QString &label,
0056                        const QStringList &list, int current, bool editable, QWidget *parent);
0057     KInputDialogHelper(const QString &caption, const QString &label,
0058                        const QStringList &list, const QStringList &select, bool editable,
0059                        QWidget *parent);
0060 
0061     ~KInputDialogHelper() override;
0062 
0063     KLineEdit *lineEdit() const;
0064     QSpinBox *intSpinBox() const;
0065     QDoubleSpinBox *doubleSpinBox() const;
0066     KComboBox *comboBox() const;
0067     QListWidget *listBox() const;
0068     KTextEdit *textEdit() const;
0069 
0070 private Q_SLOTS:
0071     void slotEditTextChanged(const QString &);
0072     void slotUpdateButtons(const QString &);
0073 
0074 private:
0075     QLabel *m_label;
0076     KLineEdit *m_lineEdit;
0077     QSpinBox *m_intSpinBox;
0078     QDoubleSpinBox *m_doubleSpinBox;
0079     KComboBox *m_comboBox;
0080     QListWidget *m_listBox;
0081     KTextEdit *m_textEdit;
0082     QDialogButtonBox *m_buttonBox;
0083 };
0084 
0085 #endif // KINPUTDIALOG_P_H
0086