afb_req_success_f(request, res, "homescreen binder unsubscribe success.");
}
+/**
+ * registerShortcut event
+ *
+ * #### Parameters
+ * - value : the json contents to MenuBar.
+ * {"application_id":"homescreen","parameter":{"shortcut_id":"dashboard@0.1","shortcut_name":"Dashboard","postion": 1}}
+ *
+ * #### Return
+ * None
+ *
+ */
+static void registerShortcut(afb_req_t request)
+{
+ int ret = 0;
+ const char* value = afb_req_value(request, _application_id);
+ if (value) {
+ ret = g_hs_instance->client_manager->handleRequest(request, __FUNCTION__, value);
+ }
+ else {
+ ret = AFB_EVENT_BAD_REQUEST;
+ }
+
+ if (ret) {
+ afb_req_fail_f(request, "failed", "called %s, Unknown parameter", __FUNCTION__);
+ }
+ else {
+ struct json_object *res = json_object_new_object();
+ hs_add_object_to_json_object_func(res, __FUNCTION__, 2,
+ _error, ret);
+ afb_req_success(request, res, "afb_event_push event [registerShortcut]");
+ }
+}
+
+/**
+ * updateShortcut event
+ *
+ * #### Parameters
+ * - value : homescreen shortcut json contents.
+ * {"application_id":"launcher","parameter":{"shortcut":[{"shortcut_id":"hvac","shortcut_name":"HVAC"},...]}}
+ *
+ * #### Return
+ * None
+ *
+ */
+static void updateShortcut(afb_req_t request)
+{
+ int ret = 0;
+ const char* value = afb_req_value(request, _application_id);
+ if (value) {
+ ret = g_hs_instance->client_manager->handleRequest(request, __FUNCTION__, value);
+ }
+ else {
+ ret = AFB_EVENT_BAD_REQUEST;
+ }
+
+ if (ret) {
+ afb_req_fail_f(request, "failed", "called %s, Unknown parameter", __FUNCTION__);
+ }
+ else {
+ struct json_object *res = json_object_new_object();
+ hs_add_object_to_json_object_func(res, __FUNCTION__, 2,
+ _error, ret);
+ afb_req_success(request, res, "afb_event_push event [updateShortcut]");
+ }
+}
+
/*
* array of the verbs exported to afb-daemon
*/
{ .verb="unsubscribe", .callback=unsubscribe },
{ .verb="showNotification", .callback=showNotification },
{ .verb="showInformation", .callback=showInformation },
+ { .verb="registerShortcut", .callback=registerShortcut },
{ .verb="getRunnables", .callback=getRunnables },
+ { .verb="updateShortcut", .callback=updateShortcut },
{NULL } /* marker for end of the array */
};