Kross

core/script.h
1 /***************************************************************************
2  * script.h
3  * This file is part of the KDE project
4  * copyright (C)2004-2006 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_SCRIPT_H
21 #define KROSS_SCRIPT_H
22 
23 #include "errorinterface.h"
24 
25 #include <QStringList>
26 #include <QVariant>
27 #include <QObject>
28 
29 namespace Kross
30 {
31 
32 // Forward declarations.
33 class Interpreter;
34 class Action;
35 
44 class KROSSCORE_EXPORT Script : public QObject, public ErrorInterface
45 {
46  Q_OBJECT
47 public:
48 
57  Script(Interpreter *interpreter, Action *action);
58 
62  virtual ~Script();
63 
64 public Q_SLOTS:
65 
70  Interpreter *interpreter() const;
71 
75  Action *action() const;
76 
80  virtual void execute() = 0;
81 
85  virtual QStringList functionNames() = 0;
86 
93  virtual QVariant callFunction(const QString &name, const QVariantList &args = QVariantList()) = 0;
94 
101  virtual QVariant evaluate(const QByteArray &code) = 0;
102 
103 private:
105  class Private;
107  Private *const d;
108 };
109 
110 }
111 
112 #endif
113 
Base class for interpreter dependent functionality each script provides.
Definition: core/script.h:44
Interface for error-handling.
Definition: action.cpp:36
Base class for interpreter implementations.
The Action class is an abstract container to deal with scripts like a single standalone script file...
Definition: action.h:95
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:59:43 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.