.TH "KStyle" 3 "28 Jan 2004" "kdefx Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KStyle \- Simplifies and extends the \fBQStyle\fP API to make style coding easier.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kstyle.h>\fP
.PP
Inherits \fBQCommonStyle\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef uint \fBKStyleFlags\fP"
.br
.RI "\fIKStyle Flags:. \fP"
.ti -1c
.RI "enum \fBKStyleOption\fP { \fBDefault\fP =  0x00000000, \fBAllowMenuTransparency\fP =  0x00000001, \fBFilledFrameWorkaround\fP =  0x00000002 }"
.br
.ti -1c
.RI "enum \fBKStyleScrollBarType\fP { \fBWindowsStyleScrollBar\fP =  0x00000000, \fBPlatinumStyleScrollBar\fP =  0x00000001, \fBThreeButtonScrollBar\fP =  0x00000002, \fBNextStyleScrollBar\fP =  0x00000004 }"
.br
.RI "\fIKStyle ScrollBarType:. \fP"
.ti -1c
.RI "enum \fBKStylePrimitive\fP { \fBKPE_DockWindowHandle\fP, \fBKPE_ToolBarHandle\fP, \fBKPE_GeneralHandle\fP, \fBKPE_SliderGroove\fP, \fBKPE_SliderHandle\fP, \fBKPE_ListViewExpander\fP, \fBKPE_ListViewBranch\fP }"
.br
.RI "\fIKStyle Primitive Elements:. \fP"
.ti -1c
.RI "enum \fBKStylePixelMetric\fP { \fBKPM_MenuItemSeparatorHeight\fP =  0x00000001, \fBKPM_MenuItemHMargin\fP =  0x00000002, \fBKPM_MenuItemVMargin\fP =  0x00000004, \fBKPM_MenuItemHFrame\fP =  0x00000008, \fBKPM_MenuItemVFrame\fP =  0x00000010, \fBKPM_MenuItemCheckMarkHMargin\fP =  0x00000020, \fBKPM_MenuItemArrowHMargin\fP =  0x00000040, \fBKPM_MenuItemTabSpacing\fP =  0x00000080, \fBKPM_ListViewBranchThickness\fP =  0x00000100 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKStyle\fP (\fBKStyleFlags\fP flags=KStyle::Default, \fBKStyleScrollBarType\fP sbtype=KStyle::WindowsStyleScrollBar)"
.br
.RI "\fIConstructs a KStyle object. \fP"
.ti -1c
.RI "\fB~KStyle\fP ()"
.br
.RI "\fIDestructs the KStyle object. \fP"
.ti -1c
.RI "void \fBsetScrollBarType\fP (\fBKStyleScrollBarType\fP sbtype)"
.br
.RI "\fIModifies the scrollbar type used by the style. \fP"
.ti -1c
.RI "\fBKStyleFlags\fP \fBstyleFlags\fP () const "
.br
.RI "\fIReturns the KStyle flags used to initialise the style. \fP"
.ti -1c
.RI "virtual void \fBrenderMenuBlendPixmap\fP (\fBKPixmap\fP &pix, const  \fBQColorGroup\fP &cg, const  \fBQPopupMenu\fP *popup) const "
.br
.RI "\fIThis virtual function defines the pixmap used to blend between the popup menu and the background to create different menu transparency effects. \fP"
.ti -1c
.RI "virtual void \fBdrawKStylePrimitive\fP (\fBKStylePrimitive\fP kpe, \fBQPainter\fP *p, const  \fBQWidget\fP *widget, const  \fBQRect\fP &r, const  \fBQColorGroup\fP &cg, SFlags flags=Style_Default, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.RI "\fIThis function is identical to Qt's \fBQStyle::drawPrimitive()\fP, except that it adds one further parameter, 'widget', that can be used to determine the widget state of the KStylePrimitive in question. \fP"
.ti -1c
.RI "int \fBkPixelMetric\fP (KStylePixelMetric kpm, const  \fBQWidget\fP *widget=0) const "
.br
.ti -1c
.RI "void \fBpolish\fP (\fBQWidget\fP *widget)"
.br
.ti -1c
.RI "void \fBunPolish\fP (\fBQWidget\fP *widget)"
.br
.ti -1c
.RI "void \fBpolishPopupMenu\fP (\fBQPopupMenu\fP *)"
.br
.ti -1c
.RI "void \fBdrawPrimitive\fP (PrimitiveElement pe, \fBQPainter\fP *p, const  \fBQRect\fP &r, const  \fBQColorGroup\fP &cg, SFlags flags=Style_Default, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.ti -1c
.RI "void \fBdrawControl\fP (ControlElement element, \fBQPainter\fP *p, const  \fBQWidget\fP *widget, const  \fBQRect\fP &r, const  \fBQColorGroup\fP &cg, SFlags flags=Style_Default, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.ti -1c
.RI "void \fBdrawComplexControl\fP (ComplexControl control, \fBQPainter\fP *p, const  \fBQWidget\fP *widget, const  \fBQRect\fP &r, const  \fBQColorGroup\fP &cg, SFlags flags=Style_Default, SCFlags controls=SC_All, SCFlags active=SC_None, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.ti -1c
.RI "SubControl \fBquerySubControl\fP (ComplexControl control, const  \fBQWidget\fP *widget, const  \fBQPoint\fP &pos, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.ti -1c
.RI "\fBQRect\fP \fBquerySubControlMetrics\fP (ComplexControl control, const  \fBQWidget\fP *widget, SubControl sc, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.ti -1c
.RI "int \fBpixelMetric\fP (PixelMetric m, const  \fBQWidget\fP *widget=0) const "
.br
.ti -1c
.RI "\fBQRect\fP \fBsubRect\fP (SubRect r, const  \fBQWidget\fP *widget) const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBstylePixmap\fP (StylePixmap stylepixmap, const  \fBQWidget\fP *widget=0, const  \fBQStyleOption\fP &=QStyleOption::Default) const "
.br
.ti -1c
.RI "int \fBstyleHint\fP (StyleHint sh, const  \fBQWidget\fP *w=0, const  \fBQStyleOption\fP &opt=QStyleOption::Default, QStyleHintReturn *shr=0) const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQString\fP \fBdefaultStyle\fP ()"
.br
.RI "\fIReturns the default widget style depending on color depth. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "bool \fBeventFilter\fP (\fBQObject\fP *object, \fBQEvent\fP *event)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Simplifies and extends the \fBQStyle\fP API to make style coding easier. 

