| <!-- Generated automatically, DO NOT EDIT! --> |
| <a name="head.Cobalt_Plugin"></a> |
| # Cobalt Plugin |
| |
| **Version: 1.0** |
| |
| **Status: :black_circle::black_circle::white_circle:** |
| |
| Cobalt plugin for Thunder framework. |
| |
| ### Table of Contents |
| |
| - [Introduction](#head.Introduction) |
| - [Description](#head.Description) |
| - [Configuration](#head.Configuration) |
| - [Methods](#head.Methods) |
| - [Properties](#head.Properties) |
| - [Notifications](#head.Notifications) |
| |
| <a name="head.Introduction"></a> |
| # Introduction |
| |
| <a name="head.Scope"></a> |
| ## Scope |
| |
| This document describes purpose and functionality of the Cobalt plugin. It includes detailed specification of its configuration, methods and properties provided, as well as notifications sent. |
| |
| <a name="head.Case_Sensitivity"></a> |
| ## Case Sensitivity |
| |
| All identifiers on the interface described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such. |
| |
| <a name="head.Acronyms,_Abbreviations_and_Terms"></a> |
| ## Acronyms, Abbreviations and Terms |
| |
| The table below provides and overview of acronyms used in this document and their definitions. |
| |
| | Acronym | Description | |
| | :-------- | :-------- | |
| | <a name="acronym.API">API</a> | Application Programming Interface | |
| | <a name="acronym.HTTP">HTTP</a> | Hypertext Transfer Protocol | |
| | <a name="acronym.JSON">JSON</a> | JavaScript Object Notation; a data interchange format | |
| | <a name="acronym.JSON-RPC">JSON-RPC</a> | A remote procedure call protocol encoded in JSON | |
| |
| The table below provides and overview of terms and abbreviations used in this document and their definitions. |
| |
| | Term | Description | |
| | :-------- | :-------- | |
| | <a name="term.callsign">callsign</a> | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. | |
| |
| <a name="head.References"></a> |
| ## References |
| |
| | Ref ID | Description | |
| | :-------- | :-------- | |
| | <a name="ref.HTTP">[HTTP](http://www.w3.org/Protocols)</a> | HTTP specification | |
| | <a name="ref.JSON-RPC">[JSON-RPC](https://www.jsonrpc.org/specification)</a> | JSON-RPC 2.0 specification | |
| | <a name="ref.JSON">[JSON](http://www.json.org/)</a> | JSON specification | |
| | <a name="ref.Thunder">[Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20WPEFramework.docx)</a> | Thunder API Reference | |
| |
| <a name="head.Description"></a> |
| # Description |
| |
| The Cobalt plugin provides web browsing functionality based on the Cobalt engine. |
| |
| The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. |
| |
| <a name="head.Configuration"></a> |
| # Configuration |
| |
| The table below lists configuration options of the plugin. |
| |
| | Name | Type | Description | |
| | :-------- | :-------- | :-------- | |
| | callsign | string | Plugin instance name (default: *Cobalt*) | |
| | classname | string | Class name: *Cobalt* | |
| | locator | string | Library name: *libWPEFrameworkCobalt.so* | |
| | autostart | boolean | Determines if the plugin is to be started automatically along with the framework | |
| | configuration | object | <sup>*(optional)*</sup> | |
| | configuration?.url | string | <sup>*(optional)*</sup> The URL that is loaded upon starting the browser | |
| |
| <a name="head.Methods"></a> |
| # Methods |
| |
| The following methods are provided by the Cobalt plugin: |
| |
| Cobalt interface methods: |
| |
| | Method | Description | |
| | :-------- | :-------- | |
| | [deeplink](#method.deeplink) | Send a deep link to the application | |
| |
| <a name="method.deeplink"></a> |
| ## *deeplink <sup>method</sup>* |
| |
| Send a deep link to the application. |
| |
| ### Parameters |
| |
| | Name | Type | Description | |
| | :-------- | :-------- | :-------- | |
| | params | string | An application-specific link | |
| |
| ### Result |
| |
| | Name | Type | Description | |
| | :-------- | :-------- | :-------- | |
| | result | null | | |
| |
| ### Example |
| |
| #### Request |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "id": 1234567890, |
| "method": "Cobalt.1.deeplink", |
| "params": "" |
| } |
| ``` |
| #### Response |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "id": 1234567890, |
| "result": null |
| } |
| ``` |
| <a name="head.Properties"></a> |
| # Properties |
| |
| The following properties are provided by the Cobalt plugin: |
| |
| |
| StateControl interface properties: |
| |
| | Property | Description | |
| | :-------- | :-------- | |
| | [state](#property.state) | Running state of the service | |
| |
| <a name="property.state"></a> |
| ## *state <sup>property</sup>* |
| |
| Provides access to the running state of the service. |
| |
| Also see: [statechange](#event.statechange) |
| |
| ### Value |
| |
| | Name | Type | Description | |
| | :-------- | :-------- | :-------- | |
| | (property) | string | Running state of the service (must be one of the following: *resumed*, *suspended*) | |
| |
| ### Example |
| |
| #### Get Request |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "id": 1234567890, |
| "method": "Cobalt.1.state" |
| } |
| ``` |
| #### Get Response |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "id": 1234567890, |
| "result": "resumed" |
| } |
| ``` |
| #### Set Request |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "id": 1234567890, |
| "method": "Cobalt.1.state", |
| "params": "resumed" |
| } |
| ``` |
| #### Set Response |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "id": 1234567890, |
| "result": "null" |
| } |
| ``` |
| <a name="head.Notifications"></a> |
| # Notifications |
| |
| Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers.Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. |
| |
| The following events are provided by the Cobalt plugin: |
| |
| |
| StateControl interface events: |
| |
| | Event | Description | |
| | :-------- | :-------- | |
| | [statechange](#event.statechange) | Signals a state change of the service | |
| |
| <a name="event.statechange"></a> |
| ## *statechange <sup>event</sup>* |
| |
| Signals a state change of the service. |
| |
| ### Parameters |
| |
| | Name | Type | Description | |
| | :-------- | :-------- | :-------- | |
| | params | object | | |
| | params.suspended | boolean | Determines if the service has entered suspended state (true) or resumed state (false) | |
| |
| ### Example |
| |
| ```json |
| { |
| "jsonrpc": "2.0", |
| "method": "client.events.1.statechange", |
| "params": { |
| "suspended": false |
| } |
| } |
| ``` |