• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

meter.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright (C) 2007 Petri Damsten <damu@iki.fi>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #ifndef PLASMA_METER_H
00021 #define PLASMA_METER_H
00022 
00023 #include <plasma/plasma_export.h>
00024 #include <plasma/dataengine.h>
00025 #include <QtGui/QGraphicsWidget>
00026 
00027 namespace Plasma
00028 {
00029 
00030 class MeterPrivate;
00031 
00050 class PLASMA_EXPORT Meter : public QGraphicsWidget
00051 {
00052     Q_OBJECT
00053     Q_ENUMS(MeterType)
00054     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
00055     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
00056     Q_PROPERTY(int value READ value WRITE setValue)
00057     Q_PROPERTY(QString svg READ svg WRITE setSvg)
00058     Q_PROPERTY(MeterType meterType READ meterType WRITE setMeterType)
00059 
00060 public:
00064     enum MeterType {
00066         BarMeterHorizontal,
00068         BarMeterVertical,
00070         AnalogMeter
00071     };
00072 
00078     explicit Meter(QGraphicsItem *parent = 0);
00079 
00083     ~Meter();
00084 
00088     void setMaximum(int maximum);
00089 
00093     int maximum() const;
00094 
00098     void setMinimum(int minimum);
00099 
00103     int minimum() const;
00104 
00108     void setValue(int value);
00109 
00113     int value() const;
00114 
00118     void setSvg(const QString &svg);
00119 
00123     QString svg() const;
00124 
00129     void setMeterType(MeterType type);
00130 
00134     MeterType meterType() const;
00135 
00141     void setLabel(int index, const QString &text);
00142 
00147     QString label(int index) const;
00148 
00154     void setLabelColor(int index, const QColor &color);
00155 
00160     QColor labelColor(int index) const;
00161 
00167     void setLabelFont(int index, const QFont &font);
00168 
00173     QFont labelFont(int index) const;
00174 
00180     void setLabelAlignment(int index, const Qt::Alignment alignment);
00181 
00186     Qt::Alignment labelAlignment(int index) const;
00187 
00188 public Q_SLOTS:
00192     void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
00193 
00194 protected:
00198     virtual void paint(QPainter *p,
00199                        const QStyleOptionGraphicsItem *option,
00200                        QWidget *widget = 0);
00201 
00202 private:
00203     MeterPrivate *const d;
00204 };
00205 
00206 } // End of namepace
00207 
00208 #endif

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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