add in two missing methods

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=879693
This commit is contained in:
Aaron J. Seigo 2008-11-03 20:23:31 +00:00
parent ba4ce5716b
commit 5f04141dd2
2 changed files with 27 additions and 0 deletions

View File

@ -51,6 +51,11 @@ DataEngine *DataEngineScript::dataEngine() const
return d->dataEngine;
}
QStringList DataEngineScript::sources() const
{
return d->dataEngine->sources();
}
bool DataEngineScript::sourceRequestEvent(const QString &name)
{
Q_UNUSED(name);
@ -63,6 +68,11 @@ bool DataEngineScript::updateSourceEvent(const QString &source)
return false;
}
Service *DataEngineScript::serviceForSource(const QString &source)
{
return d->dataEngine->serviceForSource(source);
}
void DataEngineScript::setData(const QString &source, const QString &key,
const QVariant &value)
{

View File

@ -30,6 +30,7 @@ namespace Plasma
class DataEngine;
class DataEngineScriptPrivate;
class Service;
/**
* @class DataEngineScript plasma/scripting/dataenginescript.h <Plasma/Scripting/DataEngineScript>
@ -61,6 +62,14 @@ public:
*/
DataEngine *dataEngine() const;
/**
* @return a list of all the data sources available via this DataEngine
* Whether these sources are currently available (which is what
* the default implementation provides) or not is up to the
* DataEngine to decide. By default, this returns dataEngine()->sources()
*/
virtual QStringList sources() const;
/**
* Called when the script should create a source that does not currently
* exist.
@ -80,6 +89,14 @@ public:
**/
virtual bool updateSourceEvent(const QString &source);
/**
* @param source the source to targe the Service at
* @return a Service that has the source as a destination. The service
* is parented to the DataEngine, but may be deleted by the
* caller when finished with it
*/
virtual Service *serviceForSource(const QString &source);
protected:
void setData(const QString &source, const QString &key,
const QVariant &value);