77b9f2c55a1510eab07ed06a34a8c1c75c0623f7
[platform/core/uifw/autofill.git] / include / autofill_common.h
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_UIX_AUTOFILL_COMMON_H__
18 #define __TIZEN_UIX_AUTOFILL_COMMON_H__
19
20 /**
21  * @file autofill_common.h
22  * @brief This file contains autofill APIs and related enumeration.
23  */
24
25 #include <tizen.h>
26 #include "autofill_enum.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /**
33  * @addtogroup CAPI_UIX_AUTOFILL_COMMON_MODULE
34  * @{
35  */
36
37 /**
38  * @brief Enumeration for autofill function error
39  *
40  * @since_tizen 5.5
41  */
42 typedef enum {
43     AUTOFILL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
44     AUTOFILL_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O Error */
45     AUTOFILL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
46     AUTOFILL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
47     AUTOFILL_ERROR_NOT_INITIALIZED = TIZEN_ERROR_ENDPOINT_NOT_CONNECTED, /**< Initialization is not set */
48     AUTOFILL_ERROR_NO_CALLBACK_FUNCTION = TIZEN_ERROR_IME | 0x0001, /**< Necessary callback function is not set */
49     AUTOFILL_ERROR_NOT_RUNNING = TIZEN_ERROR_IME | 0x0002, /**< IME main loop isn't started yet */
50     AUTOFILL_ERROR_OPERATION_FAILED = TIZEN_ERROR_IME | 0x0003, /**< Operation failed */
51     AUTOFILL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< out of memory */
52 } autofill_error_e;
53
54 typedef struct autofill_item_s *autofill_item_h;
55 typedef struct autofill_auth_info_s *autofill_auth_info_h;
56 typedef struct autofill_view_info_s *autofill_view_info_h;
57 typedef struct autofill_fill_response_s *autofill_fill_response_h;
58 typedef struct autofill_fill_response_group_s *autofill_fill_response_group_h;
59 typedef struct autofill_response_item_s *autofill_fill_response_item_h;
60 typedef struct autofill_save_item_s *autofill_save_item_h;
61 typedef struct autofill_save_view_info_s *autofill_save_view_info_h;
62
63 /**
64  * @brief Create autofill item
65  *
66  * @since_tizen 5.5
67  *
68  * @privlevel public
69  *
70  * @param[out] it The autofill item handle
71  * @return 0 on success, otherwise a negative error value
72  * @retval #AUTOFILL_ERROR_NONE No error
73  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
74  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
75  */
76 int autofill_item_create(autofill_item_h *it);
77
78 /**
79  * @brief Destroy autofill item
80  *
81  * @since_tizen 5.5
82  *
83  * @privlevel public
84  *
85  * @param[in] it The autofill item handle
86  * @return 0 on success, otherwise a negative error value
87  * @retval #AUTOFILL_ERROR_NONE No error
88  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
89  */
90 int autofill_item_destroy(autofill_item_h it);
91
92 /**
93  * @brief Clone autofill item
94  *
95  * @since_tizen 5.5
96  *
97  * @privlevel public
98  *
99  * @param[in] it The autofill item handle
100  * @param[out] clone The autofill item handle to be cloned
101  * @return 0 on success, otherwise a negative error value
102  * @retval #AUTOFILL_ERROR_NONE No error
103  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
104  */
105 int autofill_item_clone(autofill_item_h h, autofill_item_h *clone);
106
107 /**
108  * @brief Set autofill hint (id (username), name, password, phone, credit card number, organization, so on)
109  *
110  * @since_tizen 5.5
111  *
112  * @privlevel public
113  *
114  * @param[in] it The autofill item handle
115  * @param[in] hint The autofill hint
116  * @return 0 on success, otherwise a negative error value
117  * @retval #AUTOFILL_ERROR_NONE No error
118  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
119  */
120 int autofill_item_set_autofill_hint(autofill_item_h it, autofill_hint_e hint);
121
122 /**
123  * @brief Get autofill hint
124  *
125  * @since_tizen 5.5
126  *
127  * @privlevel public
128  *
129  * @param[in] it The autofill item handle
130  * @param[out] hint The autofill hint
131  * @return 0 on success, otherwise a negative error value
132  * @retval #AUTOFILL_ERROR_NONE No error
133  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
134  */
135 int autofill_item_get_autofill_hint(autofill_item_h it, autofill_hint_e *hint);
136
137 /**
138  * @brief Set autofill ID
139  *
140  * @since_tizen 5.5
141  *
142  * @privlevel public
143  *
144  * @param[in] it The autofill item handle
145  * @param[in] id The autofill ID
146  * @return 0 on success, otherwise a negative error value
147  * @retval #AUTOFILL_ERROR_NONE No error
148  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
149  */
150 int autofill_item_set_id(autofill_item_h it, const char *id);
151
152 /**
153  * @brief Set autofill ID
154  *
155  * @since_tizen 5.5
156  *
157  * @privlevel public
158  *
159  * @param[in] it The autofill item handle
160  * @param[out] id The autofill ID
161  * @return 0 on success, otherwise a negative error value
162  * @retval #AUTOFILL_ERROR_NONE No error
163  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
164  */
165 int autofill_item_get_id(autofill_item_h it, char **id);
166
167 /**
168  * @brief Set autofill Label
169  *
170  * @since_tizen 5.5
171  *
172  * @privlevel public
173  *
174  * @param[in] it The autofill item handle
175  * @param[in] label The autofill label
176  * @return 0 on success, otherwise a negative error value
177  * @retval #AUTOFILL_ERROR_NONE No error
178  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
179  */
180 int autofill_item_set_label(autofill_item_h it, const char *label);
181
182 /**
183  * @brief Get autofill Label
184  *
185  * @since_tizen 5.5
186  *
187  * @privlevel public
188  *
189  * @param[in] it The autofill item handle
190  * @param[out] label The autofill label
191  * @return 0 on success, otherwise a negative error value
192  * @retval #AUTOFILL_ERROR_NONE No error
193  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
194  */
195 int autofill_item_get_label(autofill_item_h it, char **label);
196
197 /**
198  * @brief Set sensitive data
199  *
200  * @since_tizen 5.5
201  *
202  * @privlevel public
203  *
204  * @param[in] it The autofill item handle
205  * @param[in] sensitive The sensitive data or not
206  * @return 0 on success, otherwise a negative error value
207  * @retval #AUTOFILL_ERROR_NONE No error
208  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
209  */
210 int autofill_item_set_sensitive_data(autofill_item_h it, bool sensitive);
211
212 /**
213  * @brief Get sensitive data
214  *
215  * @since_tizen 5.5
216  *
217  * @privlevel public
218  *
219  * @param[in] it The autofill item handle
220  * @param[out] sensitive The sensitive data or not
221  * @return 0 on success, otherwise a negative error value
222  * @retval #AUTOFILL_ERROR_NONE No error
223  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
224  */
225 int autofill_item_get_sensitive_data(autofill_item_h it, bool *sensitive);
226
227 /**
228  * @brief Set autofill value
229  *
230  * @since_tizen 5.5
231  *
232  * @privlevel public
233  *
234  * @param[in] it The autofill item handle
235  * @param[in] value The autofill value
236  * @return 0 on success, otherwise a negative error value
237  * @retval #AUTOFILL_ERROR_NONE No error
238  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
239  */
240 int autofill_item_set_value(autofill_item_h it, const char *value);
241
242 /**
243  * @brief Get autofill value
244  *
245  * @since_tizen 5.5
246  *
247  * @privlevel public
248  *
249  * @param[in] it The autofill item handle
250  * @param[out] value The autofill value
251  * @return 0 on success, otherwise a negative error value
252  * @retval #AUTOFILL_ERROR_NONE No error
253  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
254  */
255 int autofill_item_get_value(autofill_item_h it, char **value);
256
257 // auth info
258
259 /**
260  * @brief Create autofill auth info
261  *
262  * @since_tizen 5.5
263  *
264  * @privlevel public
265  *
266  * @param[out] ai The autofill authentication information handle
267  * @return 0 on success, otherwise a negative error value
268  * @retval #AUTOFILL_ERROR_NONE No error
269  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
270  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
271  */
272 int autofill_auth_info_create(autofill_auth_info_h *ai);
273
274 /**
275  * @brief Destroy autofill view info
276  *
277  * @since_tizen 5.5
278  *
279  * @privlevel public
280  *
281  * @param[in] ai The autofill authentication information handle
282  * @return 0 on success, otherwise a negative error value
283  * @retval #AUTOFILL_ERROR_NONE No error
284  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
285  */
286 int autofill_auth_info_destroy(autofill_auth_info_h ai);
287
288 /**
289  * @brief Set app id
290  *
291  * @since_tizen 5.5
292  *
293  * @privlevel public
294  *
295  * @param[in] ai The autofill authentication information handle
296  * @param[in] app_id The app ID
297  * @return 0 on success, otherwise a negative error value
298  * @retval #AUTOFILL_ERROR_NONE No error
299  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
300  */
301 int autofill_auth_info_set_app_id(autofill_auth_info_h ai, const char *app_id);
302
303 /**
304  * @brief Get app id
305  *
306  * @since_tizen 5.5
307  *
308  * @privlevel public
309  *
310  * @param[in] ai The autofill authentication information handle
311  * @param[out] app_id The app ID
312  * @return 0 on success, otherwise a negative error value
313  * @retval #AUTOFILL_ERROR_NONE No error
314  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
315  */
316 int autofill_auth_info_get_app_id(autofill_auth_info_h ai, char **app_id);
317
318 /**
319  * @brief Set view id
320  *
321  * @since_tizen 5.5
322  *
323  * @privlevel public
324  *
325  * @param[in] ai The autofill authentication information handle
326  * @param[in] view_id The view ID
327  * @return 0 on success, otherwise a negative error value
328  * @retval #AUTOFILL_ERROR_NONE No error
329  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
330  */
331 int autofill_auth_info_set_view_id(autofill_auth_info_h ai, const char *view_id);
332
333 /**
334  * @brief Get view id
335  *
336  * @since_tizen 5.5
337  *
338  * @privlevel public
339  *
340  * @param[in] ai The autofill authentication information handle
341  * @param[in] view_id The view ID
342  * @return 0 on success, otherwise a negative error value
343  * @retval #AUTOFILL_ERROR_NONE No error
344  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
345  */
346 int autofill_auth_info_get_view_id(autofill_auth_info_h ai, char **view_id);
347
348 /**
349  * @brief Set exist autofill data
350  *
351  * @since_tizen 5.5
352  *
353  * @privlevel public
354  *
355  * @param[in] ai The autofill authentication information handle
356  * @param[in] exist_autofill_data The autofill data existence
357  * @return 0 on success, otherwise a negative error value
358  * @retval #AUTOFILL_ERROR_NONE No error
359  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
360  */
361 int autofill_auth_info_set_exist_autofill_data(autofill_auth_info_h ai, bool exist_autofill_data);
362
363 /**
364  * @brief Get exist autofill data
365  *
366  * @since_tizen 5.5
367  *
368  * @privlevel public
369  *
370  * @param[in] ai The autofill authentication information handle
371  * @param[out] exist_autofill_data The autofill data existence
372  * @return 0 on success, otherwise a negative error value
373  * @retval #AUTOFILL_ERROR_NONE No error
374  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
375  */
376 int autofill_auth_info_get_exist_autofill_data(autofill_auth_info_h ai, bool *exist_autofill_data);
377
378 /**
379  * @brief Set need authentication
380  *
381  * @since_tizen 5.5
382  *
383  * @privlevel public
384  *
385  * @param[in] ai The autofill authentication information handle
386  * @param[in] need_authentication The authentication need
387  * @return 0 on success, otherwise a negative error value
388  * @retval #AUTOFILL_ERROR_NONE No error
389  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
390  */
391 int autofill_auth_info_set_need_authentication(autofill_auth_info_h ai, bool need_authentication);
392
393 /**
394  * @brief Get need authentication
395  *
396  * @since_tizen 5.5
397  *
398  * @privlevel public
399  *
400  * @param[in] ai The autofill authentication information handle
401  * @param[out] need_authentication The authentication need
402  * @return 0 on success, otherwise a negative error value
403  * @retval #AUTOFILL_ERROR_NONE No error
404  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
405  */
406 int autofill_auth_info_get_need_authentication(autofill_auth_info_h ai, bool *need_authentication);
407
408 /**
409  * @brief Set service name
410  *
411  * @since_tizen 5.5
412  *
413  * @privlevel public
414  *
415  * @param[in] ai The autofill authentication information handle
416  * @param[in] service_name The autofill service name
417  * @return 0 on success, otherwise a negative error value
418  * @retval #AUTOFILL_ERROR_NONE No error
419  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
420  */
421 int autofill_auth_info_set_service_name(autofill_auth_info_h ai, const char *service_name);
422
423 /**
424  * @brief Get service name
425  *
426  * @since_tizen 5.5
427  *
428  * @privlevel public
429  *
430  * @param[in] ai The autofill authentication information handle
431  * @param[out] service_name The autofill service name
432  * @return 0 on success, otherwise a negative error value
433  * @retval #AUTOFILL_ERROR_NONE No error
434  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
435  */
436 int autofill_auth_info_get_service_name(autofill_auth_info_h ai, char **service_name);
437
438 /**
439  * @brief Set service message
440  *
441  * @since_tizen 5.5
442  *
443  * @privlevel public
444  *
445  * @param[in] ai The autofill authentication information handle
446  * @param[in] service_name The autofill service message
447  * @return 0 on success, otherwise a negative error value
448  * @retval #AUTOFILL_ERROR_NONE No error
449  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
450  */
451 int autofill_auth_info_set_service_message(autofill_auth_info_h ai, const char *service_message);
452
453 /**
454  * @brief Get service message
455  *
456  * @since_tizen 5.5
457  *
458  * @privlevel public
459  *
460  * @param[in] ai The autofill authentication information handle
461  * @param[out] service_name The autofill service message
462  * @return 0 on success, otherwise a negative error value
463  * @retval #AUTOFILL_ERROR_NONE No error
464  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
465  */
466 int autofill_auth_info_get_service_message(autofill_auth_info_h ai, char **service_message);
467
468 /**
469  * @brief Set service logo image path
470  *
471  * @since_tizen 5.5
472  *
473  * @privlevel public
474  *
475  * @param[in] ai The autofill authentication information handle
476  * @param[in] service_logo_image_path The autofill service logo image path
477  * @return 0 on success, otherwise a negative error value
478  * @retval #AUTOFILL_ERROR_NONE No error
479  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
480  */
481 int autofill_auth_info_set_service_logo_image_path(autofill_auth_info_h ai, const char *service_logo_image_path);
482
483 /**
484  * @brief Get service logo image path
485  *
486  * @since_tizen 5.5
487  *
488  * @privlevel public
489  *
490  * @param[in] ai The autofill authentication information handle
491  * @param[out] service_logo_image_path The autofill service logo image path
492  * @return 0 on success, otherwise a negative error value
493  * @retval #AUTOFILL_ERROR_NONE No error
494  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
495  */
496 int autofill_auth_info_get_service_logo_image_path(autofill_auth_info_h ai, char **service_logo_image_path);
497
498 // view info
499 /**
500  * @brief Create autofill view info
501  *
502  * @since_tizen 5.5
503  *
504  * @privlevel public
505  *
506  * @param[out] vi The autofill view info handle
507  * @return 0 on success, otherwise a negative error value
508  * @retval #AUTOFILL_ERROR_NONE No error
509  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
510  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
511  */
512 int autofill_view_info_create(autofill_view_info_h *vi);
513
514 /**
515  * @brief Destroy autofill view info
516  *
517  * @since_tizen 5.5
518  *
519  * @privlevel public
520  *
521  * @param[in] vi The autofill view info handle
522  * @param[in] app_id The app ID
523  * @return 0 on success, otherwise a negative error value
524  * @retval #AUTOFILL_ERROR_NONE No error
525  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
526  */
527 int autofill_view_info_destroy(autofill_view_info_h vi);
528
529 /**
530  * @brief Set app id
531  *
532  * @since_tizen 5.5
533  *
534  * @privlevel public
535  *
536  * @param[in] vi The autofill view info handle
537  * @param[in] app_id The app ID
538  * @return 0 on success, otherwise a negative error value
539  * @retval #AUTOFILL_ERROR_NONE No error
540  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
541  */
542 int autofill_view_info_set_app_id(autofill_view_info_h vi, const char *app_id);
543
544 /**
545  * @brief Get app id
546  *
547  * @since_tizen 5.5
548  *
549  * @privlevel public
550  *
551  * @param[in] vi The autofill view info handle
552  * @param[out] app_id The app ID
553  * @return 0 on success, otherwise a negative error value
554  * @retval #AUTOFILL_ERROR_NONE No error
555  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
556  */
557 int autofill_view_info_get_app_id(const autofill_view_info_h vi, char **app_id);
558
559 /**
560  * @brief Set view id
561  *
562  * @since_tizen 5.5
563  *
564  * @privlevel public
565  *
566  * @param[in] vi The autofill view info handle
567  * @param[in] view_id The view ID
568  * @return 0 on success, otherwise a negative error value
569  * @retval #AUTOFILL_ERROR_NONE No error
570  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
571  */
572 int autofill_view_info_set_view_id(autofill_view_info_h vi, const char *view_id);
573
574 /**
575  * @brief Get view id
576  *
577  * @since_tizen 5.5
578  *
579  * @privlevel public
580  *
581  * @param[in] vi The autofill view info handle
582  * @param[out] view_id The view ID
583  * @return 0 on success, otherwise a negative error value
584  * @retval #AUTOFILL_ERROR_NONE No error
585  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
586  */
587 int autofill_view_info_get_view_id(autofill_view_info_h vi, char **view_id);
588
589 /**
590  * @brief Add autofill item
591  *
592  * @since_tizen 5.5
593  *
594  * @privlevel public
595  *
596  * @param[in] vi The autofill view info handle
597  * @param[in] it The autofill item handle
598  * @return 0 on success, otherwise a negative error value
599  * @retval #AUTOFILL_ERROR_NONE No error
600  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
601  */
602 int autofill_view_info_add_item(const autofill_view_info_h vi, autofill_item_h it);
603
604 /**
605  * @brief Retrieve all items in view info
606  *
607  * @since_tizen 5.5
608  *
609  * @privlevel public
610  *
611  * @param[in] vi The autofill view info handle
612  * @param[in] callback The callback function to register
613  * @param[in] user_data The user data to be passed to the callback function
614  * @return 0 on success, otherwise a negative error value
615  * @retval #AUTOFILL_ERROR_NONE No error
616  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
617  */
618 int autofill_view_info_foreach_items(autofill_view_info_h vi, bool (*callback)(autofill_item_h item, void *user_data), void *user_data);
619
620 // save view info
621 /**
622  * @brief Create autofill save view
623  *
624  * @since_tizen 5.5
625  *
626  * @privlevel public
627  *
628  * @param[out] vi The autofill view info handle
629  * @return 0 on success, otherwise a negative error value
630  * @retval #AUTOFILL_ERROR_NONE No error
631  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
632  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
633  */
634 int autofill_save_view_info_create(autofill_save_view_info_h *vi);
635
636 /**
637  * @brief Destroy autofill save view
638  *
639  * @since_tizen 5.5
640  *
641  * @privlevel public
642  *
643  * @param[in] vi The autofill view info handle
644  * @return 0 on success, otherwise a negative error value
645  * @retval #AUTOFILL_ERROR_NONE No error
646  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
647  */
648 int autofill_save_view_info_destroy(autofill_save_view_info_h vi);
649
650 /**
651  * @brief Set app ID
652  *
653  * @since_tizen 5.5
654  *
655  * @privlevel public
656  *
657  * @param[in] vi The autofill view info handle
658  * @param[in] app_id The app ID
659  * @return 0 on success, otherwise a negative error value
660  * @retval #AUTOFILL_ERROR_NONE No error
661  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
662  */
663 int autofill_save_view_info_set_app_id(autofill_save_view_info_h vi, const char *app_id);
664
665 /**
666  * @brief Get app ID
667  *
668  * @since_tizen 5.5
669  *
670  * @privlevel public
671  *
672  * @param[in] vi The autofill view info handle
673  * @param[out] app_id The app ID
674  * @return 0 on success, otherwise a negative error value
675  * @retval #AUTOFILL_ERROR_NONE No error
676  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
677  */
678 int autofill_save_view_info_get_app_id(const autofill_save_view_info_h vi, char **app_id);
679
680 /**
681  * @brief Set view ID
682  *
683  * @since_tizen 5.5
684  *
685  * @privlevel public
686  *
687  * @param[in] vi The autofill view info handle
688  * @param[in] view_id The view ID
689  * @return 0 on success, otherwise a negative error value
690  * @retval #AUTOFILL_ERROR_NONE No error
691  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
692  */
693 int autofill_save_view_info_set_view_id(autofill_save_view_info_h vi, const char *view_id);
694
695 /**
696  * @brief Get view ID
697  *
698  * @since_tizen 5.5
699  *
700  * @privlevel public
701  *
702  * @param[in] vi The autofill view info handle
703  * @param[out] app_id The view ID
704  * @return 0 on success, otherwise a negative error value
705  * @retval #AUTOFILL_ERROR_NONE No error
706  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
707  */
708 int autofill_save_view_info_get_view_id(autofill_save_view_info_h vi, char **view_id);
709
710 /**
711  * @brief Add autofill save item
712  *
713  * @since_tizen 5.5
714  *
715  * @privlevel public
716  *
717  * @param[in] vi The autofill save view info handle
718  * @param[in] it The autofill save item handle
719  * @return 0 on success, otherwise a negative error value
720  * @retval #AUTOFILL_ERROR_NONE No error
721  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
722  */
723 int autofill_save_view_info_add_item(const autofill_save_view_info_h vi, autofill_save_item_h it);
724
725 /**
726  * @brief Retrieve all items in save view info
727  *
728  * @since_tizen 5.5
729  *
730  * @privlevel public
731  *
732  * @param[in] vi The autofill view info handle
733  * @param[in] callback The callback function to register
734  * @param[in] user_data The user data to be passed to the callback function
735  * @return 0 on success, otherwise a negative error value
736  * @retval #AUTOFILL_ERROR_NONE No error
737  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
738  */
739 int autofill_save_view_info_foreach_items(autofill_save_view_info_h vi, bool (*callback)(autofill_save_item_h item, void *user_data), void *user_data);
740
741 // fill response
742 /**
743  * @brief Create autofill fill response
744  *
745  * @since_tizen 5.5
746  *
747  * @privlevel public
748  *
749  * @param[out] h The autofill fill response handle
750  * @return 0 on success, otherwise a negative error value
751  * @retval #AUTOFILL_ERROR_NONE No error
752  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
753  */
754 int autofill_fill_response_create(autofill_fill_response_h *h);
755
756 /**
757  * @brief Destroy autofill fill response
758  *
759  * @since_tizen 5.5
760  *
761  * @privlevel public
762  *
763  * @param[in] h The autofill fill response handle
764  * @return 0 on success, otherwise a negative error value
765  * @retval #AUTOFILL_ERROR_NONE No error
766  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
767  */
768 int autofill_fill_response_destroy(autofill_fill_response_h h);
769
770 /**
771  * @brief Set app ID
772  *
773  * @since_tizen 5.5
774  *
775  * @privlevel public
776  *
777  * @param[in] h The autofill fill response handle
778  * @param[in] app_id The app ID
779  * @return 0 on success, otherwise a negative error value
780  * @retval #AUTOFILL_ERROR_NONE No error
781  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
782  */
783 int autofill_fill_response_set_app_id(autofill_fill_response_h h, const char *app_id);
784
785 /**
786  * @brief Get app ID
787  *
788  * @since_tizen 5.5
789  *
790  * @privlevel public
791  *
792  * @param[in] h The autofill fill response handle
793  * @param[out] app_id The app ID
794  * @return 0 on success, otherwise a negative error value
795  * @retval #AUTOFILL_ERROR_NONE No error
796  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
797  */
798 int autofill_fill_response_get_app_id(autofill_fill_response_h h, char **app_id);
799
800 /**
801  * @brief Set view ID
802  *
803  * @since_tizen 5.5
804  *
805  * @privlevel public
806  *
807  * @param[in] h The autofill fill response handle
808  * @param[in] view_id The view ID
809  * @return 0 on success, otherwise a negative error value
810  * @retval #AUTOFILL_ERROR_NONE No error
811  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
812  */
813 int autofill_fill_response_set_view_id(autofill_fill_response_h h, const char *view_id);
814
815 /**
816  * @brief Get view ID
817  *
818  * @since_tizen 5.5
819  *
820  * @privlevel public
821  *
822  * @param[in] h The autofill fill response handle
823  * @param[out] view_id The view ID
824  * @return 0 on success, otherwise a negative error value
825  * @retval #AUTOFILL_ERROR_NONE No error
826  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
827  */
828 int autofill_fill_response_get_view_id(autofill_fill_response_h h, char **view_id);
829
830 /**
831  * @brief Add autofill fill response group
832  *
833  * @since_tizen 5.5
834  *
835  * @privlevel public
836  *
837  * @param[in] h The autofill fill response handle
838  * @param[in] it The autofill fill response group handle
839  * @return 0 on success, otherwise a negative error value
840  * @retval #AUTOFILL_ERROR_NONE No error
841  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
842  */
843 int autofill_fill_response_add_group(autofill_fill_response_h h, autofill_fill_response_group_h it);
844
845 /**
846  * @brief Retrieve all groups of each fill response
847  *
848  * @since_tizen 5.5
849  *
850  * @privlevel public
851  *
852  * @param[in] h The autofill fill response handle
853  * @param[in] callback The callback function to register
854  * @param[in] user_data The user data to be passed to the callback function
855  * @return 0 on success, otherwise a negative error value
856  * @retval #AUTOFILL_ERROR_NONE No error
857  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
858  */
859 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);
860
861 /**
862  * @brief Get the number of fill response group
863  *
864  * @since_tizen 5.5
865  *
866  * @privlevel public
867  *
868  * @param[in] h The autofill fill response handle
869  * @param[out] count The number of group
870  * @return 0 on success, otherwise a negative error value
871  * @retval #AUTOFILL_ERROR_NONE No error
872  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
873  */
874 int autofill_fill_response_get_group_count(autofill_fill_response_h h, int *count);
875
876 /**
877  * @brief Create autofill fill response group
878  *
879  * @since_tizen 5.5
880  *
881  * @privlevel public
882  *
883  * @param[out] h The autofill fill response group handle
884  * @return 0 on success, otherwise a negative error value
885  * @retval #AUTOFILL_ERROR_NONE No error
886  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
887  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
888  */
889 int autofill_fill_response_group_create(autofill_fill_response_group_h *h);
890
891 /**
892  * @brief Destroy autofill fill response group
893  *
894  * @since_tizen 5.5
895  *
896  * @privlevel public
897  *
898  * @param[in] h The autofill fill response group handle
899  * @return 0 on success, otherwise a negative error value
900  * @retval #AUTOFILL_ERROR_NONE No error
901  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
902  */
903 int autofill_fill_response_group_destroy(autofill_fill_response_group_h h);
904
905 /**
906  * @brief Clone autofill fill response group
907  *
908  * @since_tizen 5.5
909  *
910  * @privlevel public
911  *
912  * @param[in] h The autofill fill response group handle
913  * @param[in] clone The autofill fill response group handle to be cloned
914  * @return 0 on success, otherwise a negative error value
915  * @retval #AUTOFILL_ERROR_NONE No error
916  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
917  */
918 int autofill_fill_response_group_clone(autofill_fill_response_group_h h, autofill_fill_response_group_h *clone);
919
920 /**
921  * @brief Add autofill item
922  *
923  * @since_tizen 5.5
924  *
925  * @privlevel public
926  *
927  * @param[in] h The autofill fill response group handle
928  * @param[in] it The autofill fill response item handle
929  * @return 0 on success, otherwise a negative error value
930  * @retval #AUTOFILL_ERROR_NONE No error
931  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
932  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
933  */
934 int autofill_fill_response_group_add_item(autofill_fill_response_group_h h, autofill_fill_response_item_h it);
935
936 /**
937  * @brief Retrieve all fill response items of each group
938  *
939  * @since_tizen 5.5
940  *
941  * @privlevel public
942  *
943  * @param[in] h The autofill fill response group handle
944  * @param[in] callback The callback function to register
945  * @param[in] user_data The user data to be passed to the callback function
946  * @return 0 on success, otherwise a negative error value
947  * @retval #AUTOFILL_ERROR_NONE No error
948  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
949  */
950 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);
951
952 // fill response item
953 /**
954  * @brief Create autofill response item
955  *
956  * @since_tizen 5.5
957  *
958  * @privlevel public
959  *
960  * @param[out] it The autofill fill response item handle
961  * @return 0 on success, otherwise a negative error value
962  * @retval #AUTOFILL_ERROR_NONE No error
963  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
964  * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory
965  */
966 int autofill_fill_response_item_create(autofill_fill_response_item_h *it);
967
968 /**
969  * @brief Destroy autofill fill response item
970  *
971  * @since_tizen 5.5
972  *
973  * @privlevel public
974  *
975  * @param[in] it The autofill fill response item handle
976  * @return 0 on success, otherwise a negative error value
977  * @retval #AUTOFILL_ERROR_NONE No error
978  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
979  */
980 int autofill_fill_response_item_destroy(autofill_fill_response_item_h it);
981
982 /**
983  * @brief Clone autofill fill response item
984  *
985  * @since_tizen 5.5
986  *
987  * @privlevel public
988  *
989  * @param[in] it The autofill fill response item handle
990  * @param[in] clone The autofill fill response item handle to be cloned
991  * @return 0 on success, otherwise a negative error value
992  * @retval #AUTOFILL_ERROR_NONE No error
993  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
994  */
995 int autofill_fill_response_item_clone(autofill_fill_response_item_h it, autofill_fill_response_item_h *clone);
996
997 /**
998  * @brief Set autofill ID
999  *
1000  * @since_tizen 5.5
1001  *
1002  * @privlevel public
1003  *
1004  * @param[in] it The autofill fill response item handle
1005  * @param[in] id The autofill fill response item ID
1006  * @return 0 on success, otherwise a negative error value
1007  * @retval #AUTOFILL_ERROR_NONE No error
1008  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1009  */
1010 int autofill_fill_response_item_set_id(autofill_fill_response_item_h it, const char *id);
1011
1012 /**
1013  * @brief Get autofill ID
1014  *
1015  * @since_tizen 5.5
1016  *
1017  * @privlevel public
1018  *
1019  * @param[in] it The autofill fill response item handle
1020  * @param[out] id The autofill fill response item ID
1021  * @return 0 on success, otherwise a negative error value
1022  * @retval #AUTOFILL_ERROR_NONE No error
1023  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1024  */
1025 int autofill_fill_response_item_get_id(autofill_fill_response_item_h it, char **id);
1026
1027 /**
1028  * @brief Set autofill value
1029  *
1030  * @since_tizen 5.5
1031  *
1032  * @privlevel public
1033  *
1034  * @param[in] it The autofill fill response item handle
1035  * @param[in] value The autofill fill response item value
1036  * @return 0 on success, otherwise a negative error value
1037  * @retval #AUTOFILL_ERROR_NONE No error
1038  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1039  */
1040 int autofill_fill_response_item_set_value(autofill_fill_response_item_h it, const char *value);
1041
1042 /**
1043  * @brief Get autofill value
1044  *
1045  * @since_tizen 5.5
1046  *
1047  * @privlevel public
1048  *
1049  * @param[in] it The autofill fill response item handle
1050  * @param[out] value The autofill fill response item value
1051  * @return 0 on success, otherwise a negative error value
1052  * @retval #AUTOFILL_ERROR_NONE No error
1053  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1054  */
1055 int autofill_fill_response_item_get_value(autofill_fill_response_item_h it, char **value);
1056
1057 /**
1058  * @brief Set presentation text
1059  *
1060  * @since_tizen 5.5
1061  *
1062  * @privlevel public
1063  *
1064  * @param[in] it The autofill fill response item handle
1065  * @param[in] presentation_text The presentation text
1066  * @return 0 on success, otherwise a negative error value
1067  * @retval #AUTOFILL_ERROR_NONE No error
1068  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1069  */
1070 int autofill_fill_response_item_set_presentation_text(autofill_fill_response_item_h it, const char *presentation_text);
1071
1072 /**
1073  * @brief Get presentation text
1074  *
1075  * @since_tizen 5.5
1076  *
1077  * @privlevel public
1078  *
1079  * @param[in] it The autofill fill response item handle
1080  * @param[out] presentation_text The presentation text
1081  * @return 0 on success, otherwise a negative error value
1082  * @retval #AUTOFILL_ERROR_NONE No error
1083  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1084  */
1085 int autofill_fill_response_item_get_presentation_text(autofill_fill_response_item_h it, char ** presentation_text);
1086
1087 // save item
1088 /**
1089  * @brief Create autofill save item
1090  *
1091  * @since_tizen 5.5
1092  *
1093  * @privlevel public
1094  *
1095  * @param[out] it The autofill save item handle
1096  * @return 0 on success, otherwise a negative error value
1097  * @retval #AUTOFILL_ERROR_NONE No error
1098  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1099  */
1100 int autofill_save_item_create(autofill_save_item_h *it);
1101
1102 /**
1103  * @brief Destroy autofill save item
1104  *
1105  * @since_tizen 5.5
1106  *
1107  * @privlevel public
1108  *
1109  * @param[in] it The autofill save item handle
1110  * @return 0 on success, otherwise a negative error value
1111  * @retval #AUTOFILL_ERROR_NONE No error
1112  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1113  */
1114 int autofill_save_item_destroy(autofill_save_item_h it);
1115
1116 /**
1117  * @brief Clone autofill item
1118  *
1119  * @since_tizen 5.5
1120  *
1121  * @privlevel public
1122  *
1123  * @param[in] it The autofill save item handle
1124  * @param[in] clone The autofill save item handle to be cloned
1125  * @return 0 on success, otherwise a negative error value
1126  * @retval #AUTOFILL_ERROR_NONE No error
1127  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1128  */
1129 int autofill_save_item_clone(autofill_save_item_h h, autofill_save_item_h *clone);
1130
1131 /**
1132  * @brief Set autofill hint (id(username), name, password, phone, credit card number, organization, so on)
1133  *
1134  * @since_tizen 5.5
1135  *
1136  * @privlevel public
1137  *
1138  * @param[in] it The autofill save item handle
1139  * @param[in] hint The autofill hint
1140  * @return 0 on success, otherwise a negative error value
1141  * @retval #AUTOFILL_ERROR_NONE No error
1142  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1143  */
1144 int autofill_save_item_set_autofill_hint(autofill_save_item_h it, autofill_hint_e hint);
1145
1146 /**
1147  * @brief Get autofill hint
1148  *
1149  * @since_tizen 5.5
1150  *
1151  * @privlevel public
1152  *
1153  * @param[in] it The autofill save item handle
1154  * @param[out] hint The autofill hint
1155  * @return 0 on success, otherwise a negative error value
1156  * @retval #AUTOFILL_ERROR_NONE No error
1157  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1158  */
1159 int autofill_save_item_get_autofill_hint(autofill_save_item_h it, autofill_hint_e *hint);
1160
1161 /**
1162  * @brief Set autofill ID
1163  *
1164  * @since_tizen 5.5
1165  *
1166  * @privlevel public
1167  *
1168  * @param[in] it The autofill save item handle
1169  * @param[in] id The autofill ID
1170  * @return 0 on success, otherwise a negative error value
1171  * @retval #AUTOFILL_ERROR_NONE No error
1172  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1173  */
1174 int autofill_save_item_set_id(autofill_save_item_h it, const char *id);
1175
1176 /**
1177  * @brief Get autofill ID
1178  *
1179  * @since_tizen 5.5
1180  *
1181  * @privlevel public
1182  *
1183  * @param[in] it The autofill save item handle
1184  * @param[out] id The autofill ID
1185  * @return 0 on success, otherwise a negative error value
1186  * @retval #AUTOFILL_ERROR_NONE No error
1187  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1188  */
1189 int autofill_save_item_get_id(autofill_save_item_h it, char **id);
1190
1191 /**
1192  * @brief Set autofill label
1193  *
1194  * @since_tizen 5.5
1195  *
1196  * @privlevel public
1197  *
1198  * @param[in] it The autofill save item handle
1199  * @param[out] label The autofill label
1200  * @return 0 on success, otherwise a negative error value
1201  * @retval #AUTOFILL_ERROR_NONE No error
1202  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1203  */
1204 int autofill_save_item_set_label(autofill_save_item_h it, const char *label);
1205
1206 /**
1207  * @brief Get autofill label
1208  *
1209  * @since_tizen 5.5
1210  *
1211  * @privlevel public
1212  *
1213  * @param[in] it The autofill save item handle
1214  * @param[out] label The autofill label
1215  * @return 0 on success, otherwise a negative error value
1216  * @retval #AUTOFILL_ERROR_NONE No error
1217  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1218  */
1219 int autofill_save_item_get_label(autofill_save_item_h it, char **label);
1220
1221 /**
1222  * @brief Set sensitive data
1223  *
1224  * @since_tizen 5.5
1225  *
1226  * @privlevel public
1227  *
1228  * @param[in] it The autofill save item handle
1229  * @param[in] sensitive The sensitive data or not
1230  * @return 0 on success, otherwise a negative error value
1231  * @retval #AUTOFILL_ERROR_NONE No error
1232  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1233  */
1234 int autofill_save_item_set_sensitive_data(autofill_save_item_h it, bool sensitive);
1235
1236 /**
1237  * @brief Get sensitive data
1238  *
1239  * @since_tizen 5.5
1240  *
1241  * @privlevel public
1242  *
1243  * @param[in] it The autofill save item handle
1244  * @param[out] sensitive The sensitive data or not
1245  * @return 0 on success, otherwise a negative error value
1246  * @retval #AUTOFILL_ERROR_NONE No error
1247  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1248  */
1249 int autofill_save_item_get_sensitive_data(autofill_save_item_h it, bool *sensitive);
1250
1251 /**
1252  * @brief Set autofill value
1253  *
1254  * @since_tizen 5.5
1255  *
1256  * @privlevel public
1257  *
1258  * @param[in] it The autofill save item handle
1259  * @param[in] value The autofill value
1260  * @return 0 on success, otherwise a negative error value
1261  * @retval #AUTOFILL_ERROR_NONE No error
1262  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1263  */
1264 int autofill_save_item_set_value(autofill_save_item_h it, const char *value);
1265
1266 /**
1267  * @brief Get autofill value
1268  *
1269  * @since_tizen 5.5
1270  *
1271  * @privlevel public
1272  *
1273  * @param[in] it The autofill save item handle
1274  * @param[out] value The autofill value
1275  * @return 0 on success, otherwise a negative error value
1276  * @retval #AUTOFILL_ERROR_NONE No error
1277  * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
1278  */
1279 int autofill_save_item_get_value(autofill_save_item_h it, char **value);
1280
1281 /**
1282  * @}
1283  */
1284
1285 #ifdef __cplusplus
1286 }
1287 #endif
1288
1289 #endif /* __TIZEN_UIX_AUTOFILL_COMMON_H__ */