-rw-r--r-- | library/qpestyle.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/library/qpestyle.h b/library/qpestyle.h new file mode 100644 index 0000000..19ef346 --- a/dev/null +++ b/library/qpestyle.h | |||
@@ -0,0 +1,102 @@ | |||
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 | |||
21 | #ifndef QPESTYLE_H | ||
22 | #define QPESTYLE_H | ||
23 | |||
24 | #ifndef QT_H | ||
25 | #include "qwindowsstyle.h" | ||
26 | #endif // QT_H | ||
27 | |||
28 | #if QT_VERSION >= 300 | ||
29 | |||
30 | class Q_EXPORT QPEStyle : public QWindowsStyle | ||
31 | { | ||
32 | public: | ||
33 | QPEStyle(); | ||
34 | virtual ~QPEStyle(); | ||
35 | |||
36 | virtual void drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags=Style_Default, const QStyleOption & = QStyleOption::Default) const; | ||
37 | virtual void drawControl( ControlElement ce, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, const QStyleOption & = QStyleOption::Default) const; | ||
38 | virtual void drawComplexControl( ComplexControl control, QPainter *p, const QWidget *widget, const QRect &r, const QColorGroup &cg, SFlags how=Style_Default, SCFlags sub=SC_All, SCFlags subActive=SC_None, const QStyleOption & = QStyleOption::Default) const; | ||
39 | virtual int pixelMetric( PixelMetric metric, const QWidget *widget=0 ) const; | ||
40 | virtual QSize sizeFromContents( ContentsType contents, const QWidget *widget, const QSize &contentsSize, const QStyleOption & = QStyleOption::Default) const; | ||
41 | }; | ||
42 | |||
43 | #else | ||
44 | |||
45 | class Q_EXPORT QPEStyle : public QWindowsStyle | ||
46 | { | ||
47 | public: | ||
48 | QPEStyle(); | ||
49 | virtual ~QPEStyle(); | ||
50 | virtual void polish( QPalette &p ); | ||
51 | virtual void polish( QWidget *w ); | ||
52 | virtual void unPolish( QWidget *w ); | ||
53 | |||
54 | int defaultFrameWidth () const; | ||
55 | void drawPanel ( QPainter * p, int x, int y, int w, int h, | ||
56 | const QColorGroup &, bool sunken=FALSE, int lineWidth = 1, const QBrush * fill = 0 ); | ||
57 | void drawButton( QPainter *p, int x, int y, int w, int h, | ||
58 | const QColorGroup &g, bool sunken, const QBrush* fill ); | ||
59 | void drawButtonMask ( QPainter * p, int x, int y, int w, int h ); | ||
60 | void drawBevelButton( QPainter *p, int x, int y, int w, int h, | ||
61 | const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 ); | ||
62 | QRect comboButtonRect( int x, int y, int w, int h); | ||
63 | QRect comboButtonFocusRect( int x, int y, int w, int h); | ||
64 | void drawComboButton( QPainter *p, int x, int y, int w, int h, | ||
65 | const QColorGroup &g, bool sunken, bool, bool enabled, | ||
66 | const QBrush *fill ); | ||
67 | void drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h, | ||
68 | const QColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE ); | ||
69 | void drawIndicator ( QPainter * p, int x, int y, int w, int h, | ||
70 | const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE ); | ||
71 | void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int&); | ||
72 | void drawScrollBarControls( QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl ); | ||
73 | ScrollControl scrollBarPointOver( const QScrollBar* sb, int sliderStart, const QPoint& p ); | ||
74 | void drawRiffles( QPainter* p, int x, int y, int w, int h, | ||
75 | const QColorGroup &g, bool horizontal ); | ||
76 | int sliderLength() const; | ||
77 | void drawSlider( QPainter *p, int x, int y, int w, int h, | ||
78 | const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow ); | ||
79 | void drawSliderMask( QPainter *p, int x, int y, int w, int h, | ||
80 | Orientation, bool tickAbove, bool tickBelow ); | ||
81 | void drawSliderGrooveMask( QPainter *p, int x, int y, int w, int h, | ||
82 | const QColorGroup& , QCOORD c, Orientation orient ); | ||
83 | void drawTab( QPainter *, const QTabBar *, QTab *, bool selected ); | ||
84 | int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& ); | ||
85 | int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& ); | ||
86 | void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, | ||
87 | const QPalette& pal, | ||
88 | bool act, bool enabled, int x, int y, int w, int h); | ||
89 | |||
90 | int buttonMargin() const; | ||
91 | QSize scrollBarExtent() const; | ||
92 | |||
93 | private:// Disabled copy constructor and operator= | ||
94 | #if defined(Q_DISABLE_COPY) | ||
95 | QPEStyle( const QPEStyle & ); | ||
96 | QPEStyle& operator=( const QPEStyle & ); | ||
97 | #endif | ||
98 | }; | ||
99 | |||
100 | #endif | ||
101 | |||
102 | #endif // QPESTYLE_H | ||