QtGui/qgtkstyle.h Source File

qgtkstyle.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 QGTKSTYLE_H
43 #define QGTKSTYLE_H
44 
45 #include <QtGui/QCleanlooksStyle>
46 #include <QtGui/QPalette>
47 #include <QtGui/QFont>
48 #include <QtGui/QFileDialog>
49 
51 
53 
54 QT_MODULE(Gui)
55 
56 #if !defined(QT_NO_STYLE_GTK)
57 
58 class QPainterPath;
59 class QGtkStylePrivate;
60 
61 class Q_GUI_EXPORT QGtkStyle : public QCleanlooksStyle
62 {
63  Q_OBJECT
64  Q_DECLARE_PRIVATE(QGtkStyle)
65 
66 public:
67  QGtkStyle();
68  QGtkStyle(QGtkStylePrivate &dd);
69 
70  ~QGtkStyle();
71 
72  QPalette standardPalette() const;
73 
74  void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
75  QPainter *painter, const QWidget *widget) const;
76  void drawControl(ControlElement control, const QStyleOption *option,
77  QPainter *painter, const QWidget *widget) const;
78  void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
79  QPainter *painter, const QWidget *widget) const;
80  void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
81  const QPixmap &pixmap) const;
82  void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
83  bool enabled, const QString& text, QPalette::ColorRole textRole) const;
84 
85  int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
86  const QWidget *widget = 0) const;
87  int styleHint(StyleHint hint, const QStyleOption *option,
88  const QWidget *widget, QStyleHintReturn *returnData) const;
89 
90  QStyle::SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
91  const QPoint &pt, const QWidget *w) const;
92 
93  QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option,
94  SubControl subControl, const QWidget *widget) const;
95  QRect subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const;
96  QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
97 
98 
99  QSize sizeFromContents(ContentsType type, const QStyleOption *option,
100  const QSize &size, const QWidget *widget) const;
101  QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *option,
102  const QWidget *widget) const;
103  QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
104  const QStyleOption *opt) const;
105 
106  void polish(QWidget *widget);
107  void polish(QApplication *app);
108  void polish(QPalette &palette);
109 
110  void unpolish(QWidget *widget);
111  void unpolish(QApplication *app);
112 
113  static bool getGConfBool(const QString &key, bool fallback = 0);
114  static QString getGConfString(const QString &key, const QString &fallback = QString());
115 
116 
117 protected Q_SLOTS:
118  QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option,
119  const QWidget *widget = 0) const;
120 };
121 
122 #endif
123 
125 
127 
128 #endif //QGTKSTYLE_H
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
GLdouble GLdouble GLdouble r
Definition: GLee.h:1189
#define QT_END_NAMESPACE
Definition: qglobal.h:128
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
GLXFBConfig Pixmap pixmap
Definition: GLee.h:10237
#define Q_SLOTS
Definition: qobjectdefs.h:71
Definition: qicon.h:60
Definition: qpoint.h:53
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
Definition: qstyle.h:68
#define Q_OBJECT
Definition: qobjectdefs.h:157
Definition: qrect.h:58
Definition: qsize.h:53
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
#define QT_END_HEADER
Definition: qglobal.h:142
GLsizeiptr size
Definition: GLee.h:1561