kitchensync
konnectorbar.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSYNC_KONNECTOR_STATUS_BAR_H
00022 #define KSYNC_KONNECTOR_STATUS_BAR_H
00023
00024 #include <qhbox.h>
00025 #include <qlabel.h>
00026 #include <qpixmap.h>
00027
00028 namespace KSync {
00029 typedef QLabel KonnectorLabel;
00030 class KonnectorState : public QLabel {
00031 Q_OBJECT
00032 public:
00033 KonnectorState( QWidget* wid );
00034 ~KonnectorState();
00035 void setState( bool );
00036 bool state()const;
00037
00038 signals:
00039 void clicked( bool );
00040 protected:
00041 void mousePressEvent( QMouseEvent* );
00042
00043 private:
00044 int m_state;
00045 QPixmap m_pix[2];
00046
00047 };
00048
00057 class KonnectorBar : public QHBox {
00058 Q_OBJECT
00059 public:
00060 enum State { Connected, Disconnected };
00061
00067 KonnectorBar(QWidget* parent );
00068
00072 ~KonnectorBar();
00073
00079 void setName( const QString& name );
00080
00085 QString name()const;
00086
00091 void setState( bool b);
00092
00096 bool state()const;
00097
00101 bool isOn()const;
00102 signals:
00107 void toggled(bool b);
00108
00109 private:
00110 KonnectorLabel* m_lbl;
00111 KonnectorState* m_state;
00112 };
00113 }
00114
00115
00116 #endif
|