1// qfontdialog.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 QFontDialog : QDialog
24{
25%TypeHeaderCode
26#include <qfontdialog.h>
27%End
28
29public:
30    enum FontDialogOption
31    {
32        NoButtons,
33        DontUseNativeDialog,
34%If (Qt_5_2_0 -)
35        ScalableFonts,
36%End
37%If (Qt_5_2_0 -)
38        NonScalableFonts,
39%End
40%If (Qt_5_2_0 -)
41        MonospacedFonts,
42%End
43%If (Qt_5_2_0 -)
44        ProportionalFonts,
45%End
46    };
47
48    typedef QFlags<QFontDialog::FontDialogOption> FontDialogOptions;
49    explicit QFontDialog(QWidget *parent /TransferThis/ = 0);
50    QFontDialog(const QFont &initial, QWidget *parent /TransferThis/ = 0);
51    virtual ~QFontDialog();
52    static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = 0, const QString &caption = QString(), QFontDialog::FontDialogOptions options = QFontDialog::FontDialogOptions()) /ReleaseGIL/;
53    static QFont getFont(bool *ok, QWidget *parent = 0) /ReleaseGIL/;
54
55protected:
56    virtual void changeEvent(QEvent *e);
57    virtual void done(int result);
58    virtual bool eventFilter(QObject *object, QEvent *event);
59
60public:
61    void setCurrentFont(const QFont &font);
62    QFont currentFont() const;
63    QFont selectedFont() const;
64    void setOption(QFontDialog::FontDialogOption option, bool on = true);
65    bool testOption(QFontDialog::FontDialogOption option) const;
66    void setOptions(QFontDialog::FontDialogOptions options);
67    QFontDialog::FontDialogOptions options() const;
68    virtual void open();
69    void open(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
70%MethodCode
71        QObject *receiver;
72        QByteArray slot_signature;
73
74        if ((sipError = pyqt5_qtwidgets_get_connection_parts(a0, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
75        {
76            sipCpp->open(receiver, slot_signature.constData());
77        }
78        else if (sipError == sipErrorContinue)
79        {
80            sipError = sipBadCallableArg(0, a0);
81        }
82%End
83
84    virtual void setVisible(bool visible);
85
86signals:
87    void currentFontChanged(const QFont &font);
88    void fontSelected(const QFont &font);
89};
90
91QFlags<QFontDialog::FontDialogOption> operator|(QFontDialog::FontDialogOption f1, QFlags<QFontDialog::FontDialogOption> f2);
92