libplasma
dataenginescript.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PLASMA_DATAENGINESCRIPT_H
00021 #define PLASMA_DATAENGINESCRIPT_H
00022
00023 #include <KDE/KGenericFactory>
00024
00025 #include <plasma/plasma_export.h>
00026 #include <plasma/scripting/scriptengine.h>
00027
00028 namespace Plasma
00029 {
00030
00031 class DataEngine;
00032 class DataEngineScriptPrivate;
00033
00034 class PLASMA_EXPORT DataEngineScript : public ScriptEngine
00035 {
00036 Q_OBJECT
00037
00038 public:
00046 explicit DataEngineScript(QObject *parent = 0);
00047 ~DataEngineScript();
00048
00052 void setDataEngine(DataEngine *dataEngine);
00053
00057 DataEngine* dataEngine() const;
00058
00066 virtual bool sourceRequestEvent(const QString &name);
00067
00076 virtual bool updateSourceEvent(const QString& source);
00077
00078 protected:
00079 void setData(const QString& source, const QString& key,
00080 const QVariant& value);
00081 void setData(const QString &source, const QVariant &value);
00082 void removeAllData(const QString& source);
00083 void removeData(const QString& source, const QString& key);
00084 void setMaxSourceCount(uint limit);
00085 void setMinimumPollingInterval(int minimumMs);
00086 int minimumPollingInterval() const;
00087 void setPollingInterval(uint frequency);
00088 void removeAllSources();
00089
00090 private:
00091 DataEngineScriptPrivate * const d;
00092 };
00093
00094 #define K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE(libname, classname) \
00095 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00096 K_EXPORT_PLUGIN(factory("plasma_dataenginescriptengine_" #libname))
00097
00098 }
00099
00100 #endif