.TH "KLed" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KLed \- An LED widget.  

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

.in +1c
.ti -1c
.RI "enum \fBState\fP { \fBOff\fP, \fBOn\fP }"
.br
.ti -1c
.RI "enum \fBShape\fP { \fBRectangular\fP, \fBCircular\fP }"
.br
.ti -1c
.RI "enum \fBLook\fP { \fBFlat\fP, \fBRaised\fP, \fBSunken\fP }"
.br
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBtoggle\fP ()"
.br
.ti -1c
.RI "void \fBon\fP ()"
.br
.ti -1c
.RI "void \fBoff\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKLed\fP (\fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKLed\fP (const \fBQColor\fP &col, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKLed\fP (const \fBQColor\fP &col, \fBKLed::State\fP state, \fBKLed::Look\fP look, \fBKLed::Shape\fP shape, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fB~KLed\fP ()"
.br
.ti -1c
.RI "\fBState\fP \fBstate\fP () const "
.br
.ti -1c
.RI "\fBShape\fP \fBshape\fP () const "
.br
.ti -1c
.RI "\fBQColor\fP \fBcolor\fP () const "
.br
.ti -1c
.RI "\fBLook\fP \fBlook\fP () const "
.br
.ti -1c
.RI "int \fBdarkFactor\fP () const "
.br
.ti -1c
.RI "void \fBsetState\fP (\fBState\fP state)"
.br
.ti -1c
.RI "void \fBsetShape\fP (\fBShape\fP s)"
.br
.ti -1c
.RI "void \fBtoggleState\fP () KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBsetColor\fP (const \fBQColor\fP &color)"
.br
.ti -1c
.RI "void \fBsetDarkFactor\fP (int darkfactor)"
.br
.ti -1c
.RI "void \fBsetLook\fP (\fBLook\fP look)"
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBsizeHint\fP () const "
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBminimumSizeHint\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBpaintFlat\fP ()"
.br
.ti -1c
.RI "virtual void \fBpaintRound\fP ()"
.br
.ti -1c
.RI "virtual void \fBpaintSunken\fP ()"
.br
.ti -1c
.RI "virtual void \fBpaintRect\fP ()"
.br
.ti -1c
.RI "virtual void \fBpaintRectFrame\fP (bool raised)"
.br
.ti -1c
.RI "void \fBpaintEvent\fP (\fBQPaintEvent\fP *)"
.br
.ti -1c
.RI "int \fBensureRoundLed\fP ()"
.br
.ti -1c
.RI "bool \fBpaintCachedPixmap\fP ()"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "\fBState\fP \fBstate\fP"
.br
.ti -1c
.RI "\fBShape\fP \fBshape\fP"
.br
.ti -1c
.RI "\fBLook\fP \fBlook\fP"
.br
.ti -1c
.RI "\fBQColor\fP \fBcolor\fP"
.br
.ti -1c
.RI "int \fBdarkFactor\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
An LED widget. 

Displays a round or rectangular light emitting diode.
.PP
It is configurable to five colors, the two on/off states and three styles (or 'looks');
.PP
It may display itself in a performant flat view, a round view with light spot or a round view sunken in the screen.
.PP
KDE LED Widget 
.PP
\fBAuthor:\fP
.RS 4
Joerg Habenicht, Richard J. Moore (rich@kde.org) 1998, 1999 
.RE
.PP

.PP
Definition at line 45 of file kled.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "\fBenum\fP \fBKLed::State\fP"
.PP
Status of the light is on/off. LED on/off. 
.PP
Definition at line 61 of file kled.h.
.SS "\fBenum\fP \fBKLed::Shape\fP"
.PP
Shades of the lamp. LED shape. 
.PP
Definition at line 67 of file kled.h.
.SS "\fBenum\fP \fBKLed::Look\fP"
.PP
Displays a flat, round or sunken LED. LED look. 
.PP
Displaying the LED flat is less time and color consuming, but not so nice to see.
.PP
The sunken LED itself is (certainly) smaller than the round LED because of the 3 shading circles and is most time consuming. Makes sense for LED > 15x15 pixels.
.PP
\fBTimings:\fP 
.br
 ( AMD K5/133, Diamond Stealth 64 PCI Graphics, widgetsize 29x29 ) 
.PD 0

