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

36 lines
947 B
C
Raw Permalink Normal View History

2021-02-04 16:59:58 +08:00
#ifndef INTERFACEDRIVER_H
#define INTERFACEDRIVER_H
2021-02-07 11:21:53 +08:00
#include <QRunnable>
2021-02-04 16:59:58 +08:00
#include <QString>
#include <QVariant>
#include "DoricExport.h"
2021-02-04 16:59:58 +08:00
#include "DoricRegistry.h"
2021-02-07 11:21:53 +08:00
#include "async/DoricAsyncResult.h"
#include "utils/DoricThreadMode.h"
2021-02-04 16:59:58 +08:00
class DORIC_EXPORT DoricInterfaceDriver {
2021-02-04 16:59:58 +08:00
public:
2021-05-12 11:08:40 +08:00
virtual std::shared_ptr<DoricAsyncResult>
invokeContextEntityMethod(QString contextId, QString method,
QVariantList args) = 0;
2021-02-04 16:59:58 +08:00
2021-05-12 11:08:40 +08:00
virtual std::shared_ptr<DoricAsyncResult>
invokeDoricMethod(QString method, QVariantList args) = 0;
2021-02-04 16:59:58 +08:00
2021-05-12 11:08:40 +08:00
virtual std::shared_ptr<DoricAsyncResult>
asyncCall(std::function<void()> lambda, DoricThreadMode mode) = 0;
2021-02-07 11:21:53 +08:00
2021-05-12 11:08:40 +08:00
virtual std::shared_ptr<DoricAsyncResult>
createContext(QString contextId, QString script, QString source) = 0;
2021-02-04 16:59:58 +08:00
2021-05-12 11:08:40 +08:00
virtual std::shared_ptr<DoricAsyncResult>
destroyContext(QString contextId) = 0;
2021-02-04 16:59:58 +08:00
virtual DoricRegistry *getRegistry() = 0;
};
#endif // INTERFACEDRIVER_H