.TH "KLed" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KLed \- Displays a round or rectangular light emitting diode. 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
.RI "\fIStatus of the light is on/off. LED on/off. \fP"
.ti -1c
.RI "enum \fBShape\fP { \fBRectangular\fP, \fBCircular\fP }"
.br
.RI "\fIShades of the lamp. LED shape. \fP"
.ti -1c
.RI "enum \fBLook\fP { \fBFlat\fP, \fBRaised\fP, \fBSunken\fP }"
.br
.RI "\fIDisplays a flat, round or sunken LED. LED look. \fP"
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBtoggle\fP ()"
.br
.RI "\fIToggles the state of the led from Off to On or vice versa. \fP"
.ti -1c
.RI "void \fBon\fP ()"
.br
.RI "\fISets the state of the widget to On. \fP"
.ti -1c
.RI "void \fBoff\fP ()"
.br
.RI "\fISets the state of the widget to Off. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKLed\fP (\fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructs a green, round LED widget which will initially be turned on. \fP"
.ti -1c
.RI "\fBKLed\fP (const  \fBQColor\fP &col=Qt::green, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructor with the ledcolor, the parent widget, and the name. Constructor. \fP"
.ti -1c
.RI "\fBKLed\fP (const  \fBQColor\fP &col, \fBKLed::State\fP st, \fBKLed::Look\fP look, \fBKLed::Shape\fP shape, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructor with the ledcolor, ledstate, ledlook, the parent widget, and the name. Constructor. \fP"
.ti -1c
.RI "\fB~KLed\fP ()"
.br
.RI "\fIDestructor Destructor. \fP"
.ti -1c
.RI "\fBState\fP \fBstate\fP () const "
.br
.RI "\fIReturns the current state of the widget (on/off). Returns LED state. \fP"
.ti -1c
.RI "\fBShape\fP \fBshape\fP () const "
.br
.ti -1c
.RI "\fBQColor\fP \fBcolor\fP () const "
.br
.RI "\fIReturns the color of the widget Returns LED color. \fP"
.ti -1c
.RI "\fBLook\fP \fBlook\fP () const "
.br
.RI "\fIReturns the look of the widget. Returns LED look. \fP"
.ti -1c
.RI "int \fBdarkFactor\fP () const "
.br
.RI "\fIReturns the factor to darken the LED. Returns dark factor. \fP"
.ti -1c
.RI "void \fBsetState\fP (\fBState\fP state)"
.br
.RI "\fISets the state of the widget to On or Off. Set LED state. \fP"
.ti -1c
.RI "void \fBsetShape\fP (\fBShape\fP s)"
.br
.RI "\fISet the shape of the LED to \fCs\fP. \fP"
.ti -1c
.RI "void \fBtoggleState\fP ()"
.br
.RI "\fIToggle the state of the LED from Off to On and vice versa. Toggles LED on->off / off->on. \fBThis class or method is obsolete, it is provided for compatibility only.\fP, use \fBtoggle()\fP instead. \fP"
.ti -1c
.RI "void \fBsetColor\fP (const  \fBQColor\fP &color)"
.br
.RI "\fISet the color of the widget. Sets the LED color. \fP"
.ti -1c
.RI "void \fBsetDarkFactor\fP (int darkfactor)"
.br
.RI "\fISets the factor to darken the LED in OFF state. sets the factor to darken the LED. \fP"
.ti -1c
.RI "void \fBsetLook\fP (\fBLook\fP look)"
.br
.RI "\fISets the look of the widget. Sets LED look. \fP"
.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
.RI "\fIPaints a circular, flat LED. \fP"
.ti -1c
.RI "virtual void \fBpaintRound\fP ()"
.br
.RI "\fIPaints a circular, raised LED. \fP"
.ti -1c
.RI "virtual void \fBpaintSunken\fP ()"
.br
.RI "\fIPaints a circular, sunken LED. \fP"
.ti -1c
.RI "virtual void \fBpaintRect\fP ()"
.br
.RI "\fIPaints a rectangular, flat LED. \fP"
.ti -1c
.RI "virtual void \fBpaintRectFrame\fP (bool raised)"
.br
.RI "\fIPaints a rectangular LED, either raised or sunken, depending on its argument. \fP"
.ti -1c
.RI "void \fBpaintEvent\fP (\fBQPaintEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Displays a round or rectangular light emitting diode. An LED widget. 

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
\fBAuthor:\fP
.RS 4
Joerg Habenicht, Richard J. Moore (rich@kde.org) 1998, 1999 
.RE
.PP

