4 * Copyright 2008 Richard J. Moore <rich@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Library General Public License version 2 as
8 * published by the Free Software Foundation
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef RUNNERSCRIPTQSCRIPT_H
22 #define RUNNERSCRIPTQSCRIPT_H
24 #include <QScriptValue>
26 #include <Plasma/RunnerScript>
30 class JavaScriptRunner
: public Plasma::RunnerScript
35 JavaScriptRunner(QObject
*parent
, const QVariantList
&args
);
40 /** Reimplemented to add Q_INVOKABLE. */
41 Q_INVOKABLE
Plasma::AbstractRunner
* runner() const;
43 /** Reimplemented to forward to script. */
44 void match(Plasma::RunnerContext
*search
);
46 /** Reimplemented to forward to script. */
47 void exec(const Plasma::RunnerContext
*search
, const Plasma::QueryMatch
*action
);
51 void importExtensions();
55 QScriptEngine
*m_engine
;
59 K_EXPORT_PLASMA_RUNNERSCRIPTENGINE(qscriptrunner
, JavaScriptRunner
)
61 #endif // RUNNERSCRIPTQSCRIPT_H