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

Plasma

  • plasma
  • scripting
dataenginescript.h
Go to the documentation of this file.
1/*
2 * Copyright 2007 by 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_DATAENGINESCRIPT_H
21#define PLASMA_DATAENGINESCRIPT_H
22
23#include <kgenericfactory.h>
24#include <kplugininfo.h>
25
26#include <plasma/plasma_export.h>
27#include <plasma/dataengine.h>
28#include <plasma/scripting/scriptengine.h>
29
30namespace Plasma
31{
32
33class DataEngineScriptPrivate;
34class Service;
35
41class PLASMA_EXPORT DataEngineScript : public ScriptEngine
42{
43 Q_OBJECT
44
45public:
53 explicit DataEngineScript(QObject *parent = 0);
54 ~DataEngineScript();
55
59 void setDataEngine(DataEngine *dataEngine);
60
64 DataEngine *dataEngine() const;
65
72 virtual QStringList sources() const;
73
81 virtual bool sourceRequestEvent(const QString &name);
82
91 virtual bool updateSourceEvent(const QString &source);
92
99 virtual Service *serviceForSource(const QString &source);
100
101protected:
105 QString mainScript() const;
106
112 const Package *package() const;
113
117 KPluginInfo description() const;
118
119 void setData(const QString &source, const QString &key,
120 const QVariant &value);
121 void setData(const QString &source, const QVariant &value);
122
129 void setData(const QString &source, const DataEngine::Data &values);
130
131 void removeAllData(const QString &source);
132 void removeData(const QString &source, const QString &key);
133 void setMaxSourceCount(uint limit);
134 void setMinimumPollingInterval(int minimumMs);
135 int minimumPollingInterval() const;
136 void setPollingInterval(uint frequency);
137 void removeAllSources();
138 void addSource(DataContainer *source);
139 DataEngine::SourceDict containerDict() const;
140 void setName(const QString &name);
141 void setIcon(const QString &icon);
142 void scheduleSourcesUpdated();
143 void removeSource(const QString &source);
144 void updateAllSources();
145 void forceImmediateUpdateOfAllVisualizations();
146
147private:
148 DataEngineScriptPrivate *const d;
149};
150
151#define K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE(libname, classname) \
152K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
153K_EXPORT_PLUGIN(factory("plasma_dataenginescriptengine_" #libname))
154
155} //Plasma namespace
156
157#endif
Plasma::DataContainer
A set of data exported via a DataEngine.
Definition: datacontainer.h:64
Plasma::DataEngineScript
Provides a restricted interface for scripting a DataEngine.
Definition: dataenginescript.h:42
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition: dataengine.h:59
Plasma::DataEngine::SourceDict
QHash< QString, DataContainer * > SourceDict
Definition: dataengine.h:70
Plasma::DataEngine::Data
QHash< QString, QVariant > Data
Definition: dataengine.h:68
Plasma::Package
object representing an installed Plasmagik package
Definition: package.h:43
Plasma::ScriptEngine
The base class for scripting interfaces to be used in loading plasmoids of a given language.
Definition: scriptengine.h:66
Plasma::Service
This class provides a generic API for write access to settings or services.
Definition: service.h:92
QObject
dataengine.h
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
scriptengine.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