The KStyle class provides a simple internal menu transparency engine which attempts to use XRender for accelerated blending where requested, or falls back to fast internal software tinting/blending routines. It also simplifies more complex portions of the \fBQStyle\fP API, such as the PopupMenuItems, ScrollBars and Sliders by providing extra 'primitive elements' which are simple to implement by the style writer.
.PP
\fBAuthor:\fP
.RS 4
Karol Szwed (gallium@kde.org) 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQStyle::QStyle\fP 
.PP
\fBQCommonStyle::QCommonStyle\fP 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkstyle.h\fP,v 1.11 2002/10/26 08:59:39 gallium Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 56 of file kstyle.h.
.SH "Member Typedef Documentation"
.PP 
.SS "typedef uint \fBKStyle::KStyleFlags\fP"
.PP
KStyle Flags:. .IP "\(bu" 2
Default - Default style setting, where menu transparency and the FilledFrameWorkaround are disabled.
.PP
.IP "\(bu" 2
AllowMenuTransparency - Enable this flag to use KStyle's internal menu transparency engine.
.PP
.IP "\(bu" 2
FilledFrameWorkaround - Enable this flag to facilitate proper repaints of QMenuBars and QToolBars when the style chooses to paint the interior of a \fBQFrame\fP. The style primitives in question are PE_PanelMenuBar and PE_PanelDockWindow. The HighColor style uses this workaround to enable painting of gradients in menubars and toolbars.
.PP
Definition at line 78 of file kstyle.h.
.PP
Referenced by KStyle(), and styleFlags().
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKStyle::KStyleScrollBarType\fP"
.PP
KStyle ScrollBarType:. Allows the style writer to easily select what type of scrollbar should be used without having to duplicate large amounts of source code by implementing the complex control CC_ScrollBar.
.PP
.IP "\(bu" 2
WindowsStyleScrollBar - Two button scrollbar with the previous button at the top/left, and the next button at the bottom/right.
.PP
.IP "\(bu" 2
PlatinumStyleSrollBar - Two button scrollbar with both the previous and next buttons at the bottom/right.
.PP
.IP "\(bu" 2
ThreeButtonScrollBar - \fBKDE\fP style three button scrollbar with two previous buttons, and one next button. The next button is always at the bottom/right, whilst the two previous buttons are on either end of the scrollbar.
.PP
.IP "\(bu" 2
NextStyleScrollBar - Similar to the PlatinumStyle scroll bar, but with the buttons grouped on the opposite end of the scrollbar.
.PP
Definition at line 106 of file kstyle.h.
.SS "enum \fBKStyle::KStylePrimitive\fP"
.PP
KStyle Primitive Elements:. The KStyle class extends the Qt's Style API by providing certain simplifications for parts of \fBQStyle\fP. To do this, the KStylePrimitive elements were defined, which are very similar to Qt's PrimitiveElement.
.PP
The first three Handle primitives simplify and extend PE_DockWindowHandle, so do not reimplement PE_DockWindowHandle if you want the KStyle handle simplifications to be operable. Similarly do not reimplement CC_Slider, SC_SliderGroove and SC_SliderHandle when using the KStyle slider primitives. KStyle automatically double-buffers slider painting when they are drawn via these KStyle primitives to avoid flicker.
.PP
.IP "\(bu" 2
KPE_DockWindowHandle - This primitive is already implemented in KStyle, and paints a bevelled rect with the DockWindow caption text. Re-implement this primitive to perform other more fancy effects when drawing the dock window handle.
.PP
.IP "\(bu" 2
KPE_ToolBarHandle - This primitive must be reimplemented. It currently only paints a filled rectangle as default behaviour. This primitive is used to render \fBQToolBar\fP handles.
.PP
.IP "\(bu" 2
KPE_GeneralHandle - This primitive must be reimplemented. It is used to render general handles that are not part of a \fBQToolBar\fP or \fBQDockWindow\fP, such as the applet handles used in Kicker. The default implementation paints a filled rect of arbitrary color.
.PP
.IP "\(bu" 2
KPE_SliderGroove - This primitive must be reimplemented. It is used to paint the slider groove. The default implementation paints a filled rect of arbitrary color.
.PP
.IP "\(bu" 2
KPE_SliderHandle - This primitive must be reimplemented. It is used to paint the slider handle. The default implementation paints a filled rect of arbitrary color.
.PP
.IP "\(bu" 2
KPE_ListViewExpander - This primitive is already implemented in KStyle. It is used to draw the Expand/Collapse element in QListViews. To indicate the expanded state, the style flags are set to Style_Off, while Style_On implies collapsed.
.PP
.IP "\(bu" 2
KPE_ListViewBranch - This primitive is already implemented in KStyle. It is used to draw the ListView branches where necessary.
.PP
Definition at line 220 of file kstyle.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KStyle::KStyle (\fBKStyleFlags\fP flags = KStyle::Default, \fBKStyleScrollBarType\fP sbtype = KStyle::WindowsStyleScrollBar)"
.PP
Constructs a KStyle object. Select the appropriate KStyle flags and scrollbar type for your style. The user's style preferences selected in KControl are read by using \fBQSettings\fP and are automatically applied to the style. As a fallback, KStyle paints progressbars and tabbars. It inherits from \fBQCommonStyle\fP for speed, so don't expect much to be implemented.
.PP
It is advisable to use a currently implemented style such as the HighColor style as a foundation for any new KStyle, so the limited number of drawing fallbacks should not prove problematic.
.PP
\fBSee also:\fP
.RS 4
\fBKStyle::KStyleFlags\fP 
.PP
\fBKStyle::KStyleScrollBarType\fP 
.RE
.PP
\fBAuthor:\fP
.RS 4
Karol Szwed (gallium@kde.org)
.RE
.PP
Definition at line 162 of file kstyle.cpp.
.PP
References QPixmap::defaultDepth(), KStyleFlags, QSettings::readBoolEntry(), QSettings::readDoubleEntry(), QSettings::readEntry(), and QSettings::readNumEntry().
.SS "KStyle::~\fBKStyle\fP ()"
.PP
Destructs the KStyle object. Definition at line 211 of file kstyle.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KStyle::defaultStyle ()\fC [static]\fP"
.PP
Returns the default widget style depending on color depth. Definition at line 221 of file kstyle.cpp.
.PP
References QPixmap::defaultDepth().
.SS "void KStyle::setScrollBarType (\fBKStyleScrollBarType\fP sbtype)"
.PP
Modifies the scrollbar type used by the style. This function is only provided for convenience. It allows you to make a late decision about what scrollbar type to use for the style after performing some processing in your style's constructor. In most situations however, setting the scrollbar type via the KStyle constructor should suffice.Definition at line 271 of file kstyle.cpp.
.SS "\fBKStyle::KStyleFlags\fP KStyle::styleFlags () const"
.PP
Returns the KStyle flags used to initialise the style. This is used solely for the kcmstyle module, and hence is internal.Definition at line 276 of file kstyle.cpp.
.PP
References KStyleFlags.
.SS "void KStyle::renderMenuBlendPixmap (\fBKPixmap\fP & pix, const \fBQColorGroup\fP & cg, const \fBQPopupMenu\fP * popup) const\fC [virtual]\fP"
.PP
This virtual function defines the pixmap used to blend between the popup menu and the background to create different menu transparency effects. For example, you can fill the pixmap 'pix' with a gradient based on the popup's colorGroup, a texture, or some other fancy painting routine. KStyle will then internally blend this pixmap with a snapshot of the background behind the popupMenu to create the illusion of transparency.
.PP
This virtual is never called if XRender/Software blending is disabled by the user in KDE's style control module.Definition at line 281 of file kstyle.cpp.
.PP
References QColorGroup::button(), and QPixmap::fill().
.SS "void KStyle::drawKStylePrimitive (\fBKStylePrimitive\fP kpe, \fBQPainter\fP * p, const \fBQWidget\fP * widget, const \fBQRect\fP & r, const \fBQColorGroup\fP & cg, SFlags flags = Style_Default, const \fBQStyleOption\fP & = QStyleOption::Default) const\fC [virtual]\fP"
.PP
This function is identical to Qt's \fBQStyle::drawPrimitive()\fP, except that it adds one further parameter, 'widget', that can be used to determine the widget state of the KStylePrimitive in question. \fBSee also:\fP
.RS 4
\fBKStyle::KStylePrimitive\fP 
.PP
\fBQStyle::drawPrimitive\fP 
.PP
\fBQStyle::drawComplexControl\fP
.RE
.PP
Definition at line 288 of file kstyle.cpp.
.PP
References QPainter::begin(), QColorGroup::brush(), QColorGroup::dark(), QPainter::drawLine(), QPainter::drawPixmap(), QPainter::drawPoints(), QPainter::drawRect(), QPainter::drawText(), KStdAccel::end(), QPainter::end(), QPainter::fillRect(), QApplication::flushX(), QApplication::font(), QRect::height(), QWidget::height(), QColorGroup::highlight(), QColorGroup::highlightedText(), QColorGroup::light(), QColorGroup::mid(), QWidget::parentWidget(), QFont::pointSize(), QPixmap::rect(), QRect::rect(), QPixmap::resize(), QWMatrix::rotate(), QPainter::setFont(), QPainter::setPen(), QPointArray::setPoint(), QFont::setPointSize(), QColorGroup::text(), QRect::width(), QWidget::width(), QRect::x(), QPixmap::xForm(), and QRect::y().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdefx Library from the source code.
