41 lines
848 B
C
41 lines
848 B
C
|
#ifndef NATIVEDRIVER_H
|
||
|
#define NATIVEDRIVER_H
|
||
|
|
||
|
#include <QDebug>
|
||
|
|
||
|
#include "interface_driver.h"
|
||
|
#include "engine/js_engine.h"
|
||
|
|
||
|
class NativeDriver : public InterfaceDriver
|
||
|
{
|
||
|
private:
|
||
|
static NativeDriver *local_instance;
|
||
|
NativeDriver()
|
||
|
{
|
||
|
qDebug() << "constructor";
|
||
|
}
|
||
|
|
||
|
~NativeDriver()
|
||
|
{
|
||
|
qDebug() << "destructor";
|
||
|
}
|
||
|
|
||
|
JSEngine jsEngine;
|
||
|
|
||
|
public:
|
||
|
static NativeDriver *getInstance()
|
||
|
{
|
||
|
static NativeDriver instance;
|
||
|
return &instance;
|
||
|
}
|
||
|
|
||
|
void invokeContextEntityMethod(QString contextId, QString method, QList<QObject> args) override;
|
||
|
|
||
|
void invokeDoricMethod(QString method, QList<QObject> args) override;
|
||
|
|
||
|
void createContext(QString contextId, QString script, QString source) override;
|
||
|
|
||
|
void destroyContext(QString contextId) override;
|
||
|
};
|
||
|
#endif // NATIVEDRIVER_H
|