+ g_variant_get(reply_body, "(a(i))", id_iter);
+ }
+
+ if (reply_body)
+ g_variant_unref(reply_body);
+
+ if (reply)
+ g_object_unref(reply);
+
+ return ret;
+}
+
+int sticker_dbus_get_sticker_info_by_display_type(GDBusConnection *gdbus_connection, const char *app_id, sticker_data_display_type_e type, int offset, int count, GVariantIter **id_iter)
+{
+ int ret;
+ GDBusMessage *reply = NULL;
+ GVariant *reply_body = NULL;
+
+ ret = _send_sync_message(gdbus_connection, g_variant_new("(siii)", app_id, (int)type, offset, count), &reply, "get_sticker_info_by_disp_type");
+ if (ret == STICKER_CLIENT_ERROR_NONE) {
+ reply_body = g_dbus_message_get_body(reply);
+ g_variant_get(reply_body, "(a(i))", id_iter);
+ }
+
+ if (reply_body)
+ g_variant_unref(reply_body);
+
+ if (reply)
+ g_object_unref(reply);
+
+ return ret;
+}
+
+int sticker_dbus_get_group_list_by_display_type(GDBusConnection *gdbus_connection, const char *app_id, sticker_data_display_type_e type, GList **group_list)
+{
+ int ret;
+ GDBusMessage *reply = NULL;
+ GVariantIter *iter = NULL;
+ GVariant *reply_body = NULL;
+ char *group = NULL;
+
+ if (group_list == NULL) {
+ LOGE("group_list is invalid");
+ return STICKER_CLIENT_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = _send_sync_message(gdbus_connection, g_variant_new("(si)", app_id, (int)type), &reply, "get_group_list_by_disp_type");
+ if (ret == STICKER_CLIENT_ERROR_NONE) {
+ reply_body = g_dbus_message_get_body(reply);
+ g_variant_get(reply_body, "(a(s))", &iter);
+
+ if (!iter) {
+ LOGD("failed to get iter");
+ return STICKER_CLIENT_ERROR_OPERATION_FAILED;
+ }
+
+ while (g_variant_iter_loop (iter, "(s)", &group)) {
+ *group_list = g_list_append(*group_list, strdup((const char *)group));
+ }
+
+ g_variant_iter_free(iter);
+ }
+
+ if (reply_body)
+ g_variant_unref(reply_body);
+
+ if (reply)
+ g_object_unref(reply);
+
+ return ret;
+}
+
+int sticker_dbus_check_file_exists(GDBusConnection *gdbus_connection, const char *uri, int *result)
+{
+ int ret;
+ GDBusMessage *reply = NULL;
+ GVariant *reply_body = NULL;
+
+ ret = _send_sync_message(gdbus_connection, g_variant_new("(s)", uri), &reply, "check_file_exists");
+ if (ret == STICKER_CLIENT_ERROR_NONE) {
+ reply_body = g_dbus_message_get_body(reply);
+ g_variant_get(reply_body, "(i)", result);
+ }
+
+ if (reply_body)
+ g_variant_unref(reply_body);
+
+ if (reply)
+ g_object_unref(reply);
+
+ return ret;
+}
+
+int sticker_dbus_insert_recent_sticker_info(GDBusConnection *gdbus_connection, int record_id)
+{
+ int ret;
+ GDBusMessage *reply = NULL;
+
+ ret = _send_sync_message(gdbus_connection, g_variant_new("(i)", record_id), &reply, "insert_recent_sticker_info");
+ if (ret != STICKER_CLIENT_ERROR_NONE)
+ LOGE("failed to insert recent sticker info");
+
+ if (reply)
+ g_object_unref(reply);
+
+ return ret;
+}
+
+int sticker_dbus_get_recent_sticker_list(GDBusConnection *gdbus_connection, int count, GVariantIter **id_iter)
+{
+ int ret;
+ GDBusMessage *reply = NULL;
+ GVariant *reply_body = NULL;
+
+ ret = _send_sync_message(gdbus_connection, g_variant_new("(i)", count), &reply, "get_recent_sticker_info");
+ if (ret == STICKER_CLIENT_ERROR_NONE) {
+ reply_body = g_dbus_message_get_body(reply);
+ g_variant_get(reply_body, "(a(i))", id_iter);