-rw-r--r-- | noncore/styles/flat/flat.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/noncore/styles/flat/flat.h b/noncore/styles/flat/flat.h new file mode 100644 index 0000000..e446800 --- a/dev/null +++ b/noncore/styles/flat/flat.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the 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 FLATSTYLE_H | ||
22 | #define FLATSTYLE_H | ||
23 | |||
24 | #include <qwindowsstyle.h> | ||
25 | #include <qpe/styleinterface.h> | ||
26 | |||
27 | class FlatStylePrivate; | ||
28 | |||
29 | class Q_EXPORT FlatStyle : public QWindowsStyle | ||
30 | { | ||
31 | public: | ||
32 | FlatStyle(); | ||
33 | virtual ~FlatStyle(); | ||
34 | virtual void polish( QPalette &p ); | ||
35 | virtual void polish( QWidget *w ); | ||
36 | virtual void unPolish( QWidget *w ); | ||
37 | |||
38 | int defaultFrameWidth () const; | ||
39 | void drawItem( QPainter *p, int x, int y, int w, int h, | ||
40 | int flags, const QColorGroup &g, bool enabled, | ||
41 | const QPixmap *pixmap, const QString& text, int len, const QColor* penColor ); | ||
42 | void drawPanel ( QPainter * p, int x, int y, int w, int h, | ||
43 | const QColorGroup &, bool sunken=FALSE, int lineWidth = 1, const QBrush * fill = 0 ); | ||
44 | void drawButton( QPainter *p, int x, int y, int w, int h, | ||
45 | const QColorGroup &g, bool sunken, const QBrush* fill ); | ||
46 | void drawButtonMask ( QPainter * p, int x, int y, int w, int h ); | ||
47 | void drawBevelButton( QPainter *p, int x, int y, int w, int h, | ||
48 | const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 ); | ||
49 | void drawToolButton( QPainter *p, int x, int y, int w, int h, | ||
50 | const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 ); | ||
51 | void drawPushButton( QPushButton *btn, QPainter *p ); | ||
52 | void drawPushButtonLabel( QPushButton *btn, QPainter *p ); | ||
53 | QRect comboButtonRect( int x, int y, int w, int h); | ||
54 | QRect comboButtonFocusRect( int x, int y, int w, int h); | ||
55 | void drawComboButton( QPainter *p, int x, int y, int w, int h, | ||
56 | const QColorGroup &g, bool sunken, bool, bool enabled, | ||
57 | const QBrush *fill ); | ||
58 | void drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h, | ||
59 | const QColorGroup & g, bool on, bool down = FALSE, bool enabled = TRUE ); | ||
60 | void drawIndicator ( QPainter * p, int x, int y, int w, int h, | ||
61 | const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE ); | ||
62 | void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int&); | ||
63 | void drawScrollBarControls( QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl ); | ||
64 | ScrollControl scrollBarPointOver( const QScrollBar* sb, int sliderStart, const QPoint& p ); | ||
65 | void drawRiffles( QPainter* p, int x, int y, int w, int h, | ||
66 | const QColorGroup &g, bool horizontal ); | ||
67 | int sliderLength() const; | ||
68 | void drawSlider( QPainter *p, int x, int y, int w, int h, | ||
69 | const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow ); | ||
70 | void drawSliderMask( QPainter *p, int x, int y, int w, int h, | ||
71 | Orientation, bool tickAbove, bool tickBelow ); | ||
72 | void drawSliderGrooveMask( QPainter *p, int x, int y, int w, int h, | ||
73 | const QColorGroup& , QCOORD c, Orientation orient ); | ||
74 | void drawSliderGroove ( QPainter * p, int x, int y, int w, int h, const QColorGroup & g, QCOORD c, Orientation ); | ||
75 | void drawTab( QPainter *, const QTabBar *, QTab *, bool selected ); | ||
76 | int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& ); | ||
77 | int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& ); | ||
78 | void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, | ||
79 | const QPalette& pal, | ||
80 | bool act, bool enabled, int x, int y, int w, int h); | ||
81 | |||
82 | int buttonMargin() const; | ||
83 | QSize scrollBarExtent() const; | ||
84 | void getButtonShift( int &x, int &y ); | ||
85 | |||
86 | private: | ||
87 | FlatStylePrivate *d; | ||
88 | bool revItem; | ||
89 | // Disabled copy constructor and operator= | ||
90 | #if defined(Q_DISABLE_COPY) | ||
91 | FlatStyle( const FlatStyle & ); | ||
92 | FlatStyle& operator=( const FlatStyle & ); | ||
93 | #endif | ||
94 | }; | ||
95 | |||
96 | |||
97 | class FlatStyleImpl : public StyleInterface | ||
98 | { | ||
99 | public: | ||
100 | FlatStyleImpl(); | ||
101 | virtual ~FlatStyleImpl(); | ||
102 | |||
103 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | ||
104 | Q_REFCOUNT | ||
105 | |||
106 | virtual QStyle *style(); | ||
107 | virtual QString name() const; | ||
108 | |||
109 | private: | ||
110 | FlatStyle *flat; | ||
111 | ulong ref; | ||
112 | }; | ||
113 | |||
114 | #endif // FLATSTYLE_H | ||