QtGui/qs60style.h Source File

qs60style.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QS60STYLE_H
43 #define QS60STYLE_H
44 
45 #include <QtGui/qcommonstyle.h>
46 
48 
50 
51 QT_MODULE(Gui)
52 
53 //Public custom pixel metrics values.
54 //These can be used to fetch custom pixel metric value from outside QS60Style.
55 enum {
63  };
64 
65 enum {
151 };
152 
153 class QS60StylePrivate;
154 
155 class Q_GUI_EXPORT QS60Style : public QCommonStyle
156 {
157  Q_OBJECT
158  Q_DECLARE_PRIVATE(QS60Style)
159 
160 public:
161  QS60Style();
162  ~QS60Style();
163 
164  void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
165  void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
166  void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
167  int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
168  QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w = 0) const;
169  int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
170  QStyleHintReturn *shret = 0) const;
171  QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl scontrol, const QWidget *widget = 0) const;
172  QRect subElementRect(SubElement element, const QStyleOption *opt, const QWidget *widget = 0) const;
173  void polish(QWidget *widget);
174  void unpolish(QWidget *widget);
175  void polish(QApplication *application);
176  void unpolish(QApplication *application);
177 #ifndef Q_NO_USING_KEYWORD
178  using QCommonStyle::polish;
179 #endif
180  bool event(QEvent *e);
181 
182 #ifndef Q_OS_SYMBIAN
183  static QStringList partKeys();
184  static QStringList colorListKeys();
185  void setS60Theme(const QHash<QString, QPicture> &parts,
186  const QHash<QPair<QString , int>, QColor> &colors);
187  bool loadS60ThemeFromBlob(const QString &blobFile);
188  bool saveS60ThemeToBlob(const QString &blobFile) const;
189 #endif // !Q_OS_SYMBIAN
190 
191 protected Q_SLOTS:
193  StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const;
194 
195 protected:
196  void timerEvent(QTimerEvent *event);
197  bool eventFilter(QObject *o, QEvent *e);
198 private:
199  Q_DISABLE_COPY(QS60Style)
200  friend class QStyleFactory;
201  friend class QApplicationPrivate;
202 };
203 
205 
207 
208 #endif // QS60STYLE_H
virtual bool eventFilter(QObject *, QEvent *)
#define QT_END_NAMESPACE
Definition: qglobal.h:128
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
int styleHint(StyleHint sh, const QStyleOption *opt=0, const QWidget *w=0, QStyleHintReturn *shret=0) const
Definition: qcolor.h:67
#define Q_SLOTS
Definition: qobjectdefs.h:71
Definition: qicon.h:60
PrimitiveElement
Definition: qstyle.h:145
void unpolish(QWidget *widget)
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=0) const
virtual void timerEvent(QTimerEvent *)
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
StyleHint
Definition: qstyle.h:640
#define Q_OBJECT
Definition: qobjectdefs.h:157
SubControl
Definition: qstyle.h:402
void polish(QPalette &)
Definition: qrect.h:58
virtual bool event(QEvent *)
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Definition: qsize.h:53
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt=0, const QWidget *widget=0) const
PixelMetric
Definition: qstyle.h:474
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
ContentsType
Definition: qstyle.h:602
int pixelMetric(PixelMetric m, const QStyleOption *opt=0, const QWidget *widget=0) const
#define QT_END_HEADER
Definition: qglobal.h:142
SubElement
Definition: qstyle.h:289
StandardPixmap
Definition: qstyle.h:755
ComplexControl
Definition: qstyle.h:386
ControlElement
Definition: qstyle.h:217