char *id = NULL;
char *presentation_text = NULL;
char *value = NULL;
- autofill_fill_response_h fill_response = (autofill_fill_response_h)user_data;
+ autofill_fill_response_group_h res_group = (autofill_fill_response_group_h)user_data;
- if (!fill_response)
+ if (!res_group)
return true;
rpc_port_autofill_response_item_get_id(response_items, &id);
autofill_fill_response_item_set_presentation_text(ritem, presentation_text);
autofill_fill_response_item_set_value(ritem, value);
- autofill_fill_response_add_item(fill_response, ritem);
+ autofill_fill_response_group_add_item(res_group, ritem);
if (id)
free(id);
if (value)
free(value);
+ autofill_fill_response_item_destroy(ritem);
+
+ return true;
+}
+
+static bool fill_response_group_cb(rpc_port_autofill_response_group_h response_groups, void *user_data)
+{
+ autofill_fill_response_h rh = (autofill_fill_response_h)user_data;
+ autofill_fill_response_group_h res_group;
+
+ LOGD("");
+
+ autofill_fill_response_group_create(&res_group);
+
+ rpc_port_autofill_response_group_foreach_response_items(response_groups, fill_response_item_cb, res_group);
+
+ autofill_fill_response_add_group(rh, res_group);
+
+ autofill_fill_response_group_destroy(res_group);
+
return true;
}
static void __fill_response_recv_cb(void *user_data, rpc_port_autofill_fill_response_h response_h)
{
char *view_id = NULL;
-
autofill_fill_response_h rh;
+
autofill_fill_response_create(&rh);
rpc_port_autofill_fill_response_get_view_id(response_h, &view_id);
LOGD("view id : %s", view_id);
free(view_id);
- rpc_port_autofill_fill_response_foreach_response_items(response_h, fill_response_item_cb, rh);
+ rpc_port_autofill_fill_response_foreach_response_groups(response_h, fill_response_group_cb, rh);
if (g_autofill_fill_response_cb)
g_autofill_fill_response_cb(rh, g_autofill_fill_response_data);
return 0;
}
+struct autofill_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *response_items;
+};
+
+static void __autofill_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __autofill_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_response_item_h value = NULL;
+
+ rpc_port_autofill_response_item_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->response_items = g_list_append(h->response_items, value);
+ }
+ } while (0);
+}
+
+int rpc_port_autofill_response_group_create(rpc_port_autofill_response_group_h *h)
+{
+ struct autofill_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct autofill_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __autofill_response_group_to;
+ handle->parcelable.from = __autofill_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_destroy(rpc_port_autofill_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h value = iter->data;
+ if (value)
+ rpc_port_autofill_response_item_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->response_items);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_clone(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_group_h *clone)
+{
+ rpc_port_autofill_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_autofill_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create autofill_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h new_value;
+ rpc_port_autofill_response_item_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_response_item_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->response_items = g_list_append(handle->response_items, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_add_response_items(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_item_h response_items)
+{
+ if (!h || !response_items) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_response_item_h value = NULL;
+
+ rpc_port_autofill_response_item_clone(response_items, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->response_items = g_list_append(h->response_items, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_foreach_response_items(rpc_port_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_remove_response_items(rpc_port_autofill_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->response_items, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_response_item_h value = iter->data;
+ h->response_items = g_list_remove_link(h->response_items, iter);
+ rpc_port_autofill_response_item_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_get_response_items_length(rpc_port_autofill_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->response_items);
+
+ return 0;
+}
+
struct autofill_fill_response_s {
rpc_port_parcelable_t parcelable;
char *view_id;
- GList *response_items;
+ GList *response_groups;
};
static void __autofill_fill_response_to(rpc_port_parcel_h parcel, void *data)
}
rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_groups));
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
rpc_port_parcel_read_array_count(parcel, &len);
for (int i = 0; i < len; i++) {
- rpc_port_autofill_response_item_h value = NULL;
+ rpc_port_autofill_response_group_h value = NULL;
- rpc_port_autofill_response_item_create(&value);
+ rpc_port_autofill_response_group_create(&value);
if (!value) {
_E("Failed to create handle");
return;
}
rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
}
} while (0);
}
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h value = iter->data;
if (value)
- rpc_port_autofill_response_item_destroy(value);
+ rpc_port_autofill_response_group_destroy(value);
iter = g_list_next(iter);
}
- g_list_free(h->response_items);
+ g_list_free(h->response_groups);
} while (0);
free(h);
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h new_value;
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h new_value;
+ rpc_port_autofill_response_group_h value = iter->data;
if (!value) {
_E("Error: value is NULL");
return -1;
}
- rpc_port_autofill_response_item_clone(value, &new_value);
+ rpc_port_autofill_response_group_clone(value, &new_value);
if (!new_value) {
_E("Failed to duplicate value");
rpc_port_autofill_fill_response_destroy(handle);
return -1;
}
- handle->response_items = g_list_append(handle->response_items, new_value);
+ handle->response_groups = g_list_append(handle->response_groups, new_value);
iter = g_list_next(iter);
}
} while (0);
return 0;
}
-int rpc_port_autofill_fill_response_add_response_items(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_item_h response_items)
+int rpc_port_autofill_fill_response_add_response_groups(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_group_h response_groups)
{
- if (!h || !response_items) {
+ if (!h || !response_groups) {
_E("Invalid parameter");
return -1;
}
do {
- rpc_port_autofill_response_item_h value = NULL;
+ rpc_port_autofill_response_group_h value = NULL;
- rpc_port_autofill_response_item_clone(response_items, &value);
+ rpc_port_autofill_response_group_clone(response_groups, &value);
if (!value) {
_E("Out of memory");
return -1;
}
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
} while (0);
return 0;
return 0;
}
-int rpc_port_autofill_fill_response_foreach_response_items(rpc_port_autofill_fill_response_h h,
- bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data)
+int rpc_port_autofill_fill_response_foreach_response_groups(rpc_port_autofill_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h response_groups, void *user_data), void *user_data)
{
if (!h || !callback) {
_E("Invalid parameter");
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
return 0;
}
-int rpc_port_autofill_fill_response_remove_response_items(rpc_port_autofill_fill_response_h h, unsigned int nth)
+int rpc_port_autofill_fill_response_remove_response_groups(rpc_port_autofill_fill_response_h h, unsigned int nth)
{
GList *iter;
return -1;
}
- iter = g_list_nth(h->response_items, nth);
+ iter = g_list_nth(h->response_groups, nth);
if (iter == NULL)
return -1;
- rpc_port_autofill_response_item_h value = iter->data;
- h->response_items = g_list_remove_link(h->response_items, iter);
- rpc_port_autofill_response_item_destroy(value);
+ rpc_port_autofill_response_group_h value = iter->data;
+ h->response_groups = g_list_remove_link(h->response_groups, iter);
+ rpc_port_autofill_response_group_destroy(value);
g_list_free(iter);
return 0;
}
-int rpc_port_autofill_fill_response_get_response_items_length(rpc_port_autofill_fill_response_h h, unsigned int *length)
+int rpc_port_autofill_fill_response_get_response_groups_length(rpc_port_autofill_fill_response_h h, unsigned int *length)
{
if (!h || !length) {
_E("Invalid parameter");
return -1;
}
- *length = g_list_length(h->response_items);
+ *length = g_list_length(h->response_groups);
return 0;
}
return 0;
}
+struct list_autofill_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *list_autofill_response_groups;
+};
+
+static void __list_autofill_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_response_groups));
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __list_autofill_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_response_group_h value = NULL;
+
+ rpc_port_autofill_response_group_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->list_autofill_response_groups = g_list_append(h->list_autofill_response_groups, value);
+ }
+ } while (0);
+}
+
+int rpc_port_list_autofill_response_group_create(rpc_port_list_autofill_response_group_h *h)
+{
+ struct list_autofill_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct list_autofill_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __list_autofill_response_group_to;
+ handle->parcelable.from = __list_autofill_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_destroy(rpc_port_list_autofill_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h value = iter->data;
+ if (value)
+ rpc_port_autofill_response_group_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->list_autofill_response_groups);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_clone(rpc_port_list_autofill_response_group_h h, rpc_port_list_autofill_response_group_h *clone)
+{
+ rpc_port_list_autofill_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_list_autofill_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create list_autofill_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h new_value;
+ rpc_port_autofill_response_group_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_list_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_response_group_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_list_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->list_autofill_response_groups = g_list_append(handle->list_autofill_response_groups, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_add_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, rpc_port_autofill_response_group_h list_autofill_response_groups)
+{
+ if (!h || !list_autofill_response_groups) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_response_group_h value = NULL;
+
+ rpc_port_autofill_response_group_clone(list_autofill_response_groups, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->list_autofill_response_groups = g_list_append(h->list_autofill_response_groups, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_foreach_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h list_autofill_response_groups, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_remove_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->list_autofill_response_groups, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_response_group_h value = iter->data;
+ h->list_autofill_response_groups = g_list_remove_link(h->list_autofill_response_groups, iter);
+ rpc_port_autofill_response_group_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_get_list_autofill_response_groups_length(rpc_port_list_autofill_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->list_autofill_response_groups);
+
+ return 0;
+}
+
struct list_autofill_response_item_s {
rpc_port_parcelable_t parcelable;
GList *list_autofill_response_items;
int rpc_port_autofill_response_item_get_value(rpc_port_autofill_response_item_h h, char **value);
+typedef struct autofill_response_group_s *rpc_port_autofill_response_group_h;
+
+int rpc_port_autofill_response_group_create(rpc_port_autofill_response_group_h *h);
+
+int rpc_port_autofill_response_group_destroy(rpc_port_autofill_response_group_h h);
+
+int rpc_port_autofill_response_group_clone(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_group_h *clone);
+
+int rpc_port_autofill_response_group_add_response_items(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_item_h response_items);
+
+int rpc_port_autofill_response_group_foreach_response_items(rpc_port_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data);
+
+int rpc_port_autofill_response_group_remove_response_items(rpc_port_autofill_response_group_h h, unsigned int nth);
+
+int rpc_port_autofill_response_group_get_response_items_length(rpc_port_autofill_response_group_h h, unsigned int *length);
+
typedef struct autofill_fill_response_s *rpc_port_autofill_fill_response_h;
int rpc_port_autofill_fill_response_create(rpc_port_autofill_fill_response_h *h);
int rpc_port_autofill_fill_response_set_view_id(rpc_port_autofill_fill_response_h h, const char *view_id);
-int rpc_port_autofill_fill_response_add_response_items(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_item_h response_items);
+int rpc_port_autofill_fill_response_add_response_groups(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_group_h response_groups);
int rpc_port_autofill_fill_response_get_view_id(rpc_port_autofill_fill_response_h h, char **view_id);
-int rpc_port_autofill_fill_response_foreach_response_items(rpc_port_autofill_fill_response_h h,
- bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data);
+int rpc_port_autofill_fill_response_foreach_response_groups(rpc_port_autofill_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h response_groups, void *user_data), void *user_data);
-int rpc_port_autofill_fill_response_remove_response_items(rpc_port_autofill_fill_response_h h, unsigned int nth);
+int rpc_port_autofill_fill_response_remove_response_groups(rpc_port_autofill_fill_response_h h, unsigned int nth);
-int rpc_port_autofill_fill_response_get_response_items_length(rpc_port_autofill_fill_response_h h, unsigned int *length);
+int rpc_port_autofill_fill_response_get_response_groups_length(rpc_port_autofill_fill_response_h h, unsigned int *length);
typedef struct list_autofill_item_s *rpc_port_list_autofill_item_h;
int rpc_port_list_autofill_item_get_list_autofill_items_length(rpc_port_list_autofill_item_h h, unsigned int *length);
+typedef struct list_autofill_response_group_s *rpc_port_list_autofill_response_group_h;
+
+int rpc_port_list_autofill_response_group_create(rpc_port_list_autofill_response_group_h *h);
+
+int rpc_port_list_autofill_response_group_destroy(rpc_port_list_autofill_response_group_h h);
+
+int rpc_port_list_autofill_response_group_clone(rpc_port_list_autofill_response_group_h h, rpc_port_list_autofill_response_group_h *clone);
+
+int rpc_port_list_autofill_response_group_add_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, rpc_port_autofill_response_group_h list_autofill_response_groups);
+
+int rpc_port_list_autofill_response_group_foreach_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h list_autofill_response_groups, void *user_data), void *user_data);
+
+int rpc_port_list_autofill_response_group_remove_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, unsigned int nth);
+
+int rpc_port_list_autofill_response_group_get_list_autofill_response_groups_length(rpc_port_list_autofill_response_group_h h, unsigned int *length);
+
typedef struct list_autofill_response_item_s *rpc_port_list_autofill_response_item_h;
int rpc_port_list_autofill_response_item_create(rpc_port_list_autofill_response_item_h *h);
EXPORT_API int autofill_fill_response_create(autofill_fill_response_h *h)
{
- LOGD("autofill fill response item create");
-
if (!h)
return AUTOFILL_ERROR_INVALID_PARAMETER;
free(h->view_id);
// Release memory autofill fill response item list
- autofill_fill_response_item_h it_h;
- EINA_LIST_FREE(h->autofill_fill_response_item_list, it_h)
- autofill_fill_response_item_destroy(it_h);
+ autofill_fill_response_group_h it_h;
+ EINA_LIST_FREE(h->autofill_fill_response_group_list, it_h)
+ autofill_fill_response_group_destroy(it_h);
free(h);
return AUTOFILL_ERROR_NONE;
}
-EXPORT_API int autofill_fill_response_add_item(autofill_fill_response_h h, autofill_fill_response_item_h it)
+EXPORT_API int autofill_fill_response_add_group(autofill_fill_response_h h, autofill_fill_response_group_h it)
{
if (!h || !it)
return AUTOFILL_ERROR_INVALID_PARAMETER;
- LOGD("autofill fill response item : %p", it);
-
- autofill_fill_response_item_h clone;
- autofill_fill_response_item_clone(it, &clone);
+ autofill_fill_response_group_h clone;
+ autofill_fill_response_group_clone(it, &clone);
if (!clone) {
LOGW("Out of memory");
return AUTOFILL_ERROR_OUT_OF_MEMORY;
}
- h->autofill_fill_response_item_list = eina_list_append(h->autofill_fill_response_item_list, clone);
+ h->autofill_fill_response_group_list = eina_list_append(h->autofill_fill_response_group_list, clone);
return AUTOFILL_ERROR_NONE;
}
-EXPORT_API int autofill_fill_response_foreach_items(autofill_fill_response_h h,
- bool (*callback)(autofill_fill_response_item_h item, void *user_data), void *user_data)
+EXPORT_API int autofill_fill_response_foreach_groups(autofill_fill_response_h h,
+ bool (*callback)(autofill_fill_response_group_h item, void *user_data), void *user_data)
{
if (!h || !callback) {
return AUTOFILL_ERROR_INVALID_PARAMETER;
}
Eina_List *l;
- autofill_fill_response_item_h it;
- EINA_LIST_FOREACH(h->autofill_fill_response_item_list, l, it)
+ autofill_fill_response_group_h it;
+ EINA_LIST_FOREACH(h->autofill_fill_response_group_list, l, it)
{
bool ret = callback(it, user_data);
if (!ret)
return 0;
}
+
+EXPORT_API int autofill_fill_response_get_group_count(autofill_fill_response_h h, int *count)
+{
+ if (!h || !count)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ *count = eina_list_count(h->autofill_fill_response_group_list);
+
+ return AUTOFILL_ERROR_NONE;
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlog.h>
+#include <unistd.h>
+#include "autofill_private.h"
+#include <autofill_common.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AUTOFILL"
+
+EXPORT_API int autofill_fill_response_group_create(autofill_fill_response_group_h *h)
+{
+ if (!h)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ autofill_fill_response_group_h ri = (autofill_fill_response_group_h)calloc(1, sizeof(struct autofill_fill_response_group_s));
+ if (!ri)
+ return AUTOFILL_ERROR_OUT_OF_MEMORY;
+
+ *h = (autofill_fill_response_group_h)ri;
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_fill_response_group_destroy(autofill_fill_response_group_h h)
+{
+ if (!h)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ // Release memory autofill fill response item list
+ autofill_fill_response_item_h it_h;
+ EINA_LIST_FREE(h->autofill_fill_response_item_list, it_h)
+ autofill_fill_response_item_destroy(it_h);
+
+ free(h);
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_fill_response_group_clone(autofill_fill_response_group_h h, autofill_fill_response_group_h *clone)
+{
+ autofill_fill_response_group_h handle;
+
+ if (!h || !clone) {
+ LOGW("Invalid parameter");
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+ }
+
+ autofill_fill_response_group_create(&handle);
+ if (!handle) {
+ LOGW("Failed to create autofill_item handle");
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+ }
+
+ Eina_List *l;
+ autofill_fill_response_item_h it_h;
+ autofill_fill_response_item_h new_it_h;
+ EINA_LIST_FOREACH(h->autofill_fill_response_item_list, l, it_h)
+ {
+ if (!it_h) {
+ LOGW("Can't get response item");
+ autofill_fill_response_group_destroy(handle);
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+ }
+
+ autofill_fill_response_item_clone(it_h, &new_it_h);
+ if (!new_it_h) {
+ LOGW("Failed to duplicate reponse item");
+ autofill_fill_response_group_destroy(handle);
+ return AUTOFILL_ERROR_OPERATION_FAILED;
+ }
+
+ handle->autofill_fill_response_item_list = eina_list_append(handle->autofill_fill_response_item_list, new_it_h);
+ }
+
+ *clone = handle;
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_fill_response_group_add_item(autofill_fill_response_group_h h, autofill_fill_response_item_h it)
+{
+ if (!h || !it)
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+ autofill_fill_response_item_h clone;
+ autofill_fill_response_item_clone(it, &clone);
+ if (!clone) {
+ LOGW("Out of memory");
+ return AUTOFILL_ERROR_OUT_OF_MEMORY;
+ }
+
+ h->autofill_fill_response_item_list = eina_list_append(h->autofill_fill_response_item_list, clone);
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_fill_response_group_foreach_items(autofill_fill_response_group_h h,
+ bool (*callback)(autofill_fill_response_item_h item, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ return AUTOFILL_ERROR_INVALID_PARAMETER;
+ }
+
+ Eina_List *l;
+ autofill_fill_response_item_h it;
+ EINA_LIST_FOREACH(h->autofill_fill_response_item_list, l, it)
+ {
+ bool ret = callback(it, user_data);
+ if (!ret)
+ break;
+ }
+
+ return 0;
+}
typedef struct autofill_auth_info_s *autofill_auth_info_h;
typedef struct autofill_view_info_s *autofill_view_info_h;
typedef struct autofill_fill_response_s *autofill_fill_response_h;
+typedef struct autofill_fill_response_group_s *autofill_fill_response_group_h;
typedef struct autofill_response_item_s *autofill_fill_response_item_h;
typedef struct autofill_save_item_s *autofill_save_item_h;
typedef struct autofill_save_view_info_s *autofill_save_view_info_h;
int autofill_fill_response_get_view_id(autofill_fill_response_h h, char **view_id);
/**
+ * @brief Add autofill fill response group
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_fill_response_add_group(autofill_fill_response_h h, autofill_fill_response_group_h it);
+
+/**
+ * @brief Retrieve all groups of each fill response
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_fill_response_foreach_groups(autofill_fill_response_h h, bool (*callback)(autofill_fill_response_group_h item, void *user_data), void *user_data);
+
+/**
+ * @brief Get the number of fill response group
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_fill_response_get_group_count(autofill_fill_response_h h, int *count);
+
+/**
+ * @brief Create autofill fill response group
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int autofill_fill_response_group_create(autofill_fill_response_group_h *h);
+
+/**
+ * @brief Destroy autofill fill response group
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_fill_response_group_destroy(autofill_fill_response_group_h h);
+
+/**
+ * @brief Clone autofill fill response group
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_fill_response_group_clone(autofill_fill_response_group_h h, autofill_fill_response_group_h *clone);
+
+/**
* @brief Add autofill item
*
* @since_tizen 5.5
*
* @return 0 on success, otherwise a negative error value
* @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
*/
-int autofill_fill_response_add_item(autofill_fill_response_h h, autofill_fill_response_item_h it);
+int autofill_fill_response_group_add_item(autofill_fill_response_group_h h, autofill_fill_response_item_h it);
+
+/**
+ * @brief Retrieve all fill response items of each group
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #AUTOFILL_ERROR_NONE No error
+ */
+int autofill_fill_response_group_foreach_items(autofill_fill_response_group_h h, bool (*callback)(autofill_fill_response_item_h item, void *user_data), void *user_data);
// fill response item
/**
*/
int autofill_fill_response_item_get_presentation_text(autofill_fill_response_item_h it, char ** presentation_text);
-int autofill_fill_response_foreach_items(autofill_fill_response_h h, bool (*callback)(autofill_fill_response_item_h item, void *user_data), void *user_data);
-
// save item
/**
* @brief Create autofill save item
struct autofill_fill_response_s {
char *app_id; // app ID
char *view_id; // view unique ID
+ Eina_List *autofill_fill_response_group_list; // autofill_fill_response_group_h list
+};
+
+struct autofill_fill_response_group_s {
Eina_List *autofill_fill_response_item_list; // autofill_fill_response_item_h list
};
return 0;
}
+struct autofill_svc_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *response_items;
+};
+
+static void __autofill_svc_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __autofill_svc_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_svc_response_item_h value = NULL;
+
+ rpc_port_autofill_svc_response_item_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->response_items = g_list_append(h->response_items, value);
+ }
+ } while (0);
+}
+
+int rpc_port_autofill_svc_response_group_create(rpc_port_autofill_svc_response_group_h *h)
+{
+ struct autofill_svc_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct autofill_svc_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __autofill_svc_response_group_to;
+ handle->parcelable.from = __autofill_svc_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_destroy(rpc_port_autofill_svc_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+ if (value)
+ rpc_port_autofill_svc_response_item_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->response_items);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_clone(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h *clone)
+{
+ rpc_port_autofill_svc_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_autofill_svc_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create autofill_svc_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h new_value;
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_svc_response_item_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->response_items = g_list_append(handle->response_items, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_add_response_items(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_item_h response_items)
+{
+ if (!h || !response_items) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_svc_response_item_h value = NULL;
+
+ rpc_port_autofill_svc_response_item_clone(response_items, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->response_items = g_list_append(h->response_items, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_foreach_response_items(rpc_port_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_remove_response_items(rpc_port_autofill_svc_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->response_items, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+ h->response_items = g_list_remove_link(h->response_items, iter);
+ rpc_port_autofill_svc_response_item_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_get_response_items_length(rpc_port_autofill_svc_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->response_items);
+
+ return 0;
+}
+
struct autofill_svc_fill_response_s {
rpc_port_parcelable_t parcelable;
char *app_id;
char *view_id;
- GList *response_items;
+ GList *response_groups;
};
static void __autofill_svc_fill_response_to(rpc_port_parcel_h parcel, void *data)
rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_groups));
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
rpc_port_parcel_read_array_count(parcel, &len);
for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_response_item_h value = NULL;
+ rpc_port_autofill_svc_response_group_h value = NULL;
- rpc_port_autofill_svc_response_item_create(&value);
+ rpc_port_autofill_svc_response_group_create(&value);
if (!value) {
_E("Failed to create handle");
return;
}
rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
}
} while (0);
}
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
if (value)
- rpc_port_autofill_svc_response_item_destroy(value);
+ rpc_port_autofill_svc_response_group_destroy(value);
iter = g_list_next(iter);
}
- g_list_free(h->response_items);
+ g_list_free(h->response_groups);
} while (0);
free(h);
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h new_value;
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h new_value;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
if (!value) {
_E("Error: value is NULL");
return -1;
}
- rpc_port_autofill_svc_response_item_clone(value, &new_value);
+ rpc_port_autofill_svc_response_group_clone(value, &new_value);
if (!new_value) {
_E("Failed to duplicate value");
rpc_port_autofill_svc_fill_response_destroy(handle);
return -1;
}
- handle->response_items = g_list_append(handle->response_items, new_value);
+ handle->response_groups = g_list_append(handle->response_groups, new_value);
iter = g_list_next(iter);
}
} while (0);
return 0;
}
-int rpc_port_autofill_svc_fill_response_add_response_items(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_item_h response_items)
+int rpc_port_autofill_svc_fill_response_add_response_groups(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_group_h response_groups)
{
- if (!h || !response_items) {
+ if (!h || !response_groups) {
_E("Invalid parameter");
return -1;
}
do {
- rpc_port_autofill_svc_response_item_h value = NULL;
+ rpc_port_autofill_svc_response_group_h value = NULL;
- rpc_port_autofill_svc_response_item_clone(response_items, &value);
+ rpc_port_autofill_svc_response_group_clone(response_groups, &value);
if (!value) {
_E("Out of memory");
return -1;
}
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
} while (0);
return 0;
return 0;
}
-int rpc_port_autofill_svc_fill_response_foreach_response_items(rpc_port_autofill_svc_fill_response_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data)
+int rpc_port_autofill_svc_fill_response_foreach_response_groups(rpc_port_autofill_svc_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h response_groups, void *user_data), void *user_data)
{
if (!h || !callback) {
_E("Invalid parameter");
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
return 0;
}
-int rpc_port_autofill_svc_fill_response_remove_response_items(rpc_port_autofill_svc_fill_response_h h, unsigned int nth)
+int rpc_port_autofill_svc_fill_response_remove_response_groups(rpc_port_autofill_svc_fill_response_h h, unsigned int nth)
{
GList *iter;
return -1;
}
- iter = g_list_nth(h->response_items, nth);
+ iter = g_list_nth(h->response_groups, nth);
if (iter == NULL)
return -1;
- rpc_port_autofill_svc_response_item_h value = iter->data;
- h->response_items = g_list_remove_link(h->response_items, iter);
- rpc_port_autofill_svc_response_item_destroy(value);
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+ h->response_groups = g_list_remove_link(h->response_groups, iter);
+ rpc_port_autofill_svc_response_group_destroy(value);
g_list_free(iter);
return 0;
}
-int rpc_port_autofill_svc_fill_response_get_response_items_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length)
+int rpc_port_autofill_svc_fill_response_get_response_groups_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length)
{
if (!h || !length) {
_E("Invalid parameter");
return -1;
}
- *length = g_list_length(h->response_items);
+ *length = g_list_length(h->response_groups);
return 0;
}
return 0;
}
+struct list_autofill_svc_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *list_autofill_svc_response_groups;
+};
+
+static void __list_autofill_svc_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_svc_response_groups));
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __list_autofill_svc_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_svc_response_group_h value = NULL;
+
+ rpc_port_autofill_svc_response_group_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->list_autofill_svc_response_groups = g_list_append(h->list_autofill_svc_response_groups, value);
+ }
+ } while (0);
+}
+
+int rpc_port_list_autofill_svc_response_group_create(rpc_port_list_autofill_svc_response_group_h *h)
+{
+ struct list_autofill_svc_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct list_autofill_svc_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __list_autofill_svc_response_group_to;
+ handle->parcelable.from = __list_autofill_svc_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_destroy(rpc_port_list_autofill_svc_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+ if (value)
+ rpc_port_autofill_svc_response_group_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->list_autofill_svc_response_groups);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_clone(rpc_port_list_autofill_svc_response_group_h h, rpc_port_list_autofill_svc_response_group_h *clone)
+{
+ rpc_port_list_autofill_svc_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_list_autofill_svc_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create list_autofill_svc_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h new_value;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_list_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_svc_response_group_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_list_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->list_autofill_svc_response_groups = g_list_append(handle->list_autofill_svc_response_groups, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_add_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups)
+{
+ if (!h || !list_autofill_svc_response_groups) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_svc_response_group_h value = NULL;
+
+ rpc_port_autofill_svc_response_group_clone(list_autofill_svc_response_groups, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->list_autofill_svc_response_groups = g_list_append(h->list_autofill_svc_response_groups, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_foreach_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_remove_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->list_autofill_svc_response_groups, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+ h->list_autofill_svc_response_groups = g_list_remove_link(h->list_autofill_svc_response_groups, iter);
+ rpc_port_autofill_svc_response_group_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_get_list_autofill_svc_response_groups_length(rpc_port_list_autofill_svc_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->list_autofill_svc_response_groups);
+
+ return 0;
+}
+
struct list_autofill_svc_response_item_s {
rpc_port_parcelable_t parcelable;
GList *list_autofill_svc_response_items;
int rpc_port_autofill_svc_response_item_get_value(rpc_port_autofill_svc_response_item_h h, char **value);
+typedef struct autofill_svc_response_group_s *rpc_port_autofill_svc_response_group_h;
+
+int rpc_port_autofill_svc_response_group_create(rpc_port_autofill_svc_response_group_h *h);
+
+int rpc_port_autofill_svc_response_group_destroy(rpc_port_autofill_svc_response_group_h h);
+
+int rpc_port_autofill_svc_response_group_clone(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h *clone);
+
+int rpc_port_autofill_svc_response_group_add_response_items(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_item_h response_items);
+
+int rpc_port_autofill_svc_response_group_foreach_response_items(rpc_port_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data);
+
+int rpc_port_autofill_svc_response_group_remove_response_items(rpc_port_autofill_svc_response_group_h h, unsigned int nth);
+
+int rpc_port_autofill_svc_response_group_get_response_items_length(rpc_port_autofill_svc_response_group_h h, unsigned int *length);
+
typedef struct autofill_svc_fill_response_s *rpc_port_autofill_svc_fill_response_h;
int rpc_port_autofill_svc_fill_response_create(rpc_port_autofill_svc_fill_response_h *h);
int rpc_port_autofill_svc_fill_response_set_view_id(rpc_port_autofill_svc_fill_response_h h, const char *view_id);
-int rpc_port_autofill_svc_fill_response_add_response_items(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_item_h response_items);
+int rpc_port_autofill_svc_fill_response_add_response_groups(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_group_h response_groups);
int rpc_port_autofill_svc_fill_response_get_app_id(rpc_port_autofill_svc_fill_response_h h, char **app_id);
int rpc_port_autofill_svc_fill_response_get_view_id(rpc_port_autofill_svc_fill_response_h h, char **view_id);
-int rpc_port_autofill_svc_fill_response_foreach_response_items(rpc_port_autofill_svc_fill_response_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data);
+int rpc_port_autofill_svc_fill_response_foreach_response_groups(rpc_port_autofill_svc_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h response_groups, void *user_data), void *user_data);
-int rpc_port_autofill_svc_fill_response_remove_response_items(rpc_port_autofill_svc_fill_response_h h, unsigned int nth);
+int rpc_port_autofill_svc_fill_response_remove_response_groups(rpc_port_autofill_svc_fill_response_h h, unsigned int nth);
-int rpc_port_autofill_svc_fill_response_get_response_items_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length);
+int rpc_port_autofill_svc_fill_response_get_response_groups_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length);
typedef struct list_autofill_svc_item_s *rpc_port_list_autofill_svc_item_h;
int rpc_port_list_autofill_svc_item_get_list_autofill_svc_items_length(rpc_port_list_autofill_svc_item_h h, unsigned int *length);
+typedef struct list_autofill_svc_response_group_s *rpc_port_list_autofill_svc_response_group_h;
+
+int rpc_port_list_autofill_svc_response_group_create(rpc_port_list_autofill_svc_response_group_h *h);
+
+int rpc_port_list_autofill_svc_response_group_destroy(rpc_port_list_autofill_svc_response_group_h h);
+
+int rpc_port_list_autofill_svc_response_group_clone(rpc_port_list_autofill_svc_response_group_h h, rpc_port_list_autofill_svc_response_group_h *clone);
+
+int rpc_port_list_autofill_svc_response_group_add_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups);
+
+int rpc_port_list_autofill_svc_response_group_foreach_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups, void *user_data), void *user_data);
+
+int rpc_port_list_autofill_svc_response_group_remove_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, unsigned int nth);
+
+int rpc_port_list_autofill_svc_response_group_get_list_autofill_svc_response_groups_length(rpc_port_list_autofill_svc_response_group_h h, unsigned int *length);
+
typedef struct list_autofill_svc_response_item_s *rpc_port_list_autofill_svc_response_item_h;
int rpc_port_list_autofill_svc_response_item_create(rpc_port_list_autofill_svc_response_item_h *h);
return 0;
}
+struct autofill_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *response_items;
+};
+
+static void __autofill_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __autofill_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_response_item_h value = NULL;
+
+ rpc_port_autofill_response_item_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->response_items = g_list_append(h->response_items, value);
+ }
+ } while (0);
+}
+
+int rpc_port_autofill_response_group_create(rpc_port_autofill_response_group_h *h)
+{
+ struct autofill_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct autofill_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __autofill_response_group_to;
+ handle->parcelable.from = __autofill_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_destroy(rpc_port_autofill_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h value = iter->data;
+ if (value)
+ rpc_port_autofill_response_item_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->response_items);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_clone(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_group_h *clone)
+{
+ rpc_port_autofill_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_autofill_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create autofill_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h new_value;
+ rpc_port_autofill_response_item_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_response_item_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->response_items = g_list_append(handle->response_items, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_add_response_items(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_item_h response_items)
+{
+ if (!h || !response_items) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_response_item_h value = NULL;
+
+ rpc_port_autofill_response_item_clone(response_items, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->response_items = g_list_append(h->response_items, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_foreach_response_items(rpc_port_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_remove_response_items(rpc_port_autofill_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->response_items, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_response_item_h value = iter->data;
+ h->response_items = g_list_remove_link(h->response_items, iter);
+ rpc_port_autofill_response_item_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_autofill_response_group_get_response_items_length(rpc_port_autofill_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->response_items);
+
+ return 0;
+}
+
struct autofill_fill_response_s {
rpc_port_parcelable_t parcelable;
char *view_id;
- GList *response_items;
+ GList *response_groups;
};
static void __autofill_fill_response_to(rpc_port_parcel_h parcel, void *data)
}
rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_groups));
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
rpc_port_parcel_read_array_count(parcel, &len);
for (int i = 0; i < len; i++) {
- rpc_port_autofill_response_item_h value = NULL;
+ rpc_port_autofill_response_group_h value = NULL;
- rpc_port_autofill_response_item_create(&value);
+ rpc_port_autofill_response_group_create(&value);
if (!value) {
_E("Failed to create handle");
return;
}
rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
}
} while (0);
}
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h value = iter->data;
if (value)
- rpc_port_autofill_response_item_destroy(value);
+ rpc_port_autofill_response_group_destroy(value);
iter = g_list_next(iter);
}
- g_list_free(h->response_items);
+ g_list_free(h->response_groups);
} while (0);
free(h);
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h new_value;
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h new_value;
+ rpc_port_autofill_response_group_h value = iter->data;
if (!value) {
_E("Error: value is NULL");
return -1;
}
- rpc_port_autofill_response_item_clone(value, &new_value);
+ rpc_port_autofill_response_group_clone(value, &new_value);
if (!new_value) {
_E("Failed to duplicate value");
rpc_port_autofill_fill_response_destroy(handle);
return -1;
}
- handle->response_items = g_list_append(handle->response_items, new_value);
+ handle->response_groups = g_list_append(handle->response_groups, new_value);
iter = g_list_next(iter);
}
} while (0);
return 0;
}
-int rpc_port_autofill_fill_response_add_response_items(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_item_h response_items)
+int rpc_port_autofill_fill_response_add_response_groups(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_group_h response_groups)
{
- if (!h || !response_items) {
+ if (!h || !response_groups) {
_E("Invalid parameter");
return -1;
}
do {
- rpc_port_autofill_response_item_h value = NULL;
+ rpc_port_autofill_response_group_h value = NULL;
- rpc_port_autofill_response_item_clone(response_items, &value);
+ rpc_port_autofill_response_group_clone(response_groups, &value);
if (!value) {
_E("Out of memory");
return -1;
}
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
} while (0);
return 0;
return 0;
}
-int rpc_port_autofill_fill_response_foreach_response_items(rpc_port_autofill_fill_response_h h,
- bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data)
+int rpc_port_autofill_fill_response_foreach_response_groups(rpc_port_autofill_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h response_groups, void *user_data), void *user_data)
{
if (!h || !callback) {
_E("Invalid parameter");
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_response_item_h value = iter->data;
+ rpc_port_autofill_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
return 0;
}
-int rpc_port_autofill_fill_response_remove_response_items(rpc_port_autofill_fill_response_h h, unsigned int nth)
+int rpc_port_autofill_fill_response_remove_response_groups(rpc_port_autofill_fill_response_h h, unsigned int nth)
{
GList *iter;
return -1;
}
- iter = g_list_nth(h->response_items, nth);
+ iter = g_list_nth(h->response_groups, nth);
if (iter == NULL)
return -1;
- rpc_port_autofill_response_item_h value = iter->data;
- h->response_items = g_list_remove_link(h->response_items, iter);
- rpc_port_autofill_response_item_destroy(value);
+ rpc_port_autofill_response_group_h value = iter->data;
+ h->response_groups = g_list_remove_link(h->response_groups, iter);
+ rpc_port_autofill_response_group_destroy(value);
g_list_free(iter);
return 0;
}
-int rpc_port_autofill_fill_response_get_response_items_length(rpc_port_autofill_fill_response_h h, unsigned int *length)
+int rpc_port_autofill_fill_response_get_response_groups_length(rpc_port_autofill_fill_response_h h, unsigned int *length)
{
if (!h || !length) {
_E("Invalid parameter");
return -1;
}
- *length = g_list_length(h->response_items);
+ *length = g_list_length(h->response_groups);
return 0;
}
return 0;
}
+struct list_autofill_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *list_autofill_response_groups;
+};
+
+static void __list_autofill_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_response_groups));
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __list_autofill_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_response_group_h value = NULL;
+
+ rpc_port_autofill_response_group_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->list_autofill_response_groups = g_list_append(h->list_autofill_response_groups, value);
+ }
+ } while (0);
+}
+
+int rpc_port_list_autofill_response_group_create(rpc_port_list_autofill_response_group_h *h)
+{
+ struct list_autofill_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct list_autofill_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __list_autofill_response_group_to;
+ handle->parcelable.from = __list_autofill_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_destroy(rpc_port_list_autofill_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h value = iter->data;
+ if (value)
+ rpc_port_autofill_response_group_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->list_autofill_response_groups);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_clone(rpc_port_list_autofill_response_group_h h, rpc_port_list_autofill_response_group_h *clone)
+{
+ rpc_port_list_autofill_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_list_autofill_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create list_autofill_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h new_value;
+ rpc_port_autofill_response_group_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_list_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_response_group_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_list_autofill_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->list_autofill_response_groups = g_list_append(handle->list_autofill_response_groups, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_add_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, rpc_port_autofill_response_group_h list_autofill_response_groups)
+{
+ if (!h || !list_autofill_response_groups) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_response_group_h value = NULL;
+
+ rpc_port_autofill_response_group_clone(list_autofill_response_groups, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->list_autofill_response_groups = g_list_append(h->list_autofill_response_groups, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_foreach_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h list_autofill_response_groups, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_response_groups;
+ while (iter) {
+ rpc_port_autofill_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_remove_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->list_autofill_response_groups, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_response_group_h value = iter->data;
+ h->list_autofill_response_groups = g_list_remove_link(h->list_autofill_response_groups, iter);
+ rpc_port_autofill_response_group_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_response_group_get_list_autofill_response_groups_length(rpc_port_list_autofill_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->list_autofill_response_groups);
+
+ return 0;
+}
+
struct list_autofill_response_item_s {
rpc_port_parcelable_t parcelable;
GList *list_autofill_response_items;
int rpc_port_autofill_response_item_get_value(rpc_port_autofill_response_item_h h, char **value);
+typedef struct autofill_response_group_s *rpc_port_autofill_response_group_h;
+
+int rpc_port_autofill_response_group_create(rpc_port_autofill_response_group_h *h);
+
+int rpc_port_autofill_response_group_destroy(rpc_port_autofill_response_group_h h);
+
+int rpc_port_autofill_response_group_clone(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_group_h *clone);
+
+int rpc_port_autofill_response_group_add_response_items(rpc_port_autofill_response_group_h h, rpc_port_autofill_response_item_h response_items);
+
+int rpc_port_autofill_response_group_foreach_response_items(rpc_port_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data);
+
+int rpc_port_autofill_response_group_remove_response_items(rpc_port_autofill_response_group_h h, unsigned int nth);
+
+int rpc_port_autofill_response_group_get_response_items_length(rpc_port_autofill_response_group_h h, unsigned int *length);
+
typedef struct autofill_fill_response_s *rpc_port_autofill_fill_response_h;
int rpc_port_autofill_fill_response_create(rpc_port_autofill_fill_response_h *h);
int rpc_port_autofill_fill_response_set_view_id(rpc_port_autofill_fill_response_h h, const char *view_id);
-int rpc_port_autofill_fill_response_add_response_items(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_item_h response_items);
+int rpc_port_autofill_fill_response_add_response_groups(rpc_port_autofill_fill_response_h h, rpc_port_autofill_response_group_h response_groups);
int rpc_port_autofill_fill_response_get_view_id(rpc_port_autofill_fill_response_h h, char **view_id);
-int rpc_port_autofill_fill_response_foreach_response_items(rpc_port_autofill_fill_response_h h,
- bool (*callback)(rpc_port_autofill_response_item_h response_items, void *user_data), void *user_data);
+int rpc_port_autofill_fill_response_foreach_response_groups(rpc_port_autofill_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h response_groups, void *user_data), void *user_data);
-int rpc_port_autofill_fill_response_remove_response_items(rpc_port_autofill_fill_response_h h, unsigned int nth);
+int rpc_port_autofill_fill_response_remove_response_groups(rpc_port_autofill_fill_response_h h, unsigned int nth);
-int rpc_port_autofill_fill_response_get_response_items_length(rpc_port_autofill_fill_response_h h, unsigned int *length);
+int rpc_port_autofill_fill_response_get_response_groups_length(rpc_port_autofill_fill_response_h h, unsigned int *length);
typedef struct list_autofill_item_s *rpc_port_list_autofill_item_h;
int rpc_port_list_autofill_item_get_list_autofill_items_length(rpc_port_list_autofill_item_h h, unsigned int *length);
+typedef struct list_autofill_response_group_s *rpc_port_list_autofill_response_group_h;
+
+int rpc_port_list_autofill_response_group_create(rpc_port_list_autofill_response_group_h *h);
+
+int rpc_port_list_autofill_response_group_destroy(rpc_port_list_autofill_response_group_h h);
+
+int rpc_port_list_autofill_response_group_clone(rpc_port_list_autofill_response_group_h h, rpc_port_list_autofill_response_group_h *clone);
+
+int rpc_port_list_autofill_response_group_add_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, rpc_port_autofill_response_group_h list_autofill_response_groups);
+
+int rpc_port_list_autofill_response_group_foreach_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h,
+ bool (*callback)(rpc_port_autofill_response_group_h list_autofill_response_groups, void *user_data), void *user_data);
+
+int rpc_port_list_autofill_response_group_remove_list_autofill_response_groups(rpc_port_list_autofill_response_group_h h, unsigned int nth);
+
+int rpc_port_list_autofill_response_group_get_list_autofill_response_groups_length(rpc_port_list_autofill_response_group_h h, unsigned int *length);
+
typedef struct list_autofill_response_item_s *rpc_port_list_autofill_response_item_h;
int rpc_port_list_autofill_response_item_create(rpc_port_list_autofill_response_item_h *h);
bool fill_response_item_cb(rpc_port_autofill_svc_response_item_h response_items, void *user_data)
{
- //autofill_fill_response_s *fill_response = (autofill_fill_response_s *)user_data;
-
- rpc_port_autofill_fill_response_h svi = (rpc_port_autofill_fill_response_h)user_data;
+ rpc_port_autofill_response_group_h res_group = (rpc_port_autofill_response_group_h)user_data;
char *id = NULL;
char *presentation_text = NULL;
LOGD("id : %s, presentation text : %s, value : %s", id, presentation_text, value);
- rpc_port_autofill_fill_response_add_response_items(svi, res_item);
+ rpc_port_autofill_response_group_add_response_items(res_group, res_item);
if (id)
free(id);
return true;
}
+bool fill_response_group_cb(rpc_port_autofill_svc_response_group_h response_groups, void *user_data)
+{
+ rpc_port_autofill_fill_response_h fr_h = (rpc_port_autofill_fill_response_h)user_data;
+
+ rpc_port_autofill_response_group_h res_group;
+ rpc_port_autofill_response_group_create(&res_group);
+
+ rpc_port_autofill_svc_response_group_foreach_response_items(response_groups, fill_response_item_cb, res_group);
+
+ rpc_port_autofill_fill_response_add_response_groups(fr_h, res_group);
+
+ rpc_port_autofill_response_group_destroy(res_group);
+
+ return true;
+}
+
static void __fill_response_recv_cb(void *user_data, rpc_port_autofill_svc_fill_response_h response_h)
{
// recv fill response from service
rpc_port_autofill_fill_response_create(&fill_response_h);
rpc_port_autofill_fill_response_set_view_id(fill_response_h, view_id);
- rpc_port_autofill_svc_fill_response_foreach_response_items(response_h, fill_response_item_cb, fill_response_h);
+ rpc_port_autofill_svc_fill_response_foreach_response_groups(response_h, fill_response_group_cb, fill_response_h);
autofill_client_s *sender_client = get_autofill_client(app_id);
if (sender_client)
if (view_id)
free(view_id);
+ autofill_fill_response_group_h res_group_h[2];
autofill_fill_response_item_h ritem_h[2];
+ /* group 1 */
+ autofill_fill_response_group_create(&res_group_h[0]);
+
/* item 1 */
autofill_fill_response_item_create(&ritem_h[0]);
autofill_fill_response_item_set_id(ritem_h[0], "id");
autofill_fill_response_item_set_presentation_text(ritem_h[0], "Input ID");
- autofill_fill_response_item_set_value(ritem_h[0], "tester");
+ autofill_fill_response_item_set_value(ritem_h[0], "tester1");
- autofill_fill_response_add_item(fill_response, ritem_h[0]);
+ autofill_fill_response_group_add_item(res_group_h[0], ritem_h[0]);
/* item 2 */
autofill_fill_response_item_create(&ritem_h[1]);
autofill_fill_response_item_set_id(ritem_h[1], "password");
autofill_fill_response_item_set_presentation_text(ritem_h[1], "Input Password");
- autofill_fill_response_item_set_value(ritem_h[1], "testerpw");
+ autofill_fill_response_item_set_value(ritem_h[1], "testerpw1");
- autofill_fill_response_add_item(fill_response, ritem_h[1]);
+ autofill_fill_response_group_add_item(res_group_h[0], ritem_h[1]);
- autofill_service_send_fill_response(fill_response);
+ autofill_fill_response_item_destroy(ritem_h[0]);
+ autofill_fill_response_item_destroy(ritem_h[1]);
+
+ autofill_fill_response_add_group(fill_response, res_group_h[0]);
+
+ autofill_fill_response_group_destroy(res_group_h[0]);
+
+ /* group 2 */
+ autofill_fill_response_group_create(&res_group_h[1]);
+
+ /* item 1 */
+ autofill_fill_response_item_create(&ritem_h[0]);
+ autofill_fill_response_item_set_id(ritem_h[0], "id");
+ autofill_fill_response_item_set_presentation_text(ritem_h[0], "Input ID");
+ autofill_fill_response_item_set_value(ritem_h[0], "tester2");
+
+ autofill_fill_response_group_add_item(res_group_h[0], ritem_h[0]);
+
+ /* item 2 */
+ autofill_fill_response_item_create(&ritem_h[1]);
+ autofill_fill_response_item_set_id(ritem_h[1], "password");
+ autofill_fill_response_item_set_presentation_text(ritem_h[1], "Input Password");
+ autofill_fill_response_item_set_value(ritem_h[1], "testerpw2");
+
+ autofill_fill_response_group_add_item(res_group_h[0], ritem_h[1]);
autofill_fill_response_item_destroy(ritem_h[0]);
autofill_fill_response_item_destroy(ritem_h[1]);
+ autofill_fill_response_add_group(fill_response, res_group_h[1]);
+
+ autofill_fill_response_group_destroy(res_group_h[1]);
+
+ /* Send fill response */
+ autofill_service_send_fill_response(fill_response);
+
autofill_fill_response_destroy(fill_response);
}
rpc_port_autofill_svc_view_info_get_app_id(vi, &app_id);
rpc_port_autofill_svc_view_info_get_view_id(vi, &view_id);
- LOGD("app id ; %s, view id : %s", app_id, view_id);
+ LOGD("app id : %s, view id : %s", app_id, view_id);
autofill_view_info_h view_info;
autofill_view_info_create(&view_info);
return AUTOFILL_ERROR_NONE;
}
-EXPORT_API int autofill_service_send_fill_response(autofill_fill_response_h h)
+bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data)
{
- /* create autofill response */
- rpc_port_autofill_svc_fill_response_h fill_response_h;
char *id = NULL;
char *value = NULL;
char *presentation_text = NULL;
+ rpc_port_autofill_svc_response_group_h res_group_h = (rpc_port_autofill_svc_response_group_h)user_data;
+
+ rpc_port_autofill_svc_response_item_h ritem_h;
+
+ autofill_fill_response_item_get_id(it, &id);
+ autofill_fill_response_item_get_value(it, &value);
+ autofill_fill_response_item_get_presentation_text(it, &presentation_text);
+
+ LOGD("it : %p, id : %s, value : %s, presentation text : %s", it, id, value, presentation_text);
+
+ rpc_port_autofill_svc_response_item_create(&ritem_h);
+ rpc_port_autofill_svc_response_item_set_id(ritem_h, id);
+ rpc_port_autofill_svc_response_item_set_presentation_text(ritem_h, presentation_text);
+ rpc_port_autofill_svc_response_item_set_value(ritem_h, value);
+
+ rpc_port_autofill_svc_response_group_add_response_items(res_group_h, ritem_h);
+
+ if (id) {
+ free(id);
+ id = NULL;
+ }
+
+ if (value) {
+ free(value);
+ value = NULL;
+ }
+
+ if (presentation_text) {
+ free(presentation_text);
+ presentation_text= NULL;
+ }
+
+ rpc_port_autofill_svc_response_item_destroy(ritem_h);
+
+ return true;
+}
+
+EXPORT_API int autofill_service_send_fill_response(autofill_fill_response_h h)
+{
+ /* create autofill response */
+ rpc_port_autofill_svc_fill_response_h fill_response_h;
+
Eina_List *l;
- autofill_fill_response_item_h it;
+ autofill_fill_response_group_h it;
if (!h) {
LOGW("parameter is NULL");
if (h->view_id)
rpc_port_autofill_svc_fill_response_set_view_id(fill_response_h, h->view_id);
- rpc_port_autofill_svc_response_item_h ritem_h;
+ rpc_port_autofill_svc_response_group_h res_group_h;
- int i = 0, count = 0;
- EINA_LIST_FOREACH(h->autofill_fill_response_item_list, l, it)
+ EINA_LIST_FOREACH(h->autofill_fill_response_group_list, l, it)
{
- autofill_fill_response_item_get_id(it, &id);
- autofill_fill_response_item_get_value(it, &value);
- autofill_fill_response_item_get_presentation_text(it, &presentation_text);
-
- LOGD("it : %p, id : %s, value : %s, presentation text : %s", it, id, value, presentation_text);
-
- rpc_port_autofill_svc_response_item_create(&ritem_h);
- rpc_port_autofill_svc_response_item_set_id(ritem_h, id);
- rpc_port_autofill_svc_response_item_set_presentation_text(ritem_h, presentation_text);
- rpc_port_autofill_svc_response_item_set_value(ritem_h, value);
-
- rpc_port_autofill_svc_fill_response_add_response_items(fill_response_h, ritem_h);
-
- if (id) {
- free(id);
- id = NULL;
- }
-
- if (value) {
- free(value);
- value = NULL;
- }
+ rpc_port_autofill_svc_response_group_create(&res_group_h);
- if (presentation_text) {
- free(presentation_text);
- presentation_text= NULL;
- }
+ autofill_fill_response_group_foreach_items(it, __fill_response_item_cb, res_group_h);
- rpc_port_autofill_svc_response_item_destroy(ritem_h);
+ rpc_port_autofill_svc_fill_response_add_response_groups(fill_response_h, res_group_h);
- count++;
- i++;
+ rpc_port_autofill_svc_response_group_destroy(res_group_h);
}
rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_invoke(g_fill_response_cb, fill_response_h);
return 0;
}
+struct autofill_svc_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *response_items;
+};
+
+static void __autofill_svc_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __autofill_svc_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_svc_response_item_h value = NULL;
+
+ rpc_port_autofill_svc_response_item_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->response_items = g_list_append(h->response_items, value);
+ }
+ } while (0);
+}
+
+int rpc_port_autofill_svc_response_group_create(rpc_port_autofill_svc_response_group_h *h)
+{
+ struct autofill_svc_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct autofill_svc_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __autofill_svc_response_group_to;
+ handle->parcelable.from = __autofill_svc_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_destroy(rpc_port_autofill_svc_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+ if (value)
+ rpc_port_autofill_svc_response_item_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->response_items);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_clone(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h *clone)
+{
+ rpc_port_autofill_svc_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_autofill_svc_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create autofill_svc_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h new_value;
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_svc_response_item_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->response_items = g_list_append(handle->response_items, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_add_response_items(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_item_h response_items)
+{
+ if (!h || !response_items) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_svc_response_item_h value = NULL;
+
+ rpc_port_autofill_svc_response_item_clone(response_items, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->response_items = g_list_append(h->response_items, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_foreach_response_items(rpc_port_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->response_items;
+ while (iter) {
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_remove_response_items(rpc_port_autofill_svc_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->response_items, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_svc_response_item_h value = iter->data;
+ h->response_items = g_list_remove_link(h->response_items, iter);
+ rpc_port_autofill_svc_response_item_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_autofill_svc_response_group_get_response_items_length(rpc_port_autofill_svc_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->response_items);
+
+ return 0;
+}
+
struct autofill_svc_fill_response_s {
rpc_port_parcelable_t parcelable;
char *app_id;
char *view_id;
- GList *response_items;
+ GList *response_groups;
};
static void __autofill_svc_fill_response_to(rpc_port_parcel_h parcel, void *data)
rpc_port_parcel_write_string(parcel, h->app_id ? h->app_id : "");
rpc_port_parcel_write_string(parcel, h->view_id ? h->view_id : "");
- rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_items));
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->response_groups));
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
rpc_port_parcel_read_array_count(parcel, &len);
for (int i = 0; i < len; i++) {
- rpc_port_autofill_svc_response_item_h value = NULL;
+ rpc_port_autofill_svc_response_group_h value = NULL;
- rpc_port_autofill_svc_response_item_create(&value);
+ rpc_port_autofill_svc_response_group_create(&value);
if (!value) {
_E("Failed to create handle");
return;
}
rpc_port_parcel_read(parcel, &value->parcelable, value);
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
}
} while (0);
}
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
if (value)
- rpc_port_autofill_svc_response_item_destroy(value);
+ rpc_port_autofill_svc_response_group_destroy(value);
iter = g_list_next(iter);
}
- g_list_free(h->response_items);
+ g_list_free(h->response_groups);
} while (0);
free(h);
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h new_value;
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h new_value;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
if (!value) {
_E("Error: value is NULL");
return -1;
}
- rpc_port_autofill_svc_response_item_clone(value, &new_value);
+ rpc_port_autofill_svc_response_group_clone(value, &new_value);
if (!new_value) {
_E("Failed to duplicate value");
rpc_port_autofill_svc_fill_response_destroy(handle);
return -1;
}
- handle->response_items = g_list_append(handle->response_items, new_value);
+ handle->response_groups = g_list_append(handle->response_groups, new_value);
iter = g_list_next(iter);
}
} while (0);
return 0;
}
-int rpc_port_autofill_svc_fill_response_add_response_items(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_item_h response_items)
+int rpc_port_autofill_svc_fill_response_add_response_groups(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_group_h response_groups)
{
- if (!h || !response_items) {
+ if (!h || !response_groups) {
_E("Invalid parameter");
return -1;
}
do {
- rpc_port_autofill_svc_response_item_h value = NULL;
+ rpc_port_autofill_svc_response_group_h value = NULL;
- rpc_port_autofill_svc_response_item_clone(response_items, &value);
+ rpc_port_autofill_svc_response_group_clone(response_groups, &value);
if (!value) {
_E("Out of memory");
return -1;
}
- h->response_items = g_list_append(h->response_items, value);
+ h->response_groups = g_list_append(h->response_groups, value);
} while (0);
return 0;
return 0;
}
-int rpc_port_autofill_svc_fill_response_foreach_response_items(rpc_port_autofill_svc_fill_response_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data)
+int rpc_port_autofill_svc_fill_response_foreach_response_groups(rpc_port_autofill_svc_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h response_groups, void *user_data), void *user_data)
{
if (!h || !callback) {
_E("Invalid parameter");
do {
GList *iter;
- iter = h->response_items;
+ iter = h->response_groups;
while (iter) {
- rpc_port_autofill_svc_response_item_h value = iter->data;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
iter = g_list_next(iter);
if (!value) {
return 0;
}
-int rpc_port_autofill_svc_fill_response_remove_response_items(rpc_port_autofill_svc_fill_response_h h, unsigned int nth)
+int rpc_port_autofill_svc_fill_response_remove_response_groups(rpc_port_autofill_svc_fill_response_h h, unsigned int nth)
{
GList *iter;
return -1;
}
- iter = g_list_nth(h->response_items, nth);
+ iter = g_list_nth(h->response_groups, nth);
if (iter == NULL)
return -1;
- rpc_port_autofill_svc_response_item_h value = iter->data;
- h->response_items = g_list_remove_link(h->response_items, iter);
- rpc_port_autofill_svc_response_item_destroy(value);
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+ h->response_groups = g_list_remove_link(h->response_groups, iter);
+ rpc_port_autofill_svc_response_group_destroy(value);
g_list_free(iter);
return 0;
}
-int rpc_port_autofill_svc_fill_response_get_response_items_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length)
+int rpc_port_autofill_svc_fill_response_get_response_groups_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length)
{
if (!h || !length) {
_E("Invalid parameter");
return -1;
}
- *length = g_list_length(h->response_items);
+ *length = g_list_length(h->response_groups);
return 0;
}
return 0;
}
+struct list_autofill_svc_response_group_s {
+ rpc_port_parcelable_t parcelable;
+ GList *list_autofill_svc_response_groups;
+};
+
+static void __list_autofill_svc_response_group_to(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ rpc_port_parcel_write_array_count(parcel, g_list_length(h->list_autofill_svc_response_groups));
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+ rpc_port_parcel_write(parcel, &value->parcelable, value);
+ }
+ } while (0);
+}
+
+static void __list_autofill_svc_response_group_from(rpc_port_parcel_h parcel, void *data)
+{
+ rpc_port_list_autofill_svc_response_group_h h = data;
+
+ if (!parcel || !h) {
+ _E("Invalid parameter");
+ return;
+ }
+
+ do {
+ int len = 0;
+
+ rpc_port_parcel_read_array_count(parcel, &len);
+ for (int i = 0; i < len; i++) {
+ rpc_port_autofill_svc_response_group_h value = NULL;
+
+ rpc_port_autofill_svc_response_group_create(&value);
+ if (!value) {
+ _E("Failed to create handle");
+ return;
+ }
+
+ rpc_port_parcel_read(parcel, &value->parcelable, value);
+ h->list_autofill_svc_response_groups = g_list_append(h->list_autofill_svc_response_groups, value);
+ }
+ } while (0);
+}
+
+int rpc_port_list_autofill_svc_response_group_create(rpc_port_list_autofill_svc_response_group_h *h)
+{
+ struct list_autofill_svc_response_group_s *handle;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ handle = calloc(1, sizeof(struct list_autofill_svc_response_group_s));
+ if (!handle) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ handle->parcelable.to = __list_autofill_svc_response_group_to;
+ handle->parcelable.from = __list_autofill_svc_response_group_from;
+
+ *h = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_destroy(rpc_port_list_autofill_svc_response_group_h h)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+ if (value)
+ rpc_port_autofill_svc_response_group_destroy(value);
+
+ iter = g_list_next(iter);
+ }
+ g_list_free(h->list_autofill_svc_response_groups);
+ } while (0);
+
+ free(h);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_clone(rpc_port_list_autofill_svc_response_group_h h, rpc_port_list_autofill_svc_response_group_h *clone)
+{
+ rpc_port_list_autofill_svc_response_group_h handle = NULL;
+
+ if (!h || !clone) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ rpc_port_list_autofill_svc_response_group_create(&handle);
+ if (!handle) {
+ _E("Failed to create list_autofill_svc_response_group handle");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h new_value;
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+
+ if (!value) {
+ _E("Error: value is NULL");
+ rpc_port_list_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ rpc_port_autofill_svc_response_group_clone(value, &new_value);
+ if (!new_value) {
+ _E("Failed to duplicate value");
+ rpc_port_list_autofill_svc_response_group_destroy(handle);
+ return -1;
+ }
+
+ handle->list_autofill_svc_response_groups = g_list_append(handle->list_autofill_svc_response_groups, new_value);
+ iter = g_list_next(iter);
+ }
+ } while (0);
+
+ *clone = handle;
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_add_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups)
+{
+ if (!h || !list_autofill_svc_response_groups) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ rpc_port_autofill_svc_response_group_h value = NULL;
+
+ rpc_port_autofill_svc_response_group_clone(list_autofill_svc_response_groups, &value);
+ if (!value) {
+ _E("Out of memory");
+ return -1;
+ }
+
+ h->list_autofill_svc_response_groups = g_list_append(h->list_autofill_svc_response_groups, value);
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_foreach_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups, void *user_data), void *user_data)
+{
+ if (!h || !callback) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ do {
+ GList *iter;
+
+ iter = h->list_autofill_svc_response_groups;
+ while (iter) {
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+
+ iter = g_list_next(iter);
+ if (!value) {
+ _W("Warning: value is NULL");
+ continue;
+ }
+
+ bool ret = callback(value, user_data);
+ if (!ret)
+ break;
+ }
+ } while (0);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_remove_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, unsigned int nth)
+{
+ GList *iter;
+
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ iter = g_list_nth(h->list_autofill_svc_response_groups, nth);
+ if (iter == NULL)
+ return -1;
+
+ rpc_port_autofill_svc_response_group_h value = iter->data;
+ h->list_autofill_svc_response_groups = g_list_remove_link(h->list_autofill_svc_response_groups, iter);
+ rpc_port_autofill_svc_response_group_destroy(value);
+ g_list_free(iter);
+
+ return 0;
+}
+
+int rpc_port_list_autofill_svc_response_group_get_list_autofill_svc_response_groups_length(rpc_port_list_autofill_svc_response_group_h h, unsigned int *length)
+{
+ if (!h || !length) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *length = g_list_length(h->list_autofill_svc_response_groups);
+
+ return 0;
+}
+
struct list_autofill_svc_response_item_s {
rpc_port_parcelable_t parcelable;
GList *list_autofill_svc_response_items;
int rpc_port_autofill_svc_response_item_get_value(rpc_port_autofill_svc_response_item_h h, char **value);
+typedef struct autofill_svc_response_group_s *rpc_port_autofill_svc_response_group_h;
+
+int rpc_port_autofill_svc_response_group_create(rpc_port_autofill_svc_response_group_h *h);
+
+int rpc_port_autofill_svc_response_group_destroy(rpc_port_autofill_svc_response_group_h h);
+
+int rpc_port_autofill_svc_response_group_clone(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h *clone);
+
+int rpc_port_autofill_svc_response_group_add_response_items(rpc_port_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_item_h response_items);
+
+int rpc_port_autofill_svc_response_group_foreach_response_items(rpc_port_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data);
+
+int rpc_port_autofill_svc_response_group_remove_response_items(rpc_port_autofill_svc_response_group_h h, unsigned int nth);
+
+int rpc_port_autofill_svc_response_group_get_response_items_length(rpc_port_autofill_svc_response_group_h h, unsigned int *length);
+
typedef struct autofill_svc_fill_response_s *rpc_port_autofill_svc_fill_response_h;
int rpc_port_autofill_svc_fill_response_create(rpc_port_autofill_svc_fill_response_h *h);
int rpc_port_autofill_svc_fill_response_set_view_id(rpc_port_autofill_svc_fill_response_h h, const char *view_id);
-int rpc_port_autofill_svc_fill_response_add_response_items(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_item_h response_items);
+int rpc_port_autofill_svc_fill_response_add_response_groups(rpc_port_autofill_svc_fill_response_h h, rpc_port_autofill_svc_response_group_h response_groups);
int rpc_port_autofill_svc_fill_response_get_app_id(rpc_port_autofill_svc_fill_response_h h, char **app_id);
int rpc_port_autofill_svc_fill_response_get_view_id(rpc_port_autofill_svc_fill_response_h h, char **view_id);
-int rpc_port_autofill_svc_fill_response_foreach_response_items(rpc_port_autofill_svc_fill_response_h h,
- bool (*callback)(rpc_port_autofill_svc_response_item_h response_items, void *user_data), void *user_data);
+int rpc_port_autofill_svc_fill_response_foreach_response_groups(rpc_port_autofill_svc_fill_response_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h response_groups, void *user_data), void *user_data);
-int rpc_port_autofill_svc_fill_response_remove_response_items(rpc_port_autofill_svc_fill_response_h h, unsigned int nth);
+int rpc_port_autofill_svc_fill_response_remove_response_groups(rpc_port_autofill_svc_fill_response_h h, unsigned int nth);
-int rpc_port_autofill_svc_fill_response_get_response_items_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length);
+int rpc_port_autofill_svc_fill_response_get_response_groups_length(rpc_port_autofill_svc_fill_response_h h, unsigned int *length);
typedef struct list_autofill_svc_item_s *rpc_port_list_autofill_svc_item_h;
int rpc_port_list_autofill_svc_item_get_list_autofill_svc_items_length(rpc_port_list_autofill_svc_item_h h, unsigned int *length);
+typedef struct list_autofill_svc_response_group_s *rpc_port_list_autofill_svc_response_group_h;
+
+int rpc_port_list_autofill_svc_response_group_create(rpc_port_list_autofill_svc_response_group_h *h);
+
+int rpc_port_list_autofill_svc_response_group_destroy(rpc_port_list_autofill_svc_response_group_h h);
+
+int rpc_port_list_autofill_svc_response_group_clone(rpc_port_list_autofill_svc_response_group_h h, rpc_port_list_autofill_svc_response_group_h *clone);
+
+int rpc_port_list_autofill_svc_response_group_add_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups);
+
+int rpc_port_list_autofill_svc_response_group_foreach_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h,
+ bool (*callback)(rpc_port_autofill_svc_response_group_h list_autofill_svc_response_groups, void *user_data), void *user_data);
+
+int rpc_port_list_autofill_svc_response_group_remove_list_autofill_svc_response_groups(rpc_port_list_autofill_svc_response_group_h h, unsigned int nth);
+
+int rpc_port_list_autofill_svc_response_group_get_list_autofill_svc_response_groups_length(rpc_port_list_autofill_svc_response_group_h h, unsigned int *length);
+
typedef struct list_autofill_svc_response_item_s *rpc_port_list_autofill_svc_response_item_h;
int rpc_port_list_autofill_svc_response_item_create(rpc_port_list_autofill_svc_response_item_h *h);
return true;
}
+static bool _fill_response_group_cb(autofill_fill_response_group_h group_h, void *user_data)
+{
+ autofill_fill_response_group_foreach_items(group_h, _fill_response_item_cb, NULL);
+
+ return true;
+}
+
static void
_autofill_fill_response_cb(autofill_fill_response_h fill_response, void *data)
{
if (!fill_response)
return;
+ int count;
+ autofill_fill_response_get_group_count(fill_response, &count);
+ LOGD("group count : %d", count);
+
#if 0
if (eina_list_count(fill_response->autofill_fill_response_item_list) == 1)
{
}
#endif
- autofill_fill_response_foreach_items(fill_response, _fill_response_item_cb, NULL);
+ autofill_fill_response_foreach_groups(fill_response, _fill_response_group_cb, NULL);
}
static void
string value;
}
+struct autofill_response_group {
+ list<autofill_response_item> response_items;
+}
+
struct autofill_fill_response {
string view_id;
- list<autofill_response_item> response_items;
+ list<autofill_response_group> response_groups;
}
interface AutofillAppPort {
string value;
}
+struct autofill_svc_response_group {
+ list<autofill_svc_response_item> response_items;
+}
+
struct autofill_svc_fill_response {
string app_id;
string view_id;
- list<autofill_svc_response_item> response_items;
+ list<autofill_svc_response_group> response_groups;
}
interface AutofillSvcPort {