X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=qled.h;fp=qled.h;h=d57906e1717e36bfb15744245fcb28817fe3d855;hb=d31077d997a477705f784f8ce01af3482d82b2d6;hp=0000000000000000000000000000000000000000;hpb=29f60412ac6dd13e04f86fe3b83b6afde5d5c9ee;p=qmemory diff --git a/qled.h b/qled.h new file mode 100644 index 0000000..d57906e --- /dev/null +++ b/qled.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2010 by P. Sereno * + * http://www.sereno-online.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License * + * version 2.1 as published by the Free Software Foundation * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Lesser General Public License for more details. * + * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * + ***************************************************************************/ + +#ifndef QLED_H +#define QLED_H + +#include +#include + + +// My Qt designer widget plugin class + +class QColor; + +class QLed : public QWidget +{ + Q_OBJECT + + +public: + QLed(QWidget *parent = 0); + bool value() const { return m_value; } + enum ledColor { Red=0,Green,Yellow,Grey,Orange,Purple,Blue }; + enum ledShape { Circle=0,Square,Triangle,Rounded}; + ledColor onColor() const { return m_onColor; } + ledColor offColor() const { return m_offColor; } + ledShape shape() const { return m_shape; } + +public slots: + void setValue(bool); + void setOnColor(ledColor); + void setOffColor(ledColor); + void setShape(ledShape); + void toggleValue(); + +protected: + bool m_value; + ledColor m_onColor, m_offColor; + int id_Timer; + ledShape m_shape; + QStringList shapes; + QStringList colors; + void paintEvent(QPaintEvent *event); +}; + +#endif