• Skip to content
  • Skip to link menu
KDE 4.0 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 METER_HEADER
00021 #define METER_HEADER
00022 
00023 #include <plasma/plasma_export.h>
00024 #include <plasma/dataengine.h>
00025 #include <plasma/widgets/widget.h>
00026 
00027 namespace Plasma
00028 {
00029 
00048 class PLASMA_EXPORT Meter : public Plasma::Widget
00049 {
00050     Q_OBJECT
00051     Q_ENUMS(MeterType)
00052     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
00053     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
00054     Q_PROPERTY(int value READ value WRITE setValue)
00055     Q_PROPERTY(QString svg READ svg WRITE setSvg)
00056     Q_PROPERTY(MeterType meterType READ meterType WRITE setMeterType)
00057 
00058 public:
00062     enum MeterType {
00064         BarMeterHorizontal,
00066         BarMeterVertical,
00068         AnalogMeter
00069     };
00070 
00076     explicit Meter(QGraphicsItem *parent = 0, QObject *parentObject = 0);
00077 
00081     ~Meter();
00082 
00086     void setMaximum(int maximum);
00087 
00091     int maximum() const;
00092 
00096     void setMinimum(int minimum);
00097 
00101     int minimum() const;
00102 
00106     void setValue(int value);
00107 
00111     int value() const;
00112 
00116     void setSvg(QString svg);
00117 
00121     QString svg() const;
00122 
00127     void setMeterType(MeterType type);
00128 
00132     MeterType meterType() const;
00133 
00137     virtual QSizeF sizeHint() const;
00138 
00144     void setLabel(int index, const QString &text);
00145 
00150     QString label(int index) const;
00151 
00157     void setLabelColor(int index, const QColor &color);
00158 
00163     QColor labelColor(int index) const;
00164 
00170     void setLabelFont(int index, const QFont &font);
00171 
00176     QFont labelFont(int index) const;
00177 
00183     void setLabelAlignment(int index, const Qt::Alignment alignment);
00184 
00189     Qt::Alignment labelAlignment(int index) const;
00190 
00191 public Q_SLOTS:
00195     void dataUpdated(QString sourceName, Plasma::DataEngine::Data data);
00196 
00197 protected:
00201     virtual void paintWidget(QPainter *p,
00202                              const QStyleOptionGraphicsItem *option,
00203                              QWidget *widget = 0);
00204 
00205 private:
00206     class Private;
00207     Private *const d;
00208 };
00209 
00210 } // End of namepace
00211 
00212 #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
  • 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