.PP
Definition at line 41 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. Definition at line 57 of file kled.h.
.SS "\fBenum\fP \fBKLed::Shape\fP"
.PP
Shades of the lamp. LED shape. Definition at line 63 of file kled.h.
.SS "\fBenum\fP \fBKLed::Look\fP"
.PP
Displays a flat, round or sunken LED. LED look. 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
\fB Timings: ( AMD K5/133, Diamond Stealth 64 PCI Graphics, widgetsize 29x29 ) 
.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.\fP
.PP
\fB\fP
.PP
\fB \fPDefinition at line 85 of file kled.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KLed::KLed (\fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructs a green, round LED widget which will initially be turned on. Definition at line 134 of file kled.cpp.
.PP
References QColor::dark(), KStdAccel::name(), and setColor().
.SS "KLed::KLed (const \fBQColor\fP & col = Qt::green, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructor with the ledcolor, the parent widget, and the name. Constructor. The State will be defaulted On and the Look round.
.PP
\fBParameters:\fP
.RS 4
\fIledcolor\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
Definition at line 149 of file kled.cpp.
.PP
References QColor::dark(), KStdAccel::name(), and setColor().
.SS "KLed::KLed (const \fBQColor\fP & col, \fBKLed::State\fP st, \fBKLed::Look\fP look, \fBKLed::Shape\fP shape, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructor with the ledcolor, ledstate, ledlook, the parent widget, and the name. Constructor. Differs from above only in the parameters, which configure all settings.
.PP
\fBParameters:\fP
.RS 4
\fIledcolor\fP Initial color of the LED. 
.br
\fIstate\fP Sets the State. 
.br
\fIlook\fP Sets the Look. 
.br
\fIparent\fP Will be handed over to \fBQWidget\fP. 
.br
\fIname\fP Will be handed over to \fBQWidget\fP. 
.RE
.PP
Definition at line 163 of file kled.cpp.
.PP
References QColor::dark(), KStdAccel::name(), and setColor().
.SS "KLed::~\fBKLed\fP ()"
.PP
Destructor Destructor. Definition at line 179 of file kled.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBKLed::State\fP KLed::state () const"
.PP
Returns the current state of the widget (on/off). Returns LED state. \fBSee also:\fP
.RS 4
\fBState\fP 
.RE
.PP
Definition at line 540 of file kled.cpp.
.SS "\fBQColor\fP KLed::color () const"
.PP
Returns the color of the widget Returns LED color. \fBSee also:\fP
.RS 4
Color 
.RE
.PP
Definition at line 552 of file kled.cpp.
.PP
Referenced by paintFlat(), paintRound(), and paintSunken().
.SS "\fBKLed::Look\fP KLed::look () const"
.PP
Returns the look of the widget. Returns LED look. \fBSee also:\fP
.RS 4
\fBLook\fP 
.RE
.PP
Definition at line 558 of file kled.cpp.
.SS "int KLed::darkFactor () const"
.PP
Returns the factor to darken the LED. Returns dark factor. \fBSee also:\fP
.RS 4
\fBsetDarkFactor()\fP 
.RE
.PP
Definition at line 612 of file kled.cpp.
.SS "void KLed::setState (\fBState\fP state)"
.PP
Sets the state of the widget to On or Off. Set LED state. 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
Definition at line 564 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. Definition at line 582 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. \fBThis class or method is obsolete, it is provided for compatibility only.\fP, use \fBtoggle()\fP instead. The widget will be repainted when returning to the main event loop. Definition at line 574 of file kled.cpp.
.PP
References QWidget::update().
.PP
Referenced by toggle().
.SS "void KLed::setColor (const \fBQColor\fP & color)"
.PP
Set the color of the widget. Sets the LED color. 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
Definition at line 592 of file kled.cpp.
.PP
References 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. 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
Definition at line 602 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. 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
Definition at line 618 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. The widget repaints itself immediately. Definition at line 628 of file kled.cpp.
.PP
References toggleState().
.SS "void KLed::on ()\fC [slot]\fP"
.PP
Sets the state of the widget to On. The widget will be painted immediately. 
.PP
\fBSee also:\fP
.RS 4
\fBoff()\fP \fBtoggle()\fP \fBtoggleState()\fP \fBsetState()\fP 
.RE
.PP
Definition at line 634 of file kled.cpp.
.PP
References setState().
.SS "void KLed::off ()\fC [slot]\fP"
.PP
Sets the state of the widget to Off. The widget will be painted immediately. 
.PP
\fBSee also:\fP
.RS 4
\fBon()\fP \fBtoggle()\fP \fBtoggleState()\fP \fBsetState()\fP 
.RE
.PP
Definition at line 640 of file kled.cpp.
.PP
References setState().
.SS "void KLed::paintFlat ()\fC [protected, virtual]\fP"
.PP
Paints a circular, flat LED. Definition at line 239 of file kled.cpp.
.PP
References QPainter::begin(), color(), QPainter::drawEllipse(), QPainter::end(), QWidget::height(), QPainter::setBrush(), QPen::setColor(), QBrush::setColor(), QPainter::setPen(), QColor::setRgb(), QBrush::setStyle(), QPen::setWidth(), and QWidget::width().
.SS "void KLed::paintRound ()\fC [protected, virtual]\fP"
.PP
Paints a circular, raised LED. Definition at line 285 of file kled.cpp.
.PP
References QPainter::begin(), color(), QPainter::drawEllipse(), QPainter::end(), QWidget::height(), QColor::light(), QWidget::pos(), QPainter::setBrush(), QPen::setColor(), QBrush::setColor(), QPainter::setPen(), QColor::setRgb(), QBrush::setStyle(), QPen::setWidth(), and QWidget::width().
.SS "void KLed::paintSunken ()\fC [protected, virtual]\fP"
.PP
Paints a circular, sunken LED. Definition at line 370 of file kled.cpp.
.PP
References QPainter::begin(), color(), QPainter::drawArc(), QPainter::drawEllipse(), QPainter::end(), QWidget::height(), QColor::light(), QWidget::pos(), QPainter::setBrush(), QPen::setColor(), QBrush::setColor(), QPainter::setPen(), QColor::setRgb(), QBrush::setStyle(), QPen::setWidth(), and QWidget::width().
.SS "void KLed::paintRect ()\fC [protected, virtual]\fP"
.PP
Paints a rectangular, flat LED. Definition at line 477 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. Definition at line 508 of file kled.cpp.
.PP
References QPainter::drawLine(), QPainter::drawRect(), QPainter::fillRect(), QWidget::height(), QPainter::setPen(), and QWidget::width().

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