summaryrefslogtreecommitdiff
path: root/noncore/styles/flat/flat.h
Unidiff
Diffstat (limited to 'noncore/styles/flat/flat.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/flat/flat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/styles/flat/flat.h b/noncore/styles/flat/flat.h
index e446800..ebea95b 100644
--- a/noncore/styles/flat/flat.h
+++ b/noncore/styles/flat/flat.h
@@ -1,114 +1,118 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef FLATSTYLE_H 21#ifndef FLATSTYLE_H
22#define FLATSTYLE_H 22#define FLATSTYLE_H
23 23
24#include <qcolor.h>
24#include <qwindowsstyle.h> 25#include <qwindowsstyle.h>
25#include <qpe/styleinterface.h> 26#include <qpe/styleinterface.h>
26 27
27class FlatStylePrivate; 28class FlatStylePrivate;
28 29
29class Q_EXPORT FlatStyle : public QWindowsStyle 30class FlatStyle : public QWindowsStyle
30{ 31{
31public: 32public:
32 FlatStyle(); 33 FlatStyle();
33 virtual ~FlatStyle(); 34 virtual ~FlatStyle();
34 virtual void polish( QPalette &p ); 35 virtual void polish( QPalette &p );
35 virtual void polish( QWidget *w ); 36 virtual void polish( QWidget *w );
36 virtual void unPolish( QWidget *w ); 37 virtual void unPolish( QWidget *w );
37 38
38 int defaultFrameWidth () const; 39 int defaultFrameWidth () const;
39 void drawItem( QPainter *p, int x, int y, int w, int h, 40 void drawItem( QPainter *p, int x, int y, int w, int h,
40 int flags, const QColorGroup &g, bool enabled, 41 int flags, const QColorGroup &g, bool enabled,
41 const QPixmap *pixmap, const QString& text, int len, const QColor* penColor ); 42 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 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 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 void drawButton( QPainter *p, int x, int y, int w, int h,
45 const QColorGroup &g, bool sunken, const QBrush* fill ); 46 const QColorGroup &g, bool sunken, const QBrush* fill );
46 void drawButtonMask ( QPainter * p, int x, int y, int w, int h ); 47 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 void drawBevelButton( QPainter *p, int x, int y, int w, int h,
48 const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 ); 49 const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 );
49 void drawToolButton( QPainter *p, int x, int y, int w, int h, 50 void drawToolButton( QPainter *p, int x, int y, int w, int h,
50 const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 ); 51 const QColorGroup &g, bool sunken=FALSE, const QBrush* fill=0 );
51 void drawPushButton( QPushButton *btn, QPainter *p ); 52 void drawPushButton( QPushButton *btn, QPainter *p );
52 void drawPushButtonLabel( QPushButton *btn, QPainter *p ); 53 void drawPushButtonLabel( QPushButton *btn, QPainter *p );
53 QRect comboButtonRect( int x, int y, int w, int h); 54 QRect comboButtonRect( int x, int y, int w, int h);
54 QRect comboButtonFocusRect( int x, int y, int w, int h); 55 QRect comboButtonFocusRect( int x, int y, int w, int h);
55 void drawComboButton( QPainter *p, int x, int y, int w, int h, 56 void drawComboButton( QPainter *p, int x, int y, int w, int h,
56 const QColorGroup &g, bool sunken, bool, bool enabled, 57 const QColorGroup &g, bool sunken, bool, bool enabled,
57 const QBrush *fill ); 58 const QBrush *fill );
58 void drawExclusiveIndicator ( QPainter * p, int x, int y, int w, int h, 59 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 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 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 const QColorGroup & g, int state, bool down = FALSE, bool enabled = TRUE );
62 void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int&); 63 void scrollBarMetrics( const QScrollBar*, int&, int&, int&, int&);
63 void drawScrollBarControls( QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl ); 64 void drawScrollBarControls( QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl );
64 ScrollControl scrollBarPointOver( const QScrollBar* sb, int sliderStart, const QPoint& p ); 65 ScrollControl scrollBarPointOver( const QScrollBar* sb, int sliderStart, const QPoint& p );
65 void drawRiffles( QPainter* p, int x, int y, int w, int h, 66 void drawRiffles( QPainter* p, int x, int y, int w, int h,
66 const QColorGroup &g, bool horizontal ); 67 const QColorGroup &g, bool horizontal );
67 int sliderLength() const; 68 int sliderLength() const;
68 void drawSlider( QPainter *p, int x, int y, int w, int h, 69 void drawSlider( QPainter *p, int x, int y, int w, int h,
69 const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow ); 70 const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow );
70 void drawSliderMask( QPainter *p, int x, int y, int w, int h, 71 void drawSliderMask( QPainter *p, int x, int y, int w, int h,
71 Orientation, bool tickAbove, bool tickBelow ); 72 Orientation, bool tickAbove, bool tickBelow );
72 void drawSliderGrooveMask( QPainter *p, int x, int y, int w, int h, 73 void drawSliderGrooveMask( QPainter *p, int x, int y, int w, int h,
73 const QColorGroup& , QCOORD c, Orientation orient ); 74 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 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 void drawTab( QPainter *, const QTabBar *, QTab *, bool selected );
77 void polishPopupMenu ( QPopupMenu * );
76 int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& ); 78 int extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem*, const QFontMetrics& );
77 int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& ); 79 int popupMenuItemHeight( bool checkable, QMenuItem*, const QFontMetrics& );
78 void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, 80 void drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi,
79 const QPalette& pal, 81 const QPalette& pal,
80 bool act, bool enabled, int x, int y, int w, int h); 82 bool act, bool enabled, int x, int y, int w, int h);
81 83
82 int buttonMargin() const; 84 int buttonMargin() const;
83 QSize scrollBarExtent() const; 85 QSize scrollBarExtent() const;
84 void getButtonShift( int &x, int &y ); 86 void getButtonShift( int &x, int &y );
85 87
86private: 88private:
87 FlatStylePrivate *d; 89 FlatStylePrivate *d;
88 bool revItem; 90 bool revItem;
91 bool fillBtnBorder;
92 QColor btnBg;
89 // Disabled copy constructor and operator= 93 // Disabled copy constructor and operator=
90#if defined(Q_DISABLE_COPY) 94#if defined(Q_DISABLE_COPY)
91 FlatStyle( const FlatStyle & ); 95 FlatStyle( const FlatStyle & );
92 FlatStyle& operator=( const FlatStyle & ); 96 FlatStyle& operator=( const FlatStyle & );
93#endif 97#endif
94}; 98};
95 99
96 100
97class FlatStyleImpl : public StyleInterface 101class FlatStyleImpl : public StyleInterface
98{ 102{
99public: 103public:
100 FlatStyleImpl(); 104 FlatStyleImpl();
101 virtual ~FlatStyleImpl(); 105 virtual ~FlatStyleImpl();
102 106
103 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 107 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
104 Q_REFCOUNT 108 Q_REFCOUNT
105 109
106 virtual QStyle *style(); 110 virtual QStyle *style();
107 virtual QString name() const; 111 virtual QString name() const;
108 112
109private: 113private:
110 FlatStyle *flat; 114 FlatStyle *flat;
111 ulong ref; 115 ulong ref;
112}; 116};
113 117
114#endif // FLATSTYLE_H 118#endif // FLATSTYLE_H