Plasma
runnerscriptqscript.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
00021 #ifndef RUNNERSCRIPTQSCRIPT_H
00022 #define RUNNERSCRIPTQSCRIPT_H
00023
00024 #include <QScriptValue>
00025
00026 #include <plasma/scripting/runnerscript.h>
00027
00028 class QScriptEngine;
00029 class QScriptContext;
00030
00031 class RunnerScriptQScript : public Plasma::RunnerScript
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 RunnerScriptQScript(QObject *parent, const QVariantList &args);
00037 ~RunnerScriptQScript();
00038
00039 bool init();
00040
00042 Q_INVOKABLE Plasma::AbstractRunner* runner() const;
00043
00045 void match(Plasma::RunnerContext *search);
00046
00048 void exec(const Plasma::RunnerContext *search, const Plasma::QueryMatch *action);
00049
00050 protected:
00051 void setupObjects();
00052 void importExtensions();
00053 void reportError();
00054
00055 private:
00056 QScriptEngine *m_engine;
00057 QScriptValue m_self;
00058 };
00059
00060 K_EXPORT_PLASMA_RUNNERSCRIPTENGINE(qscriptrunner, RunnerScriptQScript)
00061
00062 #endif // RUNNERSCRIPTQSCRIPT_H