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/DoricNativeDriver.h

40 lines
992 B
C
Raw Normal View History

2021-02-04 16:59:58 +08:00
#ifndef NATIVEDRIVER_H
#define NATIVEDRIVER_H
#include <QDebug>
#include "DoricInterfaceDriver.h"
#include "engine/DoricJSEngine.h"
class DoricNativeDriver : public DoricInterfaceDriver {
private:
static DoricNativeDriver *local_instance;
DoricNativeDriver() {}
~DoricNativeDriver() {}
DoricJSEngine jsEngine;
public:
static DoricNativeDriver *getInstance() {
static DoricNativeDriver instance;
return &instance;
}
void invokeContextEntityMethod(QString contextId, QString method,
QVariantList args) override;
void invokeDoricMethod(QString method, QVariantList args) override;
2021-02-08 11:37:51 +08:00
DoricAsyncResult *asyncCall(std::function<void()> lambda,
DoricThreadMode mode) override;
2021-02-07 11:21:53 +08:00
2021-02-04 16:59:58 +08:00
void createContext(QString contextId, QString script,
QString source) override;
void destroyContext(QString contextId) override;
DoricRegistry *getRegistry() override;
};
#endif // NATIVEDRIVER_H