lib

pythonscript.h
1/***************************************************************************
2 * pythonscript.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
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_PYTHON_PYTHONSCRIPT_H
21#define KROSS_PYTHON_PYTHONSCRIPT_H
22
23#include "pythonconfig.h"
24#include "../api/script.h"
25
26namespace Kross { namespace Python {
27
28 // Forward declarations.
29 class PythonScriptPrivate;
30 class PythonModuleManager;
31
37 {
38 public:
39
49 explicit PythonScript(Kross::Api::Interpreter* interpreter, Kross::Api::ScriptContainer* scriptcontainer);
50
54 virtual ~PythonScript();
55
60 virtual const TQStringList& getFunctionNames();
61
66
70 virtual Kross::Api::Object::Ptr callFunction(const TQString& name, Kross::Api::List::Ptr args);
71
75 virtual const TQStringList& getClassNames();
76
80 virtual Kross::Api::Object::Ptr classInstance(const TQString& name);
81
82 private:
84 PythonScriptPrivate* d;
85
87 void initialize();
89 void finalize();
90
92 Kross::Api::Exception::Ptr toException(const TQString& error);
93 };
94
95}}
96
97#endif
98
TDESharedPtr< Exception > Ptr
Shared pointer to implement reference-counting.
Definition exception.h:45
Base class for interpreters.
TDESharedPtr< List > Ptr
Shared pointer to implement reference-counting.
Definition list.h:44
TDESharedPtr< Object > Ptr
Shared pointer to implement reference-counting.
Definition object.h:57
The ScriptContainer class is something like a single standalone scriptfile.
Base class for interpreter dependend functionality each script provides.
Definition script.h:46
virtual const TQStringList & getFunctionNames()
Return a list of callable functionnames this script spends.
virtual ~PythonScript()
Destructor.
PythonScript(Kross::Api::Interpreter *interpreter, Kross::Api::ScriptContainer *scriptcontainer)
Constructor.
virtual Kross::Api::Object::Ptr execute()
Execute the script.
virtual Kross::Api::Object::Ptr callFunction(const TQString &name, Kross::Api::List::Ptr args)
Call a function.
virtual Kross::Api::Object::Ptr classInstance(const TQString &name)
Create and return a new class instance.
virtual const TQStringList & getClassNames()
Return a list of class types this script supports.
The Python plugin for the Kross scripting framework.
The Kross scripting bridge to embed scripting functionality into an application.
Definition callable.h:31