• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
kled.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1998 Jörg Habenicht (j.habenicht@europemail.com)
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 /*************************************************************************
20  * $Id$
21  *************************************************************************/
22 
23 #ifndef _KLED_H_
24 #define _KLED_H_
25 
26 #include <tqwidget.h>
27 #include <kdelibs_export.h>
28 
29 class TQColor;
45 class KDEUI_EXPORT KLed : public TQWidget
46 {
47  Q_OBJECT
48  Q_ENUMS( State Shape Look )
49  Q_PROPERTY( State state READ state WRITE setState )
50  Q_PROPERTY( Shape shape READ shape WRITE setShape )
51  Q_PROPERTY( Look look READ look WRITE setLook )
52  Q_PROPERTY( TQColor color READ color WRITE setColor )
53  Q_PROPERTY( int darkFactor READ darkFactor WRITE setDarkFactor )
54 
55 public:
56 
61  enum State { Off, On };
62 
67  enum Shape { Rectangular, Circular };
68 
89  enum Look { Flat, Raised, Sunken };
90 
95  KLed(TQWidget *parent=0, const char *name=0);
106  KLed(const TQColor &col, TQWidget *parent=0, const char *name=0);
107 
122  KLed(const TQColor& col, KLed::State state, KLed::Look look, KLed::Shape shape,
123  TQWidget *parent=0, const char *name=0);
124 
125 
130  ~KLed();
131 
138  State state() const;
139 
140  Shape shape() const;
141 
148  TQColor color() const;
149 
156  Look look() const;
157 
164  int darkFactor() const;
165 
175  void setState( State state );
176 
180  void setShape(Shape s);
189  void toggleState() KDE_DEPRECATED;
190 
204  void setColor(const TQColor& color);
205 
218  void setDarkFactor(int darkfactor);
219 
250  void setLook( Look look );
251 
252  virtual TQSize sizeHint() const;
253  virtual TQSize minimumSizeHint() const;
254 
255 public slots:
256 
262  void toggle();
263 
270  void on();
271 
278  void off();
279 
280 protected:
284  virtual void paintFlat();
288  virtual void paintRound();
292  virtual void paintSunken();
296  virtual void paintRect();
301  virtual void paintRectFrame(bool raised);
302 
303  void paintEvent( TQPaintEvent * );
304 
308  int ensureRoundLed();
309 
314  bool paintCachedPixmap();
315 
316 private:
317  State led_state;
318  TQColor led_color;
319  Look led_look;
320  Shape led_shape;
321 
322 protected:
323  virtual void virtual_hook( int id, void* data );
324 private:
325  class KLedPrivate;
326  KLedPrivate *d;
327 };
328 
329 #endif
KLed
An LED widget.
Definition: kled.h:46
KLed::State
State
Status of the light is on/off.
Definition: kled.h:61
KLed::Shape
Shape
Shades of the lamp.
Definition: kled.h:67
KLed::Look
Look
Displays a flat, round or sunken LED.
Definition: kled.h:89

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |