| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QFUSIONSTYLE_P_H |
| 5 | #define QFUSIONSTYLE_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
| 19 | #include <QtWidgets/qcommonstyle.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | |
| 24 | #if QT_CONFIG(style_fusion) |
| 25 | |
| 26 | class QFusionStylePrivate; |
| 27 | class Q_WIDGETS_EXPORT QFusionStyle : public QCommonStyle |
| 28 | { |
| 29 | Q_OBJECT |
| 30 | Q_DECLARE_PRIVATE(QFusionStyle) |
| 31 | |
| 32 | public: |
| 33 | QFusionStyle(); |
| 34 | ~QFusionStyle(); |
| 35 | |
| 36 | QPalette standardPalette () const override; |
| 37 | void drawPrimitive(PrimitiveElement elem, |
| 38 | const QStyleOption *option, |
| 39 | QPainter *painter, const QWidget *widget = nullptr) const override; |
| 40 | void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter, |
| 41 | const QWidget *widget) const override; |
| 42 | int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override; |
| 43 | void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, |
| 44 | QPainter *painter, const QWidget *widget) const override; |
| 45 | QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override; |
| 46 | QSize sizeFromContents(ContentsType type, const QStyleOption *option, |
| 47 | const QSize &size, const QWidget *widget) const override; |
| 48 | SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, |
| 49 | const QPoint &pt, const QWidget *w = nullptr) const override; |
| 50 | QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, |
| 51 | SubControl sc, const QWidget *widget) const override; |
| 52 | QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, |
| 53 | const QStyleOption *opt) const override; |
| 54 | int styleHint(StyleHint hint, const QStyleOption *option = nullptr, const QWidget *widget = nullptr, |
| 55 | QStyleHintReturn *returnData = nullptr) const override; |
| 56 | QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override; |
| 57 | QIcon iconFromTheme(StandardPixmap standardIcon) const; |
| 58 | QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr, |
| 59 | const QWidget *widget = nullptr) const override; |
| 60 | QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, |
| 61 | const QWidget *widget = nullptr) const override; |
| 62 | void drawItemPixmap(QPainter *painter, const QRect &rect, |
| 63 | int alignment, const QPixmap &pixmap) const override; |
| 64 | void drawItemText(QPainter *painter, const QRect &rect, |
| 65 | int flags, const QPalette &pal, bool enabled, |
| 66 | const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const override; |
| 67 | void polish(QWidget *widget) override; |
| 68 | void polish(QApplication *app) override; |
| 69 | void polish(QPalette &pal) override; |
| 70 | void unpolish(QWidget *widget) override; |
| 71 | void unpolish(QApplication *app) override; |
| 72 | |
| 73 | protected: |
| 74 | QFusionStyle(QFusionStylePrivate &dd); |
| 75 | |
| 76 | }; |
| 77 | |
| 78 | #endif // style_fusion |
| 79 | |
| 80 | QT_END_NAMESPACE |
| 81 | |
| 82 | #endif //QFUSIONSTYLE_P_H |
| 83 | |