API for plugins */
| 22 | |
| 23 | /* API for plugins */ |
| 24 | class JSAPIObject : public QObject |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | public: |
| 28 | JSAPIObject(const QString &id, QObject* parent); |
| 29 | |
| 30 | // Networking |
| 31 | Q_INVOKABLE void get_content(const QString &url, const QJSValue &callbackFunc); |
| 32 | Q_INVOKABLE void post_content(const QString &url, const QByteArray &contentType, const QByteArray &postData, const QJSValue &callbackFunc); |
| 33 | |
| 34 | // Dialogs |
| 35 | Q_INVOKABLE void information(const QString &msg); |
| 36 | Q_INVOKABLE void warning(const QString &msg); |
| 37 | Q_INVOKABLE void get_text(const QString &msg, const QString &defaultValue, const QJSValue &callbackFunc); |
| 38 | |
| 39 | // Show result |
| 40 | Q_INVOKABLE void show_result(const QVariant &result); |
| 41 | |
| 42 | // Configurations |
| 43 | Q_INVOKABLE QVariant get_configuration(const QString &name); |
| 44 | Q_INVOKABLE void set_configuration(const QString &name, const QVariant &value); |
| 45 | |
| 46 | signals: |
| 47 | void showResultRequested(const QVariant& result); |
| 48 | void jsError(const QJSValue& error); |
| 49 | |
| 50 | private: |
| 51 | void get_post_content(const QString &url, const QByteArray &contentType, const QByteArray &postData, const QJSValue &callbackFunc); |
| 52 | QString m_id; |
| 53 | }; |
| 54 | |
| 55 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected