C# Class Plasma.DataEngine

Inheritance: Qyoto.QObject, IDisposable
Afficher le fichier Open project: 0xd34df00d/Qross

Private Properties

Свойство Type Description
ForceImmediateUpdateOfAllVisualizations void
Init void
RemoveSource void
ScheduleSourcesUpdated void
ServiceForSource Service
SourceRequestEvent bool
TimerEvent void
UpdateAllSources void
UpdateSourceEvent bool
sources List

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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
Résultat void

ConnectAllSources() public méthode

public ConnectAllSources ( QObject visualization ) : void
visualization Qyoto.QObject
Résultat void

ConnectAllSources() public méthode

public ConnectAllSources ( QObject visualization, uint pollingInterval ) : void
visualization Qyoto.QObject
pollingInterval uint
Résultat void

ConnectAllSources() public méthode

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
Résultat void

ConnectSource() public méthode

public ConnectSource ( string source, QObject visualization ) : void
source string
visualization Qyoto.QObject
Résultat void

ConnectSource() public méthode

public ConnectSource ( string source, QObject visualization, uint pollingInterval ) : void
source string
visualization Qyoto.QObject
pollingInterval uint
Résultat void

ConnectSource() public méthode

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
Résultat void

ContainerDict() protected méthode

protected ContainerDict ( ) : Plasma.DataContainer>.Dictionary
Résultat Plasma.DataContainer>.Dictionary

ContainerForSource() public méthode

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
Résultat DataContainer

CreateProxy() protected méthode

protected CreateProxy ( ) : void
Résultat void

DataEngine() public méthode

public DataEngine ( ) : System
Résultat System

DataEngine() public méthode

public DataEngine ( QObject parent ) : System
parent Qyoto.QObject
Résultat System

DataEngine() public méthode

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
Résultat System

DataEngine() public méthode

public DataEngine ( QObject parent, List args ) : System
parent Qyoto.QObject
args List
Résultat System

DataEngine() protected méthode

protected DataEngine ( Type dummy ) : System
dummy System.Type
Résultat System

DisconnectSource() public méthode

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
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

IsEmpty() public méthode

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

MaxSourceCount() public méthode

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

MinimumPollingInterval() protected méthode

protected MinimumPollingInterval ( ) : int
Résultat int

Name() public méthode

Returns the engine name for the DataEngine
public Name ( ) : string
Résultat string

Package() public méthode

Accessor for the associated Package object if any.
public Package ( ) : Package
Résultat Package

PluginName() public méthode

Returns the plugin name for the applet
public PluginName ( ) : string
Résultat string

Query() public méthode

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
Résultat QVariant>.Dictionary

RemoveAllData() protected méthode

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

RemoveAllSources() protected méthode

Removes all data sources
protected RemoveAllSources ( ) : void
Résultat void

RemoveData() protected méthode

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
Résultat void

SetData() protected méthode

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
Résultat void

SetData() protected méthode

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
Résultat void

SetData() protected méthode

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
Résultat void

SetMaxSourceCount() protected méthode

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
Résultat void

SetMinimumPollingInterval() protected méthode

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
Résultat void

SetName() protected méthode

Sets the engine name for the DataEngine
protected SetName ( string name ) : void
name string
Résultat void

SetPollingInterval() protected méthode

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
Résultat void