• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
datacontainer.h
Go to the documentation of this file.
1/*
2 * Copyright 2006-2007 Aaron Seigo <aseigo@kde.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef PLASMA_DATACONTAINER_H
21#define PLASMA_DATACONTAINER_H
22
23#include <QtCore/QHash>
24#include <QtCore/QObject>
25#include <QtCore/QTimer>
26
27#include <kjob.h>
28#include <plasma/plasma_export.h>
29#include <plasma/dataengine.h>
30
31namespace Plasma
32{
33
34class DataContainerPrivate;
35
63class PLASMA_EXPORT DataContainer : public QObject
64{
65 friend class DataEngine;
66 friend class DataEnginePrivate;
67 Q_OBJECT
68
69 public:
74 explicit DataContainer(QObject *parent = 0);
75 virtual ~DataContainer();
76
80 const DataEngine::Data data() const;
81
97 void setData(const QString &key, const QVariant &value);
98
107 void removeAllData();
108
112 bool visualizationIsConnected(QObject *visualization) const;
113
124 void connectVisualization(QObject *visualization, uint pollingInterval,
125 Plasma::IntervalAlignment alignment);
126
132 void setStorageEnabled(bool store);
133
138 bool isStorageEnabled() const;
139
143 bool needsToBeStored() const;
144
149 void setNeedsToBeStored(bool store);
150
155 DataEngine* getDataEngine();
156
157 public Q_SLOTS:
164 void disconnectVisualization(QObject *visualization);
165
170 void forceImmediateUpdate();
171
172 Q_SIGNALS:
184 void dataUpdated(const QString &source, const Plasma::DataEngine::Data &data);
185
195 void becameUnused(const QString &source);
196
210 void updateRequested(DataContainer *source);
211
212 protected:
216 void checkForUpdate();
217
225 uint timeSinceLastUpdate() const;
226
235 void setNeedsUpdate(bool update = true);
236
237 protected Q_SLOTS:
246 void checkUsage();
247
251 void timerEvent(QTimerEvent * event);
252
253 private:
254 friend class SignalRelay;
255 friend class DataContainerPrivate;
256 friend class DataEngineManager;
257 DataContainerPrivate *const d;
258
259 Q_PRIVATE_SLOT(d, void storeJobFinished(KJob *job))
260 Q_PRIVATE_SLOT(d, void populateFromStoredData(KJob *job))
261 Q_PRIVATE_SLOT(d, void retrieve())
262};
263
264} // Plasma namespace
265
266#endif // multiple inclusion guard
KJob
Plasma::DataContainer
A set of data exported via a DataEngine.
Definition: datacontainer.h:64
Plasma::DataContainer::updateRequested
void updateRequested(DataContainer *source)
Emitted when an update is requested.
Plasma::DataContainer::becameUnused
void becameUnused(const QString &source)
Emitted when the last visualization is disconnected.
Plasma::DataContainer::dataUpdated
void dataUpdated(const QString &source, const Plasma::DataEngine::Data &data)
Emitted when the data has been updated, allowing visualizations to reflect the new data.
Plasma::DataEngineManager
DataEngine loader and life time manager.
Definition: dataenginemanager.h:43
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition: dataengine.h:59
Plasma::DataEngine::Data
QHash< QString, QVariant > Data
Definition: dataengine.h:68
QObject
dataengine.h
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
Plasma::IntervalAlignment
IntervalAlignment
Possible timing alignments.
Definition: plasma.h:181
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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