1 //////////////////////////////////////////////////////////////////////////////
6 // Copyright (c) 2004 David Johnson <david@usermode.org>
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 //////////////////////////////////////////////////////////////////////////////
37 class PhaseStyle
: public KStyle
42 virtual ~PhaseStyle();
44 void polish(QApplication
* app
);
45 void polish(QWidget
*widget
);
46 void polish(QPalette
&pal
);
47 void unPolish(QWidget
*widget
);
49 void drawPrimitive(PrimitiveElement element
,
52 const QColorGroup
&group
,
53 SFlags flags
= Style_Default
,
54 const QStyleOption
&option
= QStyleOption::Default
) const;
56 void drawKStylePrimitive(KStylePrimitive element
,
58 const QWidget
*widget
,
60 const QColorGroup
&group
,
61 SFlags flags
= Style_Default
,
62 const QStyleOption
&option
= QStyleOption::Default
) const;
64 void drawControl(ControlElement element
,
66 const QWidget
*widget
,
68 const QColorGroup
&group
,
69 SFlags flags
= Style_Default
,
70 const QStyleOption
&option
= QStyleOption::Default
) const;
72 void drawControlMask(ControlElement element
,
74 const QWidget
*widget
,
76 const QStyleOption
&option
= QStyleOption::Default
) const;
78 void drawComplexControl(ComplexControl control
,
80 const QWidget
*widget
,
82 const QColorGroup
&group
,
83 SFlags flags
= Style_Default
,
84 SCFlags controls
= SC_All
,
85 SCFlags active
= SC_None
,
86 const QStyleOption
&option
= QStyleOption::Default
) const;
88 void drawComplexControlMask(ComplexControl control
,
90 const QWidget
*widget
,
92 const QStyleOption
&option
= QStyleOption::Default
) const;
94 int pixelMetric(PixelMetric metric
,
95 const QWidget
*widget
= 0) const;
97 QRect
querySubControlMetrics(ComplexControl control
,
98 const QWidget
*widget
,
99 SubControl subcontrol
,
100 const QStyleOption
&option
= QStyleOption::Default
) const;
102 QSize
sizeFromContents(ContentsType contents
,
103 const QWidget
*widget
,
104 const QSize
&contentsize
,
105 const QStyleOption
& option
= QStyleOption::Default
) const;
108 PhaseStyle(const PhaseStyle
&);
109 PhaseStyle
& operator=(const PhaseStyle
&);
111 void drawPhaseBevel(QPainter
*painter
,
112 int x
, int y
, int w
, int h
,
113 const QColorGroup
&group
,
116 bool horizontal
=true,
117 bool reverse
=false) const;
119 void drawPhaseButton(QPainter
*painter
,
120 int x
, int y
, int w
, int h
,
121 const QColorGroup
&group
,
123 bool sunken
=false) const;
125 void drawPhasePanel(QPainter
*painter
,
126 int x
, int y
, int w
, int h
,
127 const QColorGroup
&group
,
129 const QBrush
*fill
=NULL
) const;
131 void drawPhaseTab(QPainter
*painter
,
132 int x
, int y
, int w
, int h
,
133 const QColorGroup
&group
,
135 const QStyleOption
&option
,
136 const SFlags flags
) const;
138 void drawPhaseGradient(QPainter
*painter
,
143 int pw
=-1, int ph
=-1,
144 bool reverse
=false) const;
146 bool flatToolbar(const Q3ToolBar
*toolbar
) const;
148 bool eventFilter(QObject
*object
, QEvent
*event
);
170 GradientSet(const QColor
&color
, int size
);
173 KPixmap
* gradient(bool horizontal
, bool reverse
);
176 KPixmap
*set
[GradientTypeCount
];
181 #endif // PHASESTYLE_H