int showNotification(json_object* json);
int showInformation(json_object* json);
int getRunnables(void);
- int registerShortcut(json_object* json);
- int updateShortcut(json_object* json);
+ int registerShortcut(const char* application_id, json_object* json);
+ int updateShortcut(const char* application_id, json_object* json);
private:
int initialize_websocket();
* - Returns 0 on success or -1 in case of error.
*
*/
-int LibHomeScreen::registerShortcut(json_object* json)
+int LibHomeScreen::registerShortcut(const char* application_id, json_object* json)
{
- if(!sp_websock)
- {
- return -1;
- }
+ if(!sp_websock)
+ {
+ return -1;
+ }
- return this->call("registerShortcut", json);
+ struct json_object* j_obj = json_object_new_object();
+ struct json_object* val = json_object_new_string(application_id);
+ json_object_object_add(j_obj, ApplicationId, val);
+ json_object_object_add(j_obj, "parameter", json);
+
+ return this->call("registerShortcut", j_obj);
}
+
/**
- * update shortcut list
+ * update shortcut to launcher
*
- * Call HomeScreen Service's updateShortcut verb to notify shortcut list.
+ * Call HomeScreen Service's updateShortcut verb to update shortcut.
*
* #### Parameters
* - json [in] : This argument should be specified to the json parameters.
* - Returns 0 on success or -1 in case of error.
*
*/
-int LibHomeScreen::updateShortcut(json_object* json)
+int LibHomeScreen::updateShortcut(const char* application_id, json_object* json)
{
- if(!sp_websock)
- {
- return -1;
- }
+ if(!sp_websock)
+ {
+ return -1;
+ }
- return this->call("updateShortcut", json);
+ struct json_object* j_obj = json_object_new_object();
+ struct json_object* val = json_object_new_string(application_id);
+ json_object_object_add(j_obj, ApplicationId, val);
+ json_object_object_add(j_obj, "parameter", json);
+
+ return this->call("updateShortcut", j_obj);
}
+
/************* Callback Function *************/
void LibHomeScreen::on_hangup(void *closure, struct afb_wsj1 *wsj)