lib
scriptcontainer.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KROSS_API_SCRIPTCONTAINER_H
00021 #define KROSS_API_SCRIPTCONTAINER_H
00022
00023 #include "mainmodule.h"
00024
00025 #include <qstring.h>
00026 #include <qvariant.h>
00027 #include <qobject.h>
00028
00029 #include <ksharedptr.h>
00030
00031 namespace Kross { namespace Api {
00032
00033
00034 class Object;
00035 class List;
00036 class ScriptContainerPrivate;
00037
00051 class ScriptContainer : public MainModule
00052 {
00053
00054
00055
00056 friend class Manager;
00057
00058 protected:
00059
00071 explicit ScriptContainer(const QString& name = QString::null);
00072
00073 public:
00074
00076 typedef KSharedPtr<ScriptContainer> Ptr;
00077
00081 virtual ~ScriptContainer();
00082
00087 const QString& getName() const;
00088
00092 void setName(const QString& name);
00093
00097 const QString& getCode() const;
00098
00102 void setCode(const QString& code);
00103
00108 const QString& getInterpreterName() const;
00109
00114 void setInterpreterName(const QString& interpretername);
00115
00120 const QString& getFile() const;
00121
00129 void setFile(const QString& scriptfile);
00130
00136 QMap<QString, QVariant>& getOptions();
00137
00147 const QVariant& getOption(const QString name, QVariant defaultvalue = QVariant(), bool recursive = false);
00148
00152 bool setOption(const QString name, const QVariant& value);
00153
00157 Object::Ptr execute();
00158
00163 const QStringList getFunctionNames();
00164
00175 KSharedPtr<Object> callFunction(const QString& functionname, KSharedPtr<List> arguments = 0);
00176
00180 const QStringList getClassNames();
00181
00185 KSharedPtr<Object> classInstance(const QString& classname);
00186
00193 bool initialize();
00194
00201 void finalize();
00202
00203 private:
00205 ScriptContainerPrivate* d;
00206 };
00207
00208 }}
00209
00210 #endif
00211
|