1// qinputdialog.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QInputDialog : QDialog
24{
25%TypeHeaderCode
26#include <qinputdialog.h>
27%End
28
29public:
30    enum InputDialogOption
31    {
32        NoButtons,
33        UseListViewForComboBoxItems,
34%If (Qt_5_2_0 -)
35        UsePlainTextEditForTextInput,
36%End
37    };
38
39    typedef QFlags<QInputDialog::InputDialogOption> InputDialogOptions;
40
41    enum InputMode
42    {
43        TextInput,
44        IntInput,
45        DoubleInput,
46    };
47
48    static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode echo = QLineEdit::Normal, const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), Qt::InputMethodHints inputMethodHints = Qt::ImhNone) /ReleaseGIL/;
49    static int getInt(QWidget *parent, const QString &title, const QString &label, int value = 0, int min = -2147483647, int max = 2147483647, int step = 1, bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags()) /ReleaseGIL/;
50    static double getDouble(QWidget *parent, const QString &title, const QString &label, double value = 0, double min = -2147483647, double max = 2147483647, int decimals = 1, bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags()) /ReleaseGIL/;
51%If (Qt_5_10_0 -)
52    static double getDouble(QWidget *parent, const QString &title, const QString &label, double value, double minValue, double maxValue, int decimals, bool *ok, Qt::WindowFlags flags, double step);
53%End
54    static QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &items, int current = 0, bool editable = true, bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), Qt::InputMethodHints inputMethodHints = Qt::ImhNone) /ReleaseGIL/;
55%If (Qt_5_2_0 -)
56    static QString getMultiLineText(QWidget *parent, const QString &title, const QString &label, const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = Qt::WindowFlags(), Qt::InputMethodHints inputMethodHints = Qt::ImhNone) /ReleaseGIL/;
57%End
58    QInputDialog(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags());
59    virtual ~QInputDialog();
60    void setInputMode(QInputDialog::InputMode mode);
61    QInputDialog::InputMode inputMode() const;
62    void setLabelText(const QString &text);
63    QString labelText() const;
64    void setOption(QInputDialog::InputDialogOption option, bool on = true);
65    bool testOption(QInputDialog::InputDialogOption option) const;
66    void setOptions(QInputDialog::InputDialogOptions options);
67    QInputDialog::InputDialogOptions options() const;
68    void setTextValue(const QString &text);
69    QString textValue() const;
70    void setTextEchoMode(QLineEdit::EchoMode mode);
71    QLineEdit::EchoMode textEchoMode() const;
72    void setComboBoxEditable(bool editable);
73    bool isComboBoxEditable() const;
74    void setComboBoxItems(const QStringList &items);
75    QStringList comboBoxItems() const;
76    void setIntValue(int value);
77    int intValue() const;
78    void setIntMinimum(int min);
79    int intMinimum() const;
80    void setIntMaximum(int max);
81    int intMaximum() const;
82    void setIntRange(int min, int max);
83    void setIntStep(int step);
84    int intStep() const;
85    void setDoubleValue(double value);
86    double doubleValue() const;
87    void setDoubleMinimum(double min);
88    double doubleMinimum() const;
89    void setDoubleMaximum(double max);
90    double doubleMaximum() const;
91    void setDoubleRange(double min, double max);
92    void setDoubleDecimals(int decimals);
93    int doubleDecimals() const;
94    void setOkButtonText(const QString &text);
95    QString okButtonText() const;
96    void setCancelButtonText(const QString &text);
97    QString cancelButtonText() const;
98    virtual void open();
99    void open(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
100%MethodCode
101        QObject *receiver;
102        QByteArray slot_signature;
103
104        if ((sipError = pyqt5_qtwidgets_get_connection_parts(a0, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
105        {
106            sipCpp->open(receiver, slot_signature.constData());
107        }
108        else if (sipError == sipErrorContinue)
109        {
110            sipError = sipBadCallableArg(0, a0);
111        }
112%End
113
114    virtual QSize minimumSizeHint() const;
115    virtual QSize sizeHint() const;
116    virtual void setVisible(bool visible);
117    virtual void done(int result);
118
119signals:
120    void textValueChanged(const QString &text);
121    void textValueSelected(const QString &text);
122    void intValueChanged(int value);
123    void intValueSelected(int value);
124    void doubleValueChanged(double value);
125    void doubleValueSelected(double value);
126
127public:
128%If (Qt_5_10_0 -)
129    void setDoubleStep(double step);
130%End
131%If (Qt_5_10_0 -)
132    double doubleStep() const;
133%End
134};
135
136QFlags<QInputDialog::InputDialogOption> operator|(QInputDialog::InputDialogOption f1, QFlags<QInputDialog::InputDialogOption> f2);
137