• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
  • sensors
plasmaengine.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 Sebastian Sauer <mail@dipe.org>
3  *
4  * This file is part of SuperKaramba.
5  *
6  * SuperKaramba is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * SuperKaramba is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with SuperKaramba; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef PLASMAENGINE_H
22 #define PLASMAENGINE_H
23 
24 #include <QObject>
25 
26 #include "superkaramba_export.h"
27 #include "sensor.h"
28 #include "meters/meter.h"
29 
30 #include <plasma/dataengine.h>
31 
36 class PlasmaSensorConnector : public QObject
37 {
38  Q_OBJECT
39  public:
40  explicit PlasmaSensorConnector(Meter *meter, const QString& source);
41  virtual ~PlasmaSensorConnector();
42  Meter* meter() const;
43 
44  public Q_SLOTS:
45 
49  QString source() const;
50 
54  void setSource(const QString& source);
55 
59  QString format() const;
60 
65  void setFormat(const QString& format);
66 
67  Q_SIGNALS:
68 
77  void sourceUpdated(const QString& source, QVariantMap data);
78 
79  private Q_SLOTS:
80 
84  void dataUpdated(const QString& source, const Plasma::DataEngine::Data &data);
85 
86  private:
88  class Private;
90  Private* const d;
91 };
92 
97 class SUPERKARAMBA_EXPORT PlasmaSensor : public Sensor
98 {
99  Q_OBJECT
100  public:
101  PlasmaSensor(int interval = -1);
102  virtual ~PlasmaSensor();
103  Plasma::DataEngine* engineImpl() const;
104  void setEngineImpl(Plasma::DataEngine* engine, const QString& engineName);
105 
106  public Q_SLOTS:
107 
111  QString engine();
112 
118  virtual void setEngine(const QString& name);
119 
124  bool isValid() const;
125 
129  QStringList sources() const;
130 
134  QVariant property(const QByteArray& name) const;
135 
139  void setProperty(const QByteArray& name, const QVariant& value);
140 
144  QVariantMap query(const QString& source);
145 
153  virtual QObject* connectSource(const QString& source, QObject* visualization = 0);
154 
158  virtual void disconnectSource(const QString& source, QObject* visualization = 0);
159 
160  Q_SIGNALS:
161 
166  void sourceAdded(const QString& source);
167 
172  void sourceRemoved(const QString& source);
173 
179  void sourceUpdated(const QString& source, QVariantMap data);
180 
181  protected Q_SLOTS:
182 
187  virtual void update();
188 
192  virtual void dataUpdated(const QString& source, Plasma::DataEngine::Data data);
193 
194  private:
196  class Private;
198  Private* const d;
199 };
200 
201 #endif // PLASMAENGINE_H
superkaramba_export.h
meter.h
QObject
Sensor
Definition: sensor.h:17
PlasmaSensorConnector::meter
Meter * meter() const
Definition: plasmaengine.cpp:81
sensor.h
PlasmaSensorConnector::source
QString source() const
Returns the name of the data source.
Definition: plasmaengine.cpp:86
Sensor::update
virtual void update()=0
PlasmaSensorConnector::setFormat
void setFormat(const QString &format)
Set the format the data should use for displaying.
Definition: plasmaengine.cpp:101
PlasmaSensorConnector
This is a helper class that connects a Plasma::DataEngine together with a SuperKaramba Meter widget...
Definition: plasmaengine.h:36
PlasmaSensorConnector::format
QString format() const
Return the format the data should used for displaying.
Definition: plasmaengine.cpp:96
PlasmaSensorConnector::PlasmaSensorConnector
PlasmaSensorConnector(Meter *meter, const QString &source)
Definition: plasmaengine.cpp:67
PlasmaSensorConnector::~PlasmaSensorConnector
virtual ~PlasmaSensorConnector()
Definition: plasmaengine.cpp:75
PlasmaSensorConnector::sourceUpdated
void sourceUpdated(const QString &source, QVariantMap data)
Emitted when a data source got updated.
Meter
Definition: meters/meter.h:23
SUPERKARAMBA_EXPORT
#define SUPERKARAMBA_EXPORT
Definition: superkaramba_export.h:32
PlasmaSensor
The PlasmaSensor class implements a SuperKaramba sensor that provides access to Plasma::DataEngine ob...
Definition: plasmaengine.h:97
PlasmaSensorConnector::setSource
void setSource(const QString &source)
Set the name of the data source.
Definition: plasmaengine.cpp:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

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

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal