Okular
9#include "config-okular.h"
15#include "script/executor_js_p.h"
19class Okular::ScripterPrivate
22 explicit ScripterPrivate(DocumentPrivate *doc)
31 DocumentPrivate *m_doc;
33 QScopedPointer<ExecutorJS> m_js;
38Scripter::Scripter(DocumentPrivate *doc)
39 : d(new ScripterPrivate(doc))
48void Scripter::execute(
ScriptType type,
const QString &script)
50 qCDebug(OkularCoreDebug) <<
"executing the script:" << script;
52 static QString builtInScript;
53 if (builtInScript.
isNull()) {
54 QFile builtInResource(QStringLiteral(
":/script/builtin.js"));
56 qCDebug(OkularCoreDebug) <<
"failed to load builtin script";
59 builtInResource.close();
66 d->m_js.reset(
new ExecutorJS(d->m_doc));
68 d->m_js->execute(builtInScript + script, d->m_event);
73void Scripter::setEvent(Event *event)
78Event *Scripter::event()
const
ScriptType
Describes the possible script types.
@ JavaScript
JavaScript code.
QString fromUtf8(QByteArrayView str)
bool isNull() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:47:33 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.