Development/Tutorials/Plasma/JavaScript/API-DataEnginesServices

Jump to: navigation, search

DataEngines and Services provide access to various types of data and the ability to interact with them via asynchronous services with a convenient and consistent API. See the JavaScript Plasmoid DataEngine tutorials for examples on how to use DataEngines and Services in your Plasmoids.

Global Functions to Access DataEngines and Services

  • dataEngine(string name): returns a DataEngine object
  • service(string dataEngineName, string sourceName): returns a ServiceObject, see also DataEngine::serviceForSource

DataEngine

Read-only properties:

  • Array[String] sources
  • boolean valid
  • String icon
  • String name

Signals:

  • sourceAdded(String sourceName)
  • sourceRemoved(String sourceName)

Functions:

  • serviceForSource(String sourceName)
  • connectSource(String sourceName, Object connectTo[, number interval[, IntervalAlignment alignment] ]): if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists
  • connectAllSources(Object connectTo[, number interval[, IntervalAlignment alignment] ]): if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists
  • disconnectSource(String sourceName, Object connectedTo): if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists
  • Data query(String sourceName)

The following functions are only of interest to DataEngine reimplementations (e.g. JavaScript DataEngines):

  • scheduleSourcesUpdated()
  • removeSource(String)
  • updateAllSources()
  • forceImmediateUpdateOfAllVisualizations()
  • DataContainer containerForSource(String)

Service

  • function finished(Plasma::ServiceJob*)
  • function operationsChanged()
  • function serviceReady(Plasma::Service*)
  • function setDestination(QString)
  • function destination()
  • function operationNames()
  • function operationDescription(QString)
  • function startOperationCall(KConfigGroup,QObject*)
  • function startOperationCall(KConfigGroup)
  • function isOperationEnabled(QString)
  • function name()
  • function associateWidget(QWidget*,QString)
  • function disassociateWidget(QWidget*)
  • function associateWidget(QGraphicsWidget*,QString)
  • function disassociateWidget(QGraphicsWidget*)
  • function parametersFromDescription(KConfigGroup)

This page was last modified on 24 June 2011, at 13:05. This page has been accessed 1,731 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal