C# Class Plasma.DataEngine

Inheritance: Qyoto.QObject, IDisposable
Mostra file Open project: 0xd34df00d/Qross

Private Properties

Property Type Description
ForceImmediateUpdateOfAllVisualizations void
Init void
RemoveSource void
ScheduleSourcesUpdated void
ServiceForSource Service
SourceRequestEvent bool
TimerEvent void
UpdateAllSources void
UpdateSourceEvent bool
sources List

Public Methods

Method Description
ConnectAllSources ( QObject visualization ) : void
ConnectAllSources ( QObject visualization, uint pollingInterval ) : void
ConnectAllSources ( QObject visualization, uint pollingInterval, Plasma intervalAlignment ) : void Connects all currently existing sources to an object for data updates. The object must have a slot with the following signature: SLOT("dataUpdated(string,Plasma.DataEngine.Data)") The data is a QHash of QVariants keyed by string names, allowing one data source to provide sets of related data. This method may be called multiple times for the same visualization without side-effects. This can be useful to change the pollingInterval. Note that this method does not automatically connect sources that may appear later on. Connecting and responding to the sourceAdded sigal is still required to achieve that. name="visualization" the object to connect the data source to name="pollingInterval" the frequency, in milliseconds, with which to check for updates; a value of 0 (the default) means to update only when there is new data spontaneously generated (e.g. by the engine); any other value results in periodic updates from this source. This value is per-visualization and can be handy for items that require constant updates such as scrolling graphs or clocks. If the data has not changed, no update will be sent. name="intervalAlignment" the number of ms to align the interval to
ConnectSource ( string source, QObject visualization ) : void
ConnectSource ( string source, QObject visualization, uint pollingInterval ) : void
ConnectSource ( string source, QObject visualization, uint pollingInterval, Plasma intervalAlignment ) : void Connects a source to an object for data updates. The object must have a slot with the following signature: dataUpdated(stringsourceName, const Plasma.DataEngine.Data &data) The data is a QHash of QVariants keyed by string names, allowing one data source to provide sets of related data. name="source" the name of the data source name="visualization" the object to connect the data source to name="pollingInterval" the frequency, in milliseconds, with which to check for updates; a value of 0 (the default) means to update only when there is new data spontaneously generated (e.g. by the engine); any other value results in periodic updates from this source. This value is per-visualization and can be handy for items that require constant updates such as scrolling graphs or clocks. If the data has not changed, no update will be sent. name="intervalAlignment" the number of ms to align the interval to
ContainerForSource ( string source ) : DataContainer Retrevies a pointer to the DataContainer for a given source. This method should not be used if possible. An exception is for script engines that can not provide a QMetaObject as required by connectSource for the initial call to dataUpdated. Using this method, such engines can provide their own connectSource API. name="source" the name of the source.
DataEngine ( ) : System
DataEngine ( QObject parent ) : System
DataEngine ( QObject parent, Kimono.KService service ) : System Constructor. name="parent" The parent object. name="service" pointer to the service that describes the engine
DataEngine ( QObject parent, List args ) : System
DisconnectSource ( string source, QObject visualization ) : void Disconnects a source to an object that was receiving data updates. name="source" the name of the data source name="visualization" the object to connect the data source to
Dispose ( ) : void
IsEmpty ( ) : bool Returns true if the data engine is empty, which is to say that it has no data sources currently.
MaxSourceCount ( ) : uint Returns the maximum number of sources this DataEngine will have at any given time.
Name ( ) : string Returns the engine name for the DataEngine
Package ( ) : Package Accessor for the associated Package object if any.
PluginName ( ) : string Returns the plugin name for the applet
Query ( string source ) : QVariant>.Dictionary Gets the Data associated with a data source. The data is a QHash of QVariants keyed by string names, allowing one data source to provide sets of related data. name="source" the data source to retrieve the data for

Protected Methods

Method Description
AddSource ( Plasma source ) : void Adds an already constructed data source. The DataEngine takes ownership of the DataContainer object. The objectName of the source is used for the source name. name="source" the DataContainer to add to the DataEngine
ContainerDict ( ) : Plasma.DataContainer>.Dictionary
CreateProxy ( ) : void
DataEngine ( Type dummy ) : System
MinimumPollingInterval ( ) : int
RemoveAllData ( string source ) : void Removes all the data associated with a data source. name="source" the name of the data source
RemoveAllSources ( ) : void Removes all data sources
RemoveData ( string source, string key ) : void Removes a data entry from a source name="source" the name of the data source name="key" the data entry to remove
SetData ( string source, QVariant>.Dictionary data ) : void Adds a set of data to a data source. If the source doesn't exist then it is created. name="source" the name of the data source name="data" the data to add to the source
SetData ( string source, Qyoto.QVariant value ) : void Sets a value for a data source. If the source doesn't exist then it is created. name="source" the name of the data source name="value" the data to associated with the source
SetData ( string source, string key, Qyoto.QVariant value ) : void Sets a value for a data source. If the source doesn't exist then it is created. name="source" the name of the data source name="key" the key to use for the data name="value" the data to associated with the source
SetMaxSourceCount ( uint limit ) : void Sets an upper limit on the number of data sources to keep in this engine. If the limit is exceeded, then the oldest data source, as defined by last update, is dropped. name="limit" the maximum number of sources to keep active
SetMinimumPollingInterval ( int minimumMs ) : void Sets the minimum amount of time, in milliseconds, that must pass between successive updates of data. This can help prevent too many updates happening due to multiple update requests coming in, which can be useful for expensive (time- or resource-wise) update mechanisms. name="minimumMs" the minimum time lapse, in milliseconds, between updates. A value less than 0 means to never perform automatic updates, a value of 0 means update immediately on every update request, a value >0 will result in a minimum time lapse being enforced.
SetName ( string name ) : void Sets the engine name for the DataEngine
SetPollingInterval ( uint frequency ) : void Sets up an internal update tick for all data sources. On every update, updateSourceEvent will be called for each applicable source. name="frequency" the time, in milliseconds, between updates. A value of 0 will stop internally triggered updates.

Private Methods

Method Description
ForceImmediateUpdateOfAllVisualizations ( ) : void
Init ( ) : void
RemoveSource ( string source ) : void
ScheduleSourcesUpdated ( ) : void
ServiceForSource ( string source ) : Service
SourceRequestEvent ( string source ) : bool
TimerEvent ( Qyoto.QTimerEvent arg1 ) : void
UpdateAllSources ( ) : void
UpdateSourceEvent ( string source ) : bool
sources ( ) : List

Method Details

AddSource() protected method

Adds an already constructed data source. The DataEngine takes ownership of the DataContainer object. The objectName of the source is used for the source name. name="source" the DataContainer to add to the DataEngine
protected AddSource ( Plasma source ) : void
source Plasma
return void

ConnectAllSources() public method

public ConnectAllSources ( QObject visualization ) : void
visualization Qyoto.QObject
return void

ConnectAllSources() public method

public ConnectAllSources ( QObject visualization, uint pollingInterval ) : void
visualization Qyoto.QObject
pollingInterval uint
return void

ConnectAllSources() public method

Connects all currently existing sources to an object for data updates. The object must have a slot with the following signature: SLOT("dataUpdated(string,Plasma.DataEngine.Data)") The data is a QHash of QVariants keyed by string names, allowing one data source to provide sets of related data. This method may be called multiple times for the same visualization without side-effects. This can be useful to change the pollingInterval. Note that this method does not automatically connect sources that may appear later on. Connecting and responding to the sourceAdded sigal is still required to achieve that. name="visualization" the object to connect the data source to name="pollingInterval" the frequency, in milliseconds, with which to check for updates; a value of 0 (the default) means to update only when there is new data spontaneously generated (e.g. by the engine); any other value results in periodic updates from this source. This value is per-visualization and can be handy for items that require constant updates such as scrolling graphs or clocks. If the data has not changed, no update will be sent. name="intervalAlignment" the number of ms to align the interval to
public ConnectAllSources ( QObject visualization, uint pollingInterval, Plasma intervalAlignment ) : void
visualization Qyoto.QObject
pollingInterval uint
intervalAlignment Plasma
return void

ConnectSource() public method

public ConnectSource ( string source, QObject visualization ) : void
source string
visualization Qyoto.QObject
return void

ConnectSource() public method

public ConnectSource ( string source, QObject visualization, uint pollingInterval ) : void
source string
visualization Qyoto.QObject
pollingInterval uint
return void

ConnectSource() public method

Connects a source to an object for data updates. The object must have a slot with the following signature: dataUpdated(stringsourceName, const Plasma.DataEngine.Data &data) The data is a QHash of QVariants keyed by string names, allowing one data source to provide sets of related data. name="source" the name of the data source name="visualization" the object to connect the data source to name="pollingInterval" the frequency, in milliseconds, with which to check for updates; a value of 0 (the default) means to update only when there is new data spontaneously generated (e.g. by the engine); any other value results in periodic updates from this source. This value is per-visualization and can be handy for items that require constant updates such as scrolling graphs or clocks. If the data has not changed, no update will be sent. name="intervalAlignment" the number of ms to align the interval to
public ConnectSource ( string source, QObject visualization, uint pollingInterval, Plasma intervalAlignment ) : void
source string
visualization Qyoto.QObject
pollingInterval uint
intervalAlignment Plasma
return void

ContainerDict() protected method

protected ContainerDict ( ) : Plasma.DataContainer>.Dictionary
return Plasma.DataContainer>.Dictionary

ContainerForSource() public method

Retrevies a pointer to the DataContainer for a given source. This method should not be used if possible. An exception is for script engines that can not provide a QMetaObject as required by connectSource for the initial call to dataUpdated. Using this method, such engines can provide their own connectSource API. name="source" the name of the source.
public ContainerForSource ( string source ) : DataContainer
source string
return DataContainer

CreateProxy() protected method

protected CreateProxy ( ) : void
return void

DataEngine() public method

public DataEngine ( ) : System
return System

DataEngine() public method

public DataEngine ( QObject parent ) : System
parent Qyoto.QObject
return System

DataEngine() public method

Constructor. name="parent" The parent object. name="service" pointer to the service that describes the engine
public DataEngine ( QObject parent, Kimono.KService service ) : System
parent Qyoto.QObject
service Kimono.KService
return System

DataEngine() public method

public DataEngine ( QObject parent, List args ) : System
parent Qyoto.QObject
args List
return System

DataEngine() protected method

protected DataEngine ( Type dummy ) : System
dummy System.Type
return System

DisconnectSource() public method

Disconnects a source to an object that was receiving data updates. name="source" the name of the data source name="visualization" the object to connect the data source to
public DisconnectSource ( string source, QObject visualization ) : void
source string
visualization Qyoto.QObject
return void

Dispose() public method

public Dispose ( ) : void
return void

IsEmpty() public method

Returns true if the data engine is empty, which is to say that it has no data sources currently.
public IsEmpty ( ) : bool
return bool

MaxSourceCount() public method

Returns the maximum number of sources this DataEngine will have at any given time.
public MaxSourceCount ( ) : uint
return uint

MinimumPollingInterval() protected method

protected MinimumPollingInterval ( ) : int
return int

Name() public method

Returns the engine name for the DataEngine
public Name ( ) : string
return string

Package() public method

Accessor for the associated Package object if any.
public Package ( ) : Package
return Package

PluginName() public method

Returns the plugin name for the applet
public PluginName ( ) : string
return string

Query() public method

Gets the Data associated with a data source. The data is a QHash of QVariants keyed by string names, allowing one data source to provide sets of related data. name="source" the data source to retrieve the data for
public Query ( string source ) : QVariant>.Dictionary
source string
return QVariant>.Dictionary

RemoveAllData() protected method

Removes all the data associated with a data source. name="source" the name of the data source
protected RemoveAllData ( string source ) : void
source string
return void

RemoveAllSources() protected method

Removes all data sources
protected RemoveAllSources ( ) : void
return void

RemoveData() protected method

Removes a data entry from a source name="source" the name of the data source name="key" the data entry to remove
protected RemoveData ( string source, string key ) : void
source string
key string
return void

SetData() protected method

Adds a set of data to a data source. If the source doesn't exist then it is created. name="source" the name of the data source name="data" the data to add to the source
protected SetData ( string source, QVariant>.Dictionary data ) : void
source string
data QVariant>.Dictionary
return void

SetData() protected method

Sets a value for a data source. If the source doesn't exist then it is created. name="source" the name of the data source name="value" the data to associated with the source
protected SetData ( string source, Qyoto.QVariant value ) : void
source string
value Qyoto.QVariant
return void

SetData() protected method

Sets a value for a data source. If the source doesn't exist then it is created. name="source" the name of the data source name="key" the key to use for the data name="value" the data to associated with the source
protected SetData ( string source, string key, Qyoto.QVariant value ) : void
source string
key string
value Qyoto.QVariant
return void

SetMaxSourceCount() protected method

Sets an upper limit on the number of data sources to keep in this engine. If the limit is exceeded, then the oldest data source, as defined by last update, is dropped. name="limit" the maximum number of sources to keep active
protected SetMaxSourceCount ( uint limit ) : void
limit uint
return void

SetMinimumPollingInterval() protected method

Sets the minimum amount of time, in milliseconds, that must pass between successive updates of data. This can help prevent too many updates happening due to multiple update requests coming in, which can be useful for expensive (time- or resource-wise) update mechanisms. name="minimumMs" the minimum time lapse, in milliseconds, between updates. A value less than 0 means to never perform automatic updates, a value of 0 means update immediately on every update request, a value >0 will result in a minimum time lapse being enforced.
protected SetMinimumPollingInterval ( int minimumMs ) : void
minimumMs int
return void

SetName() protected method

Sets the engine name for the DataEngine
protected SetName ( string name ) : void
name string
return void

SetPollingInterval() protected method

Sets up an internal update tick for all data sources. On every update, updateSourceEvent will be called for each applicable source. name="frequency" the time, in milliseconds, between updates. A value of 0 will stop internally triggered updates.
protected SetPollingInterval ( uint frequency ) : void
frequency uint
return void