Plasma
datacontainer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PLASMA_DATACONTAINER_H
00021 #define PLASMA_DATACONTAINER_H
00022
00023 #include <QtCore/QHash>
00024 #include <QtCore/QObject>
00025
00026 #include <plasma/plasma_export.h>
00027 #include <plasma/dataengine.h>
00028
00029 namespace Plasma
00030 {
00031
00032 class DataContainerPrivate;
00033
00061 class PLASMA_EXPORT DataContainer : public QObject
00062 {
00063 friend class DataEngine;
00064 friend class DataEnginePrivate;
00065 Q_OBJECT
00066
00067 public:
00072 explicit DataContainer(QObject *parent = 0);
00073 virtual ~DataContainer();
00074
00078 const DataEngine::Data data() const;
00079
00095 void setData(const QString &key, const QVariant &value);
00096
00105 void removeAllData();
00106
00110 bool visualizationIsConnected(QObject *visualization) const;
00111
00122 void connectVisualization(QObject *visualization, uint pollingInterval,
00123 Plasma::IntervalAlignment alignment);
00124
00125 public Q_SLOTS:
00132 void disconnectVisualization(QObject *visualization);
00133
00134 Q_SIGNALS:
00146 void dataUpdated(const QString &source, const Plasma::DataEngine::Data &data);
00147
00157 void becameUnused(const QString &source);
00158
00172 void updateRequested(DataContainer *source);
00173
00174 protected:
00178 void checkForUpdate();
00179
00187 uint timeSinceLastUpdate() const;
00188
00197 void setNeedsUpdate(bool update = true);
00198
00199 protected Q_SLOTS:
00208 void checkUsage();
00209
00210 private:
00211 friend class SignalRelay;
00212 DataContainerPrivate *const d;
00213 };
00214
00215 }
00216
00217 #endif // multiple inclusion guard