1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef QPROXYSTYLE_H
|
---|
43 | #define QPROXYSTYLE_H
|
---|
44 |
|
---|
45 | #include <QtGui/QCommonStyle>
|
---|
46 |
|
---|
47 | QT_BEGIN_HEADER
|
---|
48 |
|
---|
49 | QT_BEGIN_NAMESPACE
|
---|
50 |
|
---|
51 | QT_MODULE(Gui)
|
---|
52 |
|
---|
53 | #if !defined(QT_NO_STYLE_PROXY)
|
---|
54 |
|
---|
55 | class QProxyStylePrivate;
|
---|
56 | class Q_GUI_EXPORT QProxyStyle : public QCommonStyle
|
---|
57 | {
|
---|
58 | Q_OBJECT
|
---|
59 |
|
---|
60 | public:
|
---|
61 | QProxyStyle(QStyle *baseStyle = 0);
|
---|
62 | ~QProxyStyle();
|
---|
63 |
|
---|
64 | QStyle *baseStyle() const;
|
---|
65 | void setBaseStyle(QStyle *style);
|
---|
66 |
|
---|
67 | void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
|
---|
68 | void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
|
---|
69 | void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
|
---|
70 | void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled,
|
---|
71 | const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const;
|
---|
72 | virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const;
|
---|
73 |
|
---|
74 | QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const;
|
---|
75 |
|
---|
76 | QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
|
---|
77 | QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const;
|
---|
78 | QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const;
|
---|
79 | QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
|
---|
80 |
|
---|
81 | SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget = 0) const;
|
---|
82 | int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const;
|
---|
83 | int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
|
---|
84 |
|
---|
85 | QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = 0) const;
|
---|
86 | QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const;
|
---|
87 | QPalette standardPalette() const;
|
---|
88 |
|
---|
89 | void polish(QWidget *widget);
|
---|
90 | void polish(QPalette &pal);
|
---|
91 | void polish(QApplication *app);
|
---|
92 |
|
---|
93 | void unpolish(QWidget *widget);
|
---|
94 | void unpolish(QApplication *app);
|
---|
95 |
|
---|
96 | protected:
|
---|
97 | bool event(QEvent *e);
|
---|
98 |
|
---|
99 | protected Q_SLOTS:
|
---|
100 | QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const;
|
---|
101 | int layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
|
---|
102 | Qt::Orientation orientation, const QStyleOption *option = 0, const QWidget *widget = 0) const;
|
---|
103 | private:
|
---|
104 | Q_DISABLE_COPY(QProxyStyle)
|
---|
105 | Q_DECLARE_PRIVATE(QProxyStyle)
|
---|
106 | };
|
---|
107 |
|
---|
108 | #endif // QT_NO_STYLE_PROXY
|
---|
109 |
|
---|
110 | QT_END_NAMESPACE
|
---|
111 |
|
---|
112 | QT_END_HEADER
|
---|
113 |
|
---|
114 | #endif // QPROXYSTYLE_H
|
---|