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/example/doric/engine/DoricNativeJSE.h
2021-07-21 19:03:29 +08:00

34 lines
792 B
C++

#ifndef NATIVE_JSE_H
#define NATIVE_JSE_H
#include "DoricExport.h"
#include "DoricInterfaceJSE.h"
#include "native/NativeExecutor.h"
#include "v8/V8Executor.h"
enum class JSEType { V8, Native };
class DORIC_EXPORT DoricNativeJSE : public DoricInterfaceJSE {
private:
JSEType mType;
V8Executor *v8Executor;
NativeExecutor *nativeExecutor;
public:
DoricNativeJSE(JSEType type);
QString loadJS(QString script, QString source) override;
void injectGlobalJSObject(QString name, QObject *object) override;
void injectGlobalJSFunction(QString name, QObject *function,
QString property) override;
QString invokeObject(QString objectName, QString functionName,
QVariantList arguments) override;
};
#endif // NATIVE_JSE_H