4 * Copyright 2001, Chris Lee <lee@azsites.com>
5 * Originally copied from the KDE3 HighColor style, modified to fit mine.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License version 2 as published by the Free Software Foundation.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
28 #include <Q3ValueList>
30 #include <Q3PopupMenu>
32 #define u_arrow -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2
33 #define d_arrow -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1
34 #define l_arrow 0,-3, 0,3,-1,-2,-1,2,-2,-1,-2,1,-3,0
35 #define r_arrow -2,-3,-2,3,-1,-2, -1,2,0,-1,0,1,1,0
37 #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
39 class dotNETstyle
: public KStyle
45 virtual ~dotNETstyle();
47 bool inheritsKHTML( const QWidget
* widget
) const;
48 void polish( QWidget
* widget
);
49 void unPolish( QWidget
* widget
);
51 void renderMenuBlendPixmap( QPixmap
&, const QColorGroup
&, const Q3PopupMenu
* ) const;
53 void drawKStylePrimitive(WidgetType widgetType
, int primitive
,
54 const QStyleOption
* opt
,const QRect
&r
, const QPalette
&pal
, State flags
,QPainter
* p
,const QWidget
* widget
= 0, Option
* kOpt
= 0) const;
56 void drawPrimitive( PrimitiveElement element
, const QStyleOption
* option
, QPainter
* painter
, const QWidget
* widget
= 0 ) const;
58 void drawControl( ControlElement element
,
60 const QWidget
*widget
,
62 const QColorGroup
&cg
,
63 SFlags flags
= Style_Default
,
64 const QStyleOption
& = QStyleOption::Default
) const;
66 void drawControlMask( ControlElement
, QPainter
*, const QWidget
*, const QRect
&, const QStyleOption
&) const;
68 void drawComplexControl( ComplexControl control
,
70 const QWidget
*widget
,
72 const QColorGroup
&cg
,
73 SFlags flags
= Style_Default
,
74 SCFlags controls
= SC_All
,
75 SCFlags active
= SC_None
,
76 const QStyleOption
& = QStyleOption::Default
) const;
78 int pixelMetric( PixelMetric m
,
79 const QWidget
*widget
= 0 ) const;
81 QRect
subRect( SubRect r
,
82 const QWidget
*widget
) const;
84 QRect
querySubControlMetrics( ComplexControl control
,
85 const QWidget
*widget
,
86 SubControl subcontrol
,
87 const QStyleOption
&opt
= QStyleOption::Default
) const;
89 void drawComplexControlMask(QStyle::ComplexControl c
,
93 const QStyleOption
&o
=QStyleOption::Default
) const;
95 QSize
sizeFromContents(QStyle::ContentsType t
,
98 const QStyleOption
&o
) const;
101 void renderButton(QPainter
*p
,
103 const QColorGroup
&g
,
105 bool corners
= false) const;
107 void renderPanel(QPainter
*p
,
109 const QColorGroup
&g
,
111 bool thick
= true) const;
113 void renderSlider(QPainter
*p
,
115 const QColorGroup
&g
) const;
116 bool eventFilter(QObject
*, QEvent
*);
118 void updatePalette( QComboBox
* );
119 void updatePalette( Q3ToolBar
* );
120 void updatePalette( QMenuBar
* );
123 void slotDestroyed();
124 void paletteChanged();
127 // Disable copy constructor and = operator
128 dotNETstyle( const dotNETstyle
& );
129 dotNETstyle
& operator=( const dotNETstyle
& );
132 bool pseudo3D
, useTextShadows
, roundedCorners
, reverseLayout
, kickerMode
;
134 Q3ValueList
<QWidget
*> m_widgets
;
139 // vim: set noet ts=4 sw=4: