+}
+
+void QLibHomeScreen::registerShortcut(QString shortcut_id, QString shortcut_name, QString position)
+{
+ struct json_object* j_obj = json_object_new_object();
+ struct json_object* val_id = json_object_new_string(shortcut_id.toStdString().c_str());
+ struct json_object* val_name = json_object_new_string(shortcut_name.toStdString().c_str());
+ struct json_object* val_position = json_object_new_string(position.toStdString().c_str());
+ json_object_object_add(j_obj, _KEY_SHORTCUT_ID, val_id);
+ json_object_object_add(j_obj, _KEY_SHORTCUT_NAME, val_name);
+ json_object_object_add(j_obj, _KEY_POSITION, val_position);
+
+ mp_hs->registerShortcut(j_obj);
+}
+
+/**
+ * shortcut_id pattern: "shocut_id1,shocut_id2,shocut_id3"
+ * shortcut_name pattern: "shortcut_name1,shortcut_name2,shortcut_name3"
+ */
+void QLibHomeScreen::updateShortcut(QString shortcut_id, QString shortcut_name)
+{
+ QStringList id = shortcut_id.split(',');
+ QStringList name = shortcut_name.split(',');
+ if(id.size() == 0 || id.size() != name.size()) {
+ HMI_NOTICE("qlibhomescreen","input parameters error.");
+ return;
+ }
+
+ // make json contents
+ struct json_object* arr_obj = json_object_new_array();
+ for(int i = 0; i < id.size(); ++i) {
+ struct json_object *j_obj = json_object_new_object();
+ json_object_object_add(j_obj, _KEY_SHORTCUT_ID, json_object_new_string(id[i].toStdString().c_str()));
+ json_object_object_add(j_obj, _KEY_SHORTCUT_NAME, json_object_new_string(name[i].toStdString().c_str()));
+ json_object_array_add(arr_obj, j_obj);
+ }
+ struct json_object* push_obj = json_object_new_object();
+ json_object_object_add(push_obj, _KEY_SHORTCUT, arr_obj);
+ mp_hs->updateShortcut(push_obj);