1// qmessagebox.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 QMessageBox : QDialog
24{
25%TypeHeaderCode
26#include <qmessagebox.h>
27%End
28
29public:
30    enum ButtonRole
31    {
32        InvalidRole,
33        AcceptRole,
34        RejectRole,
35        DestructiveRole,
36        ActionRole,
37        HelpRole,
38        YesRole,
39        NoRole,
40        ResetRole,
41        ApplyRole,
42    };
43
44    enum Icon
45    {
46        NoIcon,
47        Information,
48        Warning,
49        Critical,
50        Question,
51    };
52
53    enum StandardButton
54    {
55        NoButton,
56        Ok,
57        Save,
58        SaveAll,
59        Open,
60        Yes,
61        YesToAll,
62        No,
63        NoToAll,
64        Abort,
65        Retry,
66        Ignore,
67        Close,
68        Cancel,
69        Discard,
70        Help,
71        Apply,
72        Reset,
73        RestoreDefaults,
74        FirstButton,
75        LastButton,
76        YesAll,
77        NoAll,
78        Default,
79        Escape,
80        FlagMask,
81        ButtonMask,
82    };
83
84    typedef QFlags<QMessageBox::StandardButton> StandardButtons;
85    typedef QMessageBox::StandardButton Button;
86    explicit QMessageBox(QWidget *parent /TransferThis/ = 0);
87    QMessageBox(QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::NoButton, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
88    virtual ~QMessageBox();
89    QString text() const;
90    void setText(const QString &);
91    QMessageBox::Icon icon() const;
92    void setIcon(QMessageBox::Icon);
93    QPixmap iconPixmap() const;
94    void setIconPixmap(const QPixmap &);
95    Qt::TextFormat textFormat() const;
96    void setTextFormat(Qt::TextFormat);
97    static QMessageBox::StandardButton information(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) /ReleaseGIL/;
98    static QMessageBox::StandardButton question(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No), QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) /ReleaseGIL/;
99    static QMessageBox::StandardButton warning(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) /ReleaseGIL/;
100    static QMessageBox::StandardButton critical(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) /ReleaseGIL/;
101    static void about(QWidget *parent, const QString &caption, const QString &text) /ReleaseGIL/;
102    static void aboutQt(QWidget *parent, const QString &title = QString()) /ReleaseGIL/;
103    static QPixmap standardIcon(QMessageBox::Icon icon);
104
105protected:
106    virtual bool event(QEvent *e);
107    virtual void resizeEvent(QResizeEvent *);
108    virtual void showEvent(QShowEvent *);
109    virtual void closeEvent(QCloseEvent *);
110    virtual void keyPressEvent(QKeyEvent *);
111    virtual void changeEvent(QEvent *);
112
113public:
114    void addButton(QAbstractButton *button /Transfer/, QMessageBox::ButtonRole role);
115    QPushButton *addButton(const QString &text, QMessageBox::ButtonRole role) /Transfer/;
116    QPushButton *addButton(QMessageBox::StandardButton button) /Transfer/;
117    void removeButton(QAbstractButton *button /TransferBack/);
118    void setStandardButtons(QMessageBox::StandardButtons buttons);
119    QMessageBox::StandardButtons standardButtons() const;
120    QMessageBox::StandardButton standardButton(QAbstractButton *button) const;
121    QAbstractButton *button(QMessageBox::StandardButton which) const;
122    QPushButton *defaultButton() const;
123    void setDefaultButton(QPushButton *button /KeepReference/);
124    void setDefaultButton(QMessageBox::StandardButton button);
125    QAbstractButton *escapeButton() const;
126    void setEscapeButton(QAbstractButton *button /KeepReference/);
127    void setEscapeButton(QMessageBox::StandardButton button);
128    QAbstractButton *clickedButton() const;
129    QString informativeText() const;
130    void setInformativeText(const QString &text);
131    QString detailedText() const;
132    void setDetailedText(const QString &text);
133    void setWindowTitle(const QString &title);
134    void setWindowModality(Qt::WindowModality windowModality);
135    virtual void open();
136    void open(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
137%MethodCode
138        QObject *receiver;
139        QByteArray slot_signature;
140
141        if ((sipError = pyqt5_qtwidgets_get_connection_parts(a0, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
142        {
143            sipCpp->open(receiver, slot_signature.constData());
144        }
145        else if (sipError == sipErrorContinue)
146        {
147            sipError = sipBadCallableArg(0, a0);
148        }
149%End
150
151    QList<QAbstractButton *> buttons() const;
152    QMessageBox::ButtonRole buttonRole(QAbstractButton *button) const;
153
154signals:
155    void buttonClicked(QAbstractButton *button);
156
157public:
158%If (Qt_5_1_0 -)
159    void setTextInteractionFlags(Qt::TextInteractionFlags flags);
160%End
161%If (Qt_5_1_0 -)
162    Qt::TextInteractionFlags textInteractionFlags() const;
163%End
164%If (Qt_5_2_0 -)
165    void setCheckBox(QCheckBox *cb);
166%End
167%If (Qt_5_2_0 -)
168    QCheckBox *checkBox() const;
169%End
170};
171
172QFlags<QMessageBox::StandardButton> operator|(QMessageBox::StandardButton f1, QFlags<QMessageBox::StandardButton> f2);
173