kitchensync

konnectorbar.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
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
KDE Home | KDE Accessibility Home | Description of Access Keys