lib
interpreter.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KROSS_API_INTERPRETER_H
00021 #define KROSS_API_INTERPRETER_H
00022
00023 #include <qstring.h>
00024 #include <qmap.h>
00025
00026 #include "object.h"
00027
00028 namespace Kross { namespace Api {
00029
00030
00031 class Manager;
00032 class ScriptContainer;
00033 class Script;
00034 class Interpreter;
00035
00041 class InterpreterInfo
00042 {
00043 public:
00044
00049 class Option
00050 {
00051 public:
00052
00056 typedef QMap<QString, Option*> Map;
00057
00066 Option(const QString& name, const QString& comment, const QVariant& value)
00067 : name(name), comment(comment), value(value) {}
00068
00070 QString name;
00071
00073 QString comment;
00074
00076 QVariant value;
00077 };
00078
00082 InterpreterInfo(const QString& interpretername, const QString& library, const QString& wildcard, QStringList mimetypes, Option::Map options);
00083
00087 ~InterpreterInfo();
00088
00092 const QString getInterpretername();
00093
00100 const QString getWildcard();
00101
00108 const QStringList getMimeTypes();
00109
00113 bool hasOption(const QString& key);
00114
00118 Option* getOption(const QString name);
00119
00125 const QVariant getOptionValue(const QString name, QVariant defaultvalue = QVariant());
00126
00130 Option::Map getOptions();
00131
00136 Interpreter* getInterpreter();
00137
00138 private:
00140 QString m_interpretername;
00142 QString m_library;
00144 QString m_wildcard;
00146 QStringList m_mimetypes;
00148 Option::Map m_options;
00150 Interpreter* m_interpreter;
00151 };
00152
00162 class Interpreter
00163 {
00164 public:
00165
00172 Interpreter(InterpreterInfo* info);
00173
00177 virtual ~Interpreter();
00178
00187 virtual Script* createScript(ScriptContainer* scriptcontainer) = 0;
00188
00189 protected:
00191 InterpreterInfo* m_interpreterinfo;
00192 };
00193
00194 }}
00195
00196 #endif
00197
|