summaryrefslogtreecommitdiff
path: root/library/lightstyle.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /library/lightstyle.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'library/lightstyle.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/lightstyle.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/library/lightstyle.h b/library/lightstyle.h
new file mode 100644
index 0000000..c377cc2
--- a/dev/null
+++ b/library/lightstyle.h
@@ -0,0 +1,120 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef LIGHTSTYLE_H
21#define LIGHTSTYLE_H
22
23
24#ifndef QT_H
25#include <qstyle.h>
26#include <qwindowsstyle.h>
27#endif // QT_H
28
29#if QT_VERSION < 300
30
31#ifdef QT_PLUGIN_STYLE_LIGHT
32# define Q_EXPORT_STYLE_LIGHT
33#else
34# define Q_EXPORT_STYLE_LIGHT Q_EXPORT
35#endif // QT_PLUGIN_STYLE_LIGHT
36
37
38class Q_EXPORT_STYLE_LIGHT LightStyle : public QWindowsStyle
39{
40public:
41 LightStyle();
42 virtual ~LightStyle();
43
44 void polish(QWidget *widget);
45 void unPolish(QWidget*widget);
46
47 void polish(QApplication *app);
48 void unPolish(QApplication *app);
49
50 void polishPopupMenu(QPopupMenu *menu);
51
52 void drawPushButton(QPushButton *button, QPainter *p);
53 void drawButton(QPainter *p, int x, int y, int w, int h,
54 const QColorGroup &g, bool sunken = FALSE,
55 const QBrush *fill = 0);
56 void drawBevelButton(QPainter *p, int x, int y, int w, int h,
57 const QColorGroup &g, bool sunken = FALSE,
58 const QBrush *fill = 0);
59 void getButtonShift(int &x, int &y) const;
60
61 void drawComboButton(QPainter *p, int x, int y, int w, int h,
62 const QColorGroup &g, bool sunken = FALSE,
63 bool editable = FALSE, bool = TRUE,
64 const QBrush *fill = 0);
65 QRect comboButtonRect(int x, int y, int w, int h) const;
66 QRect comboButtonFocusRect(int x, int y, int w, int h) const;
67
68 void drawIndicator(QPainter *p, int x, int y ,int w, int h,
69 const QColorGroup &g, int state,
70 bool = FALSE, bool = TRUE);
71 QSize indicatorSize() const;
72
73 void drawExclusiveIndicator(QPainter *p, int x, int y ,int w, int h,
74 const QColorGroup &g, bool on,
75 bool = FALSE, bool = TRUE);
76 QSize exclusiveIndicatorSize() const;
77
78 void drawPanel(QPainter * p, int x, int y, int w, int h,
79 const QColorGroup &g, bool sunken = FALSE,
80 int = 1, const QBrush * = 0);
81
82 void scrollBarMetrics( const QScrollBar *,
83 int &, int &, int &, int & ) const;
84 void drawScrollBarControls(QPainter* p, const QScrollBar* sb,
85 int sliderStart, uint controls,
86 uint activeControl);
87 QStyle::ScrollControl scrollBarPointOver(const QScrollBar *, int, const QPoint& p);
88
89 void drawTab(QPainter *p, const QTabBar *tabbar, QTab *tab, bool selected);
90
91 void drawSlider(QPainter *p, int x, int y, int w, int h,
92 const QColorGroup &g, Qt::Orientation orientation,
93 bool, bool);
94 void drawSliderGroove(QPainter *p, int x, int y, int w, int h,
95 const QColorGroup& g, QCOORD,
96 Qt::Orientation );
97
98 void drawToolBarHandle(QPainter *, const QRect &, Qt::Orientation,
99 bool, const QColorGroup &, bool = FALSE );
100
101 QSize scrollBarExtent() const;
102 int buttonDefaultIndicatorWidth() const;
103 int buttonMargin() const;
104 int sliderThickness() const;
105 int sliderLength() const;
106 int defaultFrameWidth() const;
107
108 int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& );
109 int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& );
110 void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi,
111 const QPalette& pal,
112 bool act, bool enabled, int x, int y, int w, int h);
113
114protected:
115 bool eventFilter(QObject *, QEvent *);
116};
117
118#endif
119
120#endif // LIGHTSTYLE_H