• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • @topname@
  • Sitemap
  • Contact Us
 

superkaramba

meter.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 METER_H
00011 #define METER_H
00012 
00013 #include <tqpixmap.h>
00014 #include <tqpainter.h>
00015 #include <tqstring.h>
00016 #include <tqstringlist.h>
00017 #include <tqobject.h>
00018 
00019 #include <tqfileinfo.h>
00020 
00021 class karamba;
00022 
00023 class Meter : public QObject
00024 {
00025 Q_OBJECT
00026 public:
00027 
00028   Meter(karamba* k, int ix,int iy,int iw,int ih);
00029   Meter(karamba* k);
00030   virtual ~Meter();
00031   virtual int getX();
00032   virtual int getY();
00033   virtual int getWidth();
00034   virtual int getHeight();
00035   virtual void setX(int);
00036   virtual void setY(int);
00037   virtual void setWidth(int);
00038   virtual void setHeight(int);
00039 
00040   virtual void setSize(int ix, int iy, int iw, int ih);
00041 
00042   virtual void setMax(long max) { maxValue = max; };
00043   virtual void setMin(long min) { minValue = min; };
00044   virtual long getMax() { return minValue; };
00045   virtual long getMin() { return maxValue; };
00046 
00047   void setThemePath( TQString );
00048 
00049   virtual void mUpdate(TQPainter *)=0 ;
00050 
00051   virtual void setValue(long) {};
00052   virtual long getValue() { return -1; };
00053   virtual void setValue(TQString) {};
00054   virtual TQString getStringValue() const { return TQString::null; };
00055   virtual void recalculateValue() {};
00056 
00057   virtual void setColor(TQColor clr) { color = clr; };
00058   virtual TQColor getColor() { return color; };
00059 
00060   virtual void show() { hidden = 0; };
00061   virtual void hide() { hidden = 1; };
00062 
00063   TQRect getBoundingBox();
00064 
00065   // true when given coordinate point is inside the meters
00066   // active reagion and meter is enabled
00067   virtual bool insideActiveArea(int, int);
00068 
00069   // returns true when callback meterClicked should be called.
00070   virtual bool click( TQMouseEvent* );
00071 
00072   void setEnabled(bool);
00073   bool isEnabled();
00074 
00075   /*
00076   void setOnClick( TQString );
00077   void setOnMiddleClick( TQString );
00078   */
00079 
00080 protected: // Protected attributes
00081   TQString themePath;
00082 
00083   TQRect boundingBox;
00084 
00085   // Actions to execute when clicked on meter
00086   TQString leftButtonAction;
00087   TQString middleButtonAction;
00088   TQString rightButtonAction;
00089 
00090   bool clickable;
00091   int hidden;
00092   long minValue;
00093   long maxValue;
00094 
00095   TQColor color;
00096   karamba* m_karamba;
00097 };
00098 
00099 #endif // METER_H

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

@topname@

Skip menu "@topname@"
  • kcalc
  •   knumber
  • superkaramba
Generated for @topname@ by doxygen 1.5.6
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal