Inserimento suoni
[qmemory] / qled.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by P. Sereno                                       *
3  *   http://www.sereno-online.com                                          *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU Lesser General Public License           *
7  *   version 2.1 as published by the Free Software Foundation              *
8  *                                                                         *
9  *   This program 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         *
12  *   GNU Lesser General Public License for more details.                   *
13  *   http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.               *
14  ***************************************************************************/
15
16 #ifndef QLED_H
17 #define QLED_H
18
19 #include <Qt>
20 #include <QWidget>
21
22
23 // My Qt designer widget plugin class
24
25 class QColor;
26
27 class  QLed : public QWidget
28 {
29  Q_OBJECT
30
31
32 public: 
33     QLed(QWidget *parent = 0);
34     bool value() const { return m_value; }
35     enum ledColor { Red=0,Green,Yellow,Grey,Orange,Purple,Blue };
36     enum ledShape { Circle=0,Square,Triangle,Rounded};
37     ledColor onColor() const { return m_onColor; }
38     ledColor offColor() const { return m_offColor; }
39     ledShape shape() const { return m_shape; }
40     
41 public slots:
42         void setValue(bool);
43         void setOnColor(ledColor);
44         void setOffColor(ledColor);
45         void setShape(ledShape);       
46         void toggleValue();
47
48 protected:
49     bool m_value;
50     ledColor m_onColor, m_offColor;
51     int id_Timer;
52     ledShape m_shape;
53     QStringList shapes;
54     QStringList colors;
55     void paintEvent(QPaintEvent *event);
56 };
57
58 #endif