.IP "\(bu" 2
flat Approximately 0.7 msec per paint 
.IP "\(bu" 2
round Approximately 2.9 msec per paint 
.IP "\(bu" 2
sunken Approximately 3.3 msec per paint
.PP
The widget will be updated on the next repaining event.
.PP
Definition at line 89 of file kled.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KLed::KLed (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a green, round LED widget which will initially be turned on. 
.PP
Definition at line 50 of file kled.cpp.
.PP
References QColor::dark(), and setColor().
.SS "KLed::KLed (const \fBQColor\fP & col, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor with the ledcolor, the parent widget, and the name. Constructor. 
.PP
The State will be defaulted On and the Look round.
.PP
\fBParameters:\fP
.RS 4
\fIcol\fP Initial color of the LED. 
.br
\fIparent\fP Will be handed over to \fBQWidget\fP. 
.br
\fIname\fP Will be handed over to \fBQWidget\fP. 
.RE
.PP

.PP
Definition at line 67 of file kled.cpp.
.PP
References QColor::dark(), and setColor().
.SS "KLed::KLed (const \fBQColor\fP & col, \fBKLed::State\fP state, \fBKLed::Look\fP look, \fBKLed::Shape\fP shape, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor with the ledcolor, ledstate, ledlook, the parent widget, and the name. Constructor. 
.PP
Differs from above only in the parameters, which configure all settings.
.PP
\fBParameters:\fP
.RS 4
\fIcol\fP Initial color of the LED. 
.br
\fIstate\fP Sets the State. 
.br
\fIlook\fP Sets the Look. 
.br
\fIshape\fP Sets the Shape (rectangular or circular) 
.br
\fIparent\fP Will be handed over to \fBQWidget\fP. 
.br
\fIname\fP Will be handed over to \fBQWidget\fP. 
.RE
.PP

.PP
Definition at line 83 of file kled.cpp.
.PP
References QColor::dark(), and setColor().
.SS "KLed::~\fBKLed\fP ()"
.PP
Destructor Destructor. 
.PP
Definition at line 101 of file kled.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBState\fP KLed::state () const"
.PP
Returns the current state of the widget (on/off). Returns LED state. 
.PP
\fBSee also:\fP
.RS 4
\fBState\fP 
.RE
.PP

.SS "\fBQColor\fP KLed::color () const"
.PP
Returns the color of the widget Returns LED color. 
.PP
\fBSee also:\fP
.RS 4
Color 
.RE
.PP

.SS "\fBLook\fP KLed::look () const"
.PP
Returns the look of the widget. Returns LED look. 
.PP
\fBSee also:\fP
.RS 4
\fBLook\fP 
.RE
.PP

.SS "int KLed::darkFactor () const"
.PP
Returns the factor to darken the LED. Returns dark factor. 
.PP
\fBSee also:\fP
.RS 4
\fBsetDarkFactor()\fP 
.RE
.PP

.SS "void KLed::setState (\fBState\fP state)"
.PP
Sets the state of the widget to On or Off. Set LED state. 
.PP
The widget will be painted immediately. 
.PP
\fBSee also:\fP
.RS 4
\fBon()\fP \fBoff()\fP \fBtoggle()\fP \fBtoggleState()\fP
.RE
.PP
\fBParameters:\fP
.RS 4
\fIstate\fP The LED state: on or off. 
.RE
.PP

.PP
Definition at line 546 of file kled.cpp.
.PP
References QWidget::update().
.PP
Referenced by off(), and on().
.SS "void KLed::setShape (\fBShape\fP s)"
.PP
Set the shape of the LED to \fCs\fP. 
.PP
Definition at line 562 of file kled.cpp.
.PP
References QWidget::update().
.SS "void KLed::toggleState ()"
.PP
Toggle the state of the LED from Off to On and vice versa. Toggles LED on->off / off->on. 
.PP
The widget will be repainted when returning to the main event loop. 
.PP
\fBDeprecated\fP
.RS 4
, use \fBtoggle()\fP instead. 
.RE
.PP

.PP
Definition at line 556 of file kled.cpp.
.PP
References toggle().
.SS "void KLed::setColor (const \fBQColor\fP & color)"
.PP
Set the color of the widget. Sets the LED color. 
.PP
The Color is shown with the KLed::On state. The KLed::Off state is shown with \fBQColor.dark()\fP method
.PP
The widget calls the \fBupdate()\fP method, so it will be updated when entering the main event loop.
.PP
\fBSee also:\fP
.RS 4
Color
.RE
.PP
\fBParameters:\fP
.RS 4
\fIcolor\fP New color of the LED. 
.RE
.PP

.PP
Definition at line 572 of file kled.cpp.
.PP
References QColor::dark(), and QWidget::update().
.PP
Referenced by KLed().
.SS "void KLed::setDarkFactor (int darkfactor)"
.PP
Sets the factor to darken the LED in OFF state. sets the factor to darken the LED. 
.PP
Same as \fBQColor::dark()\fP. 'darkfactor should be greater than 100, else the LED gets lighter in OFF state. Defaults to 300.
.PP
\fBSee also:\fP
.RS 4
\fBQColor\fP
.RE
.PP
\fBParameters:\fP
.RS 4
\fIdarkfactor\fP sets the factor to darken the LED. 
.RE
.PP

.PP
Definition at line 584 of file kled.cpp.
.PP
References QColor::dark(), and QWidget::update().
.SS "void KLed::setLook (\fBLook\fP look)"
.PP
Sets the look of the widget. Sets LED look. 
.PP
The look may be flat, round or sunken. The widget calls the \fBupdate()\fP method, so it will be updated when entering the main event loop.
.PP
\fBSee also:\fP
.RS 4
\fBLook\fP
.RE
.PP
\fBParameters:\fP
.RS 4
\fIlook\fP New look of the LED. 
.RE
.PP

.PP
Definition at line 600 of file kled.cpp.
.PP
References QWidget::update().
.SS "void KLed::toggle ()\fC [slot]\fP"
.PP
Toggles the state of the led from Off to On or vice versa. 
.PP
The widget repaints itself immediately. 
.PP
Definition at line 610 of file kled.cpp.
.PP
References QWidget::update().
.PP
Referenced by toggleState().
.SS "void KLed::on ()\fC [slot]\fP"
.PP
Sets the state of the widget to On. 
.PP
The widget will be painted immediately. 
.PP
\fBSee also:\fP
.RS 4
\fBoff()\fP \fBtoggle()\fP \fBtoggleState()\fP \fBsetState()\fP 
.RE
.PP

.PP
Definition at line 618 of file kled.cpp.
.PP
References setState().
.SS "void KLed::off ()\fC [slot]\fP"
.PP
Sets the state of the widget to Off. 
.PP
The widget will be painted immediately. 
.PP
\fBSee also:\fP
.RS 4
\fBon()\fP \fBtoggle()\fP \fBtoggleState()\fP \fBsetState()\fP 
.RE
.PP

.PP
Definition at line 624 of file kled.cpp.
.PP
References setState().
.SS "void KLed::paintFlat ()\fC [protected, virtual]\fP"
.PP
Paints a circular, flat LED. 
.PP
Definition at line 199 of file kled.cpp.
.PP
References QPainter::begin(), QWidget::colorGroup(), QPixmap::convertToImage(), QColor::dark(), QPainter::drawEllipse(), QPainter::drawPixmap(), QPainter::end(), ensureRoundLed(), QPixmap::fill(), paintCachedPixmap(), QWidget::paletteBackgroundColor(), QPainter::setBrush(), QPen::setColor(), QBrush::setColor(), QPainter::setPen(), QBrush::setStyle(), QPen::setWidth(), and QImage::smoothScale().
.SS "void KLed::paintRound ()\fC [protected, virtual]\fP"
.PP
Paints a circular, raised LED. 
.PP
Definition at line 257 of file kled.cpp.
.PP
References QPainter::begin(), QWidget::colorGroup(), QPixmap::convertToImage(), QColor::dark(), QPainter::drawEllipse(), QPainter::drawPixmap(), QPainter::end(), ensureRoundLed(), QPixmap::fill(), QColor::light(), paintCachedPixmap(), QWidget::paletteBackgroundColor(), QPainter::setBrush(), QPen::setColor(), QBrush::setColor(), QPainter::setPen(), QBrush::setStyle(), QPen::setWidth(), and QImage::smoothScale().
.SS "void KLed::paintSunken ()\fC [protected, virtual]\fP"
.PP
Paints a circular, sunken LED. 
.PP
Definition at line 352 of file kled.cpp.
.PP
References QPainter::begin(), QWidget::colorGroup(), QPixmap::convertToImage(), QColor::dark(), QPainter::drawArc(), QPainter::drawEllipse(), QPainter::drawPixmap(), QPainter::end(), ensureRoundLed(), QPixmap::fill(), QColor::light(), paintCachedPixmap(), QWidget::paletteBackgroundColor(), QPainter::setBrush(), QPen::setColor(), QBrush::setColor(), QPainter::setPen(), QBrush::setStyle(), QPen::setWidth(), QImage::smoothScale(), and QPen::width().
.SS "void KLed::paintRect ()\fC [protected, virtual]\fP"
.PP
Paints a rectangular, flat LED. 
.PP
Definition at line 459 of file kled.cpp.
.PP
References QColor::dark(), QPainter::drawLine(), QPainter::drawRect(), QWidget::height(), QPainter::setBrush(), QPainter::setPen(), and QWidget::width().
.SS "void KLed::paintRectFrame (bool raised)\fC [protected, virtual]\fP"
.PP
Paints a rectangular LED, either raised or sunken, depending on its argument. 
.PP
Definition at line 490 of file kled.cpp.
.PP
References QPainter::drawLine(), QPainter::drawRect(), QPainter::fillRect(), QWidget::height(), QPainter::setPen(), and QWidget::width().
.SS "int KLed::ensureRoundLed ()\fC [protected]\fP"
.PP
Compute LED width. 
.PP
Definition at line 163 of file kled.cpp.
.PP
References QWidget::height(), and QWidget::width().
.PP
Referenced by paintFlat(), paintRound(), and paintSunken().
.SS "bool KLed::paintCachedPixmap ()\fC [protected]\fP"
.PP
Paint the cached antialiased pixmap corresponding to the state if any. 
.PP
\fBReturns:\fP
.RS 4
true if the pixmap was painted, false if it hasn't been created yet 
.RE
.PP

.PP
Definition at line 179 of file kled.cpp.
.PP
References QPainter::drawPixmap().
.PP
Referenced by paintFlat(), paintRound(), and paintSunken().

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