This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/DoricContext.h

46 lines
888 B
C
Raw Normal View History

2021-02-04 16:59:58 +08:00
#ifndef CONTEXT_H
#define CONTEXT_H
2021-02-23 14:28:08 +08:00
#include <QQmlEngine>
2021-02-04 16:59:58 +08:00
#include <QVariant>
#include "DoricInterfaceDriver.h"
2021-02-09 17:42:11 +08:00
class DoricRootNode;
2021-02-04 16:59:58 +08:00
class DoricContext {
private:
QString mContextId;
QMap<QString, QObject *> mPluginMap;
DoricRootNode *mRootNode;
QString source;
QString script;
QString extra;
QVariant initParams;
DoricInterfaceDriver *driver = NULL;
2021-02-23 14:28:08 +08:00
QQmlEngine *mQmlEngine;
2021-02-04 16:59:58 +08:00
public:
DoricContext(QString contextId, QString source, QString extra);
static DoricContext *create(QString script, QString source, QString extra);
void init(QString initData);
void build(int width, int height);
void callEntity(QString methodName, QVariantList args);
DoricInterfaceDriver *getDriver();
2021-02-09 10:38:27 +08:00
DoricRootNode *getRootNode();
2021-02-04 16:59:58 +08:00
QObject *obtainPlugin(QString name);
2021-02-23 14:28:08 +08:00
void setQmlEngine(QQmlEngine *engine);
QQmlEngine *getQmlEngine();
2021-02-04 16:59:58 +08:00
};
#endif // CONTEXT_H