File indexing completed on 2024-04-21 14:55:52

0001 /*  This file is part of the KDE libraries
0002 
0003     Copyright (C) 2007 Fredrik Höglund <fredrik@kde.org>
0004 
0005     This library is free software; you can redistribute it and/or
0006     modify it under the terms of the GNU Lesser General Public
0007     License (LGPL) as published by the Free Software Foundation;
0008     either version 2 of the License, or (at your option) any later
0009     version.
0010 
0011     This library is distributed in the hope that it will be useful,
0012     but WITHOUT ANY WARRANTY; without even the implied warranty of
0013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014     Lesser General Public License for more details.
0015 
0016     You should have received a copy of the GNU Lesser General Public License
0017     along with this library; see the file COPYING.LIB.  If not, write to
0018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019     Boston, MA 02110-1301, USA.
0020 */
0021 #ifndef KDEUIWIDGETSPROXYSTYLE_P_H
0022 #define KDEUIWIDGETSPROXYSTYLE_P_H
0023 
0024 #include <kdelibs4support_export.h>
0025 
0026 #include <QStyle>
0027 
0028 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KdeUiProxyStyle : public QStyle
0029 {
0030     Q_OBJECT
0031 public:
0032     KdeUiProxyStyle(QWidget *referenceWidget);
0033     ~KdeUiProxyStyle() override;
0034     virtual QStyle *style() const;
0035     void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter,
0036                             const QWidget *widget) const override;
0037     void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override;
0038     void drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const override;
0039     void drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled,
0040                       const QString &text, QPalette::ColorRole textRole) const override;
0041     void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter,
0042                        const QWidget *widget) const override;
0043     QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const override;
0044     SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &position,
0045                                      const QWidget *widget) const override;
0046     QRect itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const override;
0047     QRect itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment,
0048                        bool enabled, const QString &text) const override;
0049     int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation,
0050                       const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
0051     int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override;
0052     void polish(QWidget *widget) override;
0053     void polish(QApplication *application) override;
0054     void polish(QPalette &palette) override;
0055     QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize,
0056                            const QWidget *widget) const override;
0057     QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const override;
0058     QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option, const QWidget *widget) const override;
0059     QPalette standardPalette() const override;
0060     int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const override;
0061     QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl,
0062                          const QWidget *widget) const override;
0063     QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const override;
0064     void unpolish(QWidget *widget) override;
0065     void unpolish(QApplication *application) override;
0066 
0067 protected:
0068     QWidget *m_referenceWidget;
0069 };
0070 
0071 #endif