diff --git a/doric-Qt/doric/DoricInterfaceDriver.h b/doric-Qt/doric/DoricInterfaceDriver.h index 6b4829d5..7e630667 100644 --- a/doric-Qt/doric/DoricInterfaceDriver.h +++ b/doric-Qt/doric/DoricInterfaceDriver.h @@ -1,10 +1,13 @@ #ifndef INTERFACEDRIVER_H #define INTERFACEDRIVER_H +#include #include #include #include "DoricRegistry.h" +#include "async/DoricAsyncResult.h" +#include "utils/DoricThreadMode.h" class DoricInterfaceDriver { public: @@ -13,6 +16,9 @@ public: virtual void invokeDoricMethod(QString method, QVariantList args) = 0; + virtual DoricAsyncResult *asyncCall(QRunnable *runnable, + DoricThreadMode mode) = 0; + virtual void createContext(QString contextId, QString script, QString source) = 0; diff --git a/doric-Qt/doric/DoricNativeDriver.cpp b/doric-Qt/doric/DoricNativeDriver.cpp index fd56a360..f35dc323 100644 --- a/doric-Qt/doric/DoricNativeDriver.cpp +++ b/doric-Qt/doric/DoricNativeDriver.cpp @@ -19,6 +19,11 @@ void DoricNativeDriver::invokeDoricMethod(QString method, QVariantList args) { }); } +DoricAsyncResult *DoricNativeDriver::asyncCall(QRunnable *runnable, + DoricThreadMode mode) { + return NULL; +} + void DoricNativeDriver::createContext(QString contextId, QString script, QString source) { DoricAsyncCall::ensureRunInThreadPool( diff --git a/doric-Qt/doric/DoricNativeDriver.h b/doric-Qt/doric/DoricNativeDriver.h index cec3d0ca..48f54494 100644 --- a/doric-Qt/doric/DoricNativeDriver.h +++ b/doric-Qt/doric/DoricNativeDriver.h @@ -26,6 +26,8 @@ public: void invokeDoricMethod(QString method, QVariantList args) override; + DoricAsyncResult * asyncCall(QRunnable *runnable, DoricThreadMode mode) override; + void createContext(QString contextId, QString script, QString source) override; diff --git a/doric-Qt/doric/doric.pro b/doric-Qt/doric/doric.pro index b22c130b..71a22e42 100644 --- a/doric-Qt/doric/doric.pro +++ b/doric-Qt/doric/doric.pro @@ -76,4 +76,5 @@ HEADERS += \ utils/DoricContextHolder.h \ utils/DoricCountDownLatch.h \ utils/DoricObjectFactory.h \ + utils/DoricThreadMode.h \ utils/DoricUtils.h diff --git a/doric-Qt/doric/utils/DoricThreadMode.h b/doric-Qt/doric/utils/DoricThreadMode.h new file mode 100644 index 00000000..3a0c67be --- /dev/null +++ b/doric-Qt/doric/utils/DoricThreadMode.h @@ -0,0 +1,9 @@ +#ifndef DORICTHREADMODE_H +#define DORICTHREADMODE_H + +enum DoricThreadMode { + UI, + JS, +}; + +#endif // DORICTHREADMODE_H