source: trunk/include/qwarp4style.h@ 203

Last change on this file since 203 was 175, checked in by dmik, 18 years ago

Styles: Implemented the first version of the Warp4 style (contributed by Cornelis Bockemuehl).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1/****************************************************************************
2** $Id: qwarp4style.h 175 2007-11-06 23:17:04Z dmik $
3**
4** Definition of OS/2 Warp-like style class
5**
6** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
7** Copyright (C) 2007-2007 netlabs.org. OS/2 Development.
8**
9**
10** This file is part of the widgets module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QWARP4STYLE_H
39#define QWARP4STYLE_H
40
41#ifndef QT_H
42#include "qcommonstyle.h"
43#endif // QT_H
44
45#if !defined(QT_NO_STYLE_WARP4) || defined(QT_PLUGIN)
46
47#if defined(QT_PLUGIN)
48#define Q_EXPORT_STYLE_WARP4
49#else
50#define Q_EXPORT_STYLE_WARP4 Q_EXPORT
51#endif
52
53#ifndef QT_NO_ICONSET
54class QIconFactory;
55#endif
56
57class Q_EXPORT_STYLE_WARP4 QWarp4Style : public QCommonStyle
58{
59 Q_OBJECT
60public:
61 QWarp4Style();
62 ~QWarp4Style();
63
64 void polish( QApplication * );
65 void unPolish( QApplication * );
66
67 void polish( QWidget * );
68 void unPolish( QWidget * );
69
70 void polish( QPalette & );
71
72 virtual void polishPopupMenu( QPopupMenu* );
73
74 // new stuff
75 void drawPrimitive( PrimitiveElement pe,
76 QPainter *p,
77 const QRect &r,
78 const QColorGroup &cg,
79 SFlags flags = Style_Default,
80 const QStyleOption& = QStyleOption::Default ) const;
81
82 void drawControl( ControlElement element,
83 QPainter *p,
84 const QWidget *widget,
85 const QRect &r,
86 const QColorGroup &cg,
87 SFlags flags = Style_Default,
88 const QStyleOption& = QStyleOption::Default ) const;
89
90 void drawComplexControl( ComplexControl control,
91 QPainter* p,
92 const QWidget* widget,
93 const QRect& r,
94 const QColorGroup& cg,
95 SFlags flags = Style_Default,
96 SCFlags sub = (uint)SC_All,
97 SCFlags subActive = SC_None,
98 const QStyleOption& = QStyleOption::Default ) const;
99
100 QRect querySubControlMetrics( ComplexControl control,
101 const QWidget *widget,
102 SubControl sc,
103 const QStyleOption& = QStyleOption::Default ) const;
104
105 int pixelMetric( PixelMetric metric,
106 const QWidget *widget = 0 ) const;
107
108 QSize sizeFromContents( ContentsType contents,
109 const QWidget *widget,
110 const QSize &contentsSize,
111 const QStyleOption& = QStyleOption::Default ) const;
112
113 int styleHint( StyleHint sh, const QWidget *,
114 const QStyleOption & = QStyleOption::Default,
115 QStyleHintReturn* = 0) const;
116
117 QPixmap stylePixmap( StylePixmap stylepixmap,
118 const QWidget *widget = 0,
119 const QStyleOption& = QStyleOption::Default ) const;
120
121 QRect subRect( SubRect r, const QWidget *widget ) const;
122
123private:
124
125 // Disabled copy constructor and operator=
126#if defined(Q_DISABLE_COPY)
127 QWarp4Style( const QWarp4Style & );
128 QWarp4Style& operator=( const QWarp4Style & );
129#endif
130
131#ifndef QT_NO_ICONSET
132 QIconFactory *oldDefIconFactory;
133 QIconFactory *pmDefIconFactory;
134#endif
135};
136
137#endif // QT_NO_STYLE_WARP4
138
139#endif // QWARP4STYLE_H
Note: See TracBrowser for help on using the repository browser.