Okular

kjs_spell.cpp
1 /*
2  SPDX-FileCopyrightText: 2008 Pino Toscano <[email protected]>
3  SPDX-FileCopyrightText: 2008 Harri Porten <[email protected]>
4 
5  SPDX-License-Identifier: GPL-2.0-or-later
6 */
7 
8 #include "kjs_spell_p.h"
9 
10 #include <kjs/kjsobject.h>
11 #include <kjs/kjsprototype.h>
12 
13 #include <QString>
14 
15 using namespace Okular;
16 
17 static KJSPrototype *g_spellProto;
18 
19 // Spell.available
20 static KJSObject spellGetAvailable(KJSContext *, void *)
21 {
22  return KJSBoolean(false);
23 }
24 
25 void JSSpell::initType(KJSContext *ctx)
26 {
27  static bool initialized = false;
28  if (initialized) {
29  return;
30  }
31  initialized = true;
32 
33  g_spellProto = new KJSPrototype();
34  g_spellProto->defineProperty(ctx, QStringLiteral("available"), spellGetAvailable);
35 }
36 
37 KJSObject JSSpell::object(KJSContext *ctx)
38 {
39  return g_spellProto->constructObject(ctx, nullptr);
40 }
The documentation to the global Okular namespace.
Definition: action.h:16
void defineProperty(KJSContext *ctx, const QString &name, PropertyGetter getter, PropertySetter setter=nullptr)
KJSObject constructObject(KJSContext *ctx, void *internalValue=nullptr)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:04:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.