qhbstyle/qhbstyle.h
changeset 4 90517678cc4f
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 *
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not,
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:
       
    19 *
       
    20 */
       
    21 #ifndef QHBSTYLE_H
       
    22 #define QHBSTYLE_H
       
    23 
       
    24 #include <QtGui/qcommonstyle.h>
       
    25 
       
    26 class QHbStylePrivate;
       
    27 
       
    28 class QHbStyle : public QCommonStyle
       
    29 {
       
    30     Q_OBJECT
       
    31     Q_DECLARE_PRIVATE(QHbStyle)
       
    32 
       
    33 public:
       
    34     QHbStyle();
       
    35     ~QHbStyle();
       
    36 
       
    37     void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
       
    38                        QPainter *painter, const QWidget *widget = 0) const;
       
    39     void drawControl(ControlElement element, const QStyleOption *option,
       
    40                      QPainter *painter, const QWidget *widget) const;
       
    41     void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
       
    42                             QPainter *painter, const QWidget *widget) const;
       
    43     QSize sizeFromContents(ContentsType type, const QStyleOption *option,
       
    44                            const QSize &size, const QWidget *widget) const;
       
    45 
       
    46     QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
       
    47     QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
       
    48                          SubControl sc, const QWidget *widget) const;
       
    49 
       
    50     int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0,
       
    51                   QStyleHintReturn *returnData = 0) const;
       
    52 
       
    53     int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
       
    54 
       
    55     QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
       
    56                            const QWidget *widget = 0) const;
       
    57 
       
    58     void polish(QWidget *widget);
       
    59     void polish(QApplication *app);
       
    60     void polish(QPalette &pal);
       
    61     void unpolish(QWidget *widget);
       
    62     void unpolish(QApplication *app);
       
    63 
       
    64     QPalette standardPalette() const;
       
    65 
       
    66 protected Q_SLOTS:
       
    67     QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0,
       
    68                                      const QWidget *widget = 0) const;
       
    69     int layoutSpacingImplementation(QSizePolicy::ControlType control1,
       
    70                                     QSizePolicy::ControlType control2,
       
    71                                     Qt::Orientation orientation,
       
    72                                     const QStyleOption *option = 0,
       
    73                                     const QWidget *widget = 0) const;
       
    74 
       
    75 protected:
       
    76     bool eventFilter(QObject *watched, QEvent *event);
       
    77     void animateControl(ControlElement element, const QStyleOption *option,
       
    78                          QPainter *painter, const QWidget *widget) const;
       
    79 
       
    80 
       
    81 private:
       
    82     QHbStylePrivate* m_private;
       
    83     Q_DISABLE_COPY(QHbStyle)
       
    84 };
       
    85 
       
    86 #endif //QHBSTYLE_H