Kross

qts/plugin.h
1 /***************************************************************************
2  * plugin.h
3  * This file is part of the KDE project
4  * copyright (C)2007 by Sebastian Sauer ([email protected])
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
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 GNU
13  * Library General Public License for more details.
14  * You should have received a copy of the GNU Library General Public License
15  * along with this program; see the file COPYING. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  ***************************************************************************/
19 
20 #ifndef KROSS_ECMAPLUGIN_H
21 #define KROSS_ECMAPLUGIN_H
22 
23 #include <QScriptEngine>
24 #include <QScriptExtensionPlugin>
25 //#include <QVariant>
26 //#include <QObject>
27 //#include <QDir>
28 //#include <QDomAttr>
29 //#include <QAction>
30 //#include <QUrl>
31 
32 //#include "errorinterface.h"
33 //#include "childreninterface.h"
34 
35 #define KROSSQTSPLUGIN_EXPORT Q_DECL_EXPORT
36 
37 namespace Kross
38 {
39 
40 /**
41 * Kross QtScript Extension that provides access to the Kross Scripting Framework
42 * within the QtScript scripting language. This EcmaPlugin does implement the
43 * extension named "kross".
44 */
45 class KROSSQTSPLUGIN_EXPORT EcmaPlugin : public QScriptExtensionPlugin
46 {
47  Q_OBJECT
48  Q_PLUGIN_METADATA(IID "org.kde.EcmaPlugin")
49 public:
50 
51  /**
52  * Constructor.
53  *
54  * \param parent Optional QObject parent of this QObject.
55  */
56  EcmaPlugin(QObject *parent = nullptr);
57 
58  /**
59  * Destructor.
60  */
61  ~EcmaPlugin() override;
62 
63  /**
64  * Initializes this extension.
65  *
66  * \param key The key to differ between extensions. We provide
67  * the extension which key is "kross".
68  * \param engine The QScriptEngine instance.
69  */
70  void initialize(const QString &key, QScriptEngine *engine) override;
71 
72  /**
73  * Returns the list of keys this plugin supports.
74  *
75  * \return a QStringList with the single item "kross" to let
76  * QtScript know, that we provide an extension with that key.
77  */
78  QStringList keys() const override;
79 
80 private:
81  /// \internal d-pointer class.
82  class Private;
83  /// \internal d-pointer instance.
84  Private *const d;
85 };
86 
87 }
88 
89 #endif
90 
Kross QtScript Extension that provides access to the Kross Scripting Framework within the QtScript sc...
Definition: qts/plugin.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:09:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.