1// qcolordialog.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 QColorDialog : QDialog
24{
25%TypeHeaderCode
26#include <qcolordialog.h>
27%End
28
29public:
30    enum ColorDialogOption
31    {
32        ShowAlphaChannel,
33        NoButtons,
34        DontUseNativeDialog,
35    };
36
37    typedef QFlags<QColorDialog::ColorDialogOption> ColorDialogOptions;
38    explicit QColorDialog(QWidget *parent /TransferThis/ = 0);
39    QColorDialog(const QColor &initial, QWidget *parent /TransferThis/ = 0);
40    virtual ~QColorDialog();
41    static QColor getColor(const QColor &initial = Qt::white, QWidget *parent = 0, const QString &title = QString(), QColorDialog::ColorDialogOptions options = QColorDialog::ColorDialogOptions()) /ReleaseGIL/;
42    static int customCount();
43    static QColor customColor(int index);
44    static void setCustomColor(int index, QColor color);
45    static QColor standardColor(int index);
46    static void setStandardColor(int index, QColor color);
47
48signals:
49    void colorSelected(const QColor &color);
50    void currentColorChanged(const QColor &color);
51
52protected:
53    virtual void changeEvent(QEvent *e);
54    virtual void done(int result);
55
56public:
57    void setCurrentColor(const QColor &color);
58    QColor currentColor() const;
59    QColor selectedColor() const;
60    void setOption(QColorDialog::ColorDialogOption option, bool on = true);
61    bool testOption(QColorDialog::ColorDialogOption option) const;
62    void setOptions(QColorDialog::ColorDialogOptions options);
63    QColorDialog::ColorDialogOptions options() const;
64    virtual void open();
65    void open(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
66%MethodCode
67        QObject *receiver;
68        QByteArray slot_signature;
69
70        if ((sipError = pyqt5_qtwidgets_get_connection_parts(a0, sipCpp, "()", false, &receiver, slot_signature)) == sipErrorNone)
71        {
72            sipCpp->open(receiver, slot_signature.constData());
73        }
74        else if (sipError == sipErrorContinue)
75        {
76            sipError = sipBadCallableArg(0, a0);
77        }
78%End
79
80    virtual void setVisible(bool visible);
81};
82
83QFlags<QColorDialog::ColorDialogOption> operator|(QColorDialog::ColorDialogOption f1, QFlags<QColorDialog::ColorDialogOption> f2);
84