bar.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Hans Karlsson                                   *
00003  *   karlsson.h@home.se                                                      *
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 #ifndef BAR_H
00011 #define BAR_H
00012 
00013 #include "meter.h"
00014 #include <qpixmap.h>
00015 #include <qstring.h>
00016 #include <qpainter.h>
00017 
00018 class Bar : public Meter
00019 {
00020 Q_OBJECT
00021 public:
00022     Bar(karamba* k,int ix,int iy,int iw,int ih );
00023     ~Bar();
00024 
00025     void mUpdate( QPainter * );
00026 
00027     virtual void setMax( long m );
00028     virtual void setMin( long m );
00029 
00030 public slots:
00031     bool setImage( QString imagePath );
00032     QString getImage() { return imagePath; };
00033 
00034     void setValue( long );
00035     long  getValue() { return barValue; };
00036     void setValue( QString );
00037     void recalculateValue() {setValue(barValue); };
00038 
00039     void setVertical( bool );
00040     int  getVertical() { return vertical; };
00041 
00042 private:
00043     long barValue;
00044     long value;
00045 
00046     int pixmapWidth;
00047     int pixmapHeight;
00048 
00049     bool vertical; // vertical bar?
00050 
00051     QString imagePath;
00052     QPixmap pixmap;
00053 }
00054 ;
00055 #endif // BAR_H
KDE Home | KDE Accessibility Home | Description of Access Keys