toggleswitch.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by David Saxton                                    *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef TOGGLESWITCH_H
00012 #define TOGGLESWITCH_H
00013 
00014 #include "component.h"
00015 
00020 class ECDPDT : public Component
00021 {
00022 public:
00023         ECDPDT( ICNDocument *icnDocument, bool newItem, const char *id = 0 );
00024         ~ECDPDT();
00025         
00026         static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
00027         static LibraryItem *libraryItem();
00028         
00029         virtual void buttonStateChanged( const QString &id, bool state );
00030         virtual void dataChanged();
00031         virtual bool canFlip() const { return true; }
00032         
00033 private:
00034         virtual void drawShape( QPainter &p );
00035         Switch *m_switch1;
00036         Switch *m_switch2;
00037         Switch *m_switch3;
00038         Switch *m_switch4;
00039         bool pressed;
00040 };
00041 
00042 
00047 class ECDPST : public Component
00048 {
00049 public:
00050         ECDPST( ICNDocument *icnDocument, bool newItem, const char *id = 0 );
00051         ~ECDPST();
00052         
00053         static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
00054         static LibraryItem *libraryItem();
00055         
00056         virtual void buttonStateChanged( const QString &id, bool state );
00057         virtual void dataChanged();
00058         virtual bool canFlip() const { return true; }
00059         
00060 private:
00061         virtual void drawShape( QPainter &p );
00062         Switch *m_switch1;
00063         Switch *m_switch2;
00064         bool pressed;
00065 };
00066 
00067 
00072 class ECSPDT : public Component
00073 {
00074 public:
00075         ECSPDT( ICNDocument *icnDocument, bool newItem, const char *id = 0 );
00076         ~ECSPDT();
00077         
00078         static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
00079         static LibraryItem *libraryItem();
00080         
00081         virtual void buttonStateChanged( const QString &id, bool state );
00082         virtual void dataChanged();
00083         virtual bool canFlip() const { return true; }
00084         
00085 private:
00086         virtual void drawShape( QPainter &p );
00087         Switch *m_switch1;
00088         Switch *m_switch2;
00089         bool pressed;
00090 };
00091 
00092 
00097 class ECSPST : public Component
00098 {
00099 public:
00100         ECSPST( ICNDocument *icnDocument, bool newItem, const char *id = 0 );
00101         ~ECSPST();
00102         
00103         static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
00104         static LibraryItem *libraryItem();
00105         
00106         virtual void buttonStateChanged( const QString &id, bool state );
00107         virtual void dataChanged();
00108         virtual bool canFlip() const { return true; }
00109         
00110 private:
00111         virtual void drawShape( QPainter &p );
00112         Switch *m_switch;
00113         bool pressed;
00114 };
00115 
00116 #endif

Generated on Tue May 8 17:05:33 2007 for KTechLab by  doxygen 1.5.1