Kross
manager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KROSS_MANAGER_H
00021 #define KROSS_MANAGER_H
00022
00023 #include <QtCore/QStringList>
00024 #include <QtCore/QMap>
00025 #include <QtCore/QObject>
00026 #include <QtCore/QUrl>
00027 #include <QtScript/QScriptable>
00028
00029 #include "krossconfig.h"
00030 #include "childreninterface.h"
00031
00032 namespace Kross {
00033
00034
00035 class Interpreter;
00036 class Action;
00037 class ActionCollection;
00038 class InterpreterInfo;
00039
00048 class KROSSCORE_EXPORT Manager
00049 : public QObject
00050 , public QScriptable
00051 , public ChildrenInterface
00052 {
00053 Q_OBJECT
00054
00055 public:
00056
00061 static Manager& self();
00062
00067 QHash<QString, InterpreterInfo*> interpreterInfos() const;
00068
00073 bool hasInterpreterInfo(const QString& interpretername) const;
00074
00080 InterpreterInfo* interpreterInfo(const QString& interpretername) const;
00081
00092 const QString interpreternameForFile(const QString& file);
00093
00103 Interpreter* interpreter(const QString& interpretername) const;
00104
00110 ActionCollection* actionCollection() const;
00111
00112 public Q_SLOTS:
00113
00119 QStringList interpreters() const;
00120
00126 bool hasAction(const QString& name);
00127
00133 QObject* action(const QString& name);
00134
00144 QObject* module(const QString& modulename);
00145
00150 bool executeScriptFile(const QUrl& file = QUrl());
00151
00152 void addQObject(QObject* obj, const QString &name = QString());
00153 QObject* qobject(const QString &name) const;
00154 QStringList qobjectNames() const;
00155
00156 Q_SIGNALS:
00157
00161 void started(Kross::Action*);
00162
00166 void finished(Kross::Action*);
00167
00168 private:
00170 class Private;
00172 Private* const d;
00173
00174 public:
00175
00180 explicit Manager();
00181
00185 virtual ~Manager();
00186 };
00187
00188 }
00189
00190 Q_DECLARE_METATYPE(Kross::Manager*)
00191
00192 #endif
00193