File indexing completed on 2025-01-26 05:08:07

0001 /*
0002     SPDX-FileCopyrightText: 2007 Fredrik Höglund <fredrik@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #pragma once
0007 #include <QStyle>
0008 
0009 namespace KFI
0010 {
0011 class CFontFilterProxyStyle : public QStyle
0012 {
0013 public:
0014     CFontFilterProxyStyle(QWidget *parent);
0015     QStyle *style() const;
0016     void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const override;
0017     void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
0018     void drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const override;
0019     void drawItemText(QPainter *painter,
0020                       const QRect &rectangle,
0021                       int alignment,
0022                       const QPalette &palette,
0023                       bool enabled,
0024                       const QString &text,
0025                       QPalette::ColorRole textRole) const override;
0026     void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
0027     QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const override;
0028     SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &position, const QWidget *widget) const override;
0029     QRect itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const override;
0030     QRect itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment, bool enabled, const QString &text) const override;
0031     int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override;
0032     void polish(QWidget *widget) override;
0033     void polish(QApplication *application) override;
0034     void polish(QPalette &palette) override;
0035     QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const override;
0036     QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const override;
0037     QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option, const QWidget *widget) const override;
0038     QPalette standardPalette() const override;
0039     int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const override;
0040     QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const override;
0041     QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const override;
0042     void unpolish(QWidget *widget) override;
0043     void unpolish(QApplication *application) override;
0044     int layoutSpacing(QSizePolicy::ControlType control1,
0045                       QSizePolicy::ControlType control2,
0046                       Qt::Orientation orientation,
0047                       const QStyleOption *option = nullptr,
0048                       const QWidget *widget = nullptr) const override;
0049 
0050 protected:
0051     QWidget *parent;
0052 };
0053 
0054 }