[M67 Dev][EWK] Classify EWK APIs by public, internal, or product
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_autofill_profile.h
1 /*
2  * Copyright (C) 2016 Samsung Electronics
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this program; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 /**
21  * @file    ewk_autofill_profile.h
22  * @brief   This file describes the Ewk Autofill Profile API.
23  */
24
25 #ifndef ewk_autofill_profile_h
26 #define ewk_autofill_profile_h
27
28 #include <Eina.h>
29 #include <tizen.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /**
36  * @addtogroup WEBVIEW
37  * @{
38  */
39
40 /**
41  * @if MOBILE
42  * \enum   _Ewk_Autofill_Profile_Data_Type
43  * @brief  Enumeration that provides an option to autofill profile data types.
44  *
45  * @since_tizen 2.4
46  * @endif
47  */
48 enum _Ewk_Autofill_Profile_Data_Type {
49     EWK_PROFILE_ID = 0,  /**< Id */
50     EWK_PROFILE_NAME,  /**< Name */
51     EWK_PROFILE_COMPANY,  /**< Company */
52     EWK_PROFILE_ADDRESS1,  /**< Address1 */
53     EWK_PROFILE_ADDRESS2,  /**< Address2 */
54     EWK_PROFILE_CITY_TOWN,  /**< City Town */
55     EWK_PROFILE_STATE_PROVINCE_REGION,  /**< State Province Region */
56     EWK_PROFILE_ZIPCODE,  /**< Zipcode */
57     EWK_PROFILE_COUNTRY,  /**< Country */
58     EWK_PROFILE_PHONE,  /**< Phone */
59     EWK_PROFILE_EMAIL,  /**< Email */
60     EWK_MAX_AUTOFILL  /**< Max Autofill */
61 };
62
63 /**
64  * @if MOBILE
65  * @brief Enumeration that creates a type name for the Ewk_Autofill_Profile_Data_Type.
66  *
67  * @since_tizen 2.4
68  * @endif
69  */
70 typedef enum _Ewk_Autofill_Profile_Data_Type Ewk_Autofill_Profile_Data_Type;
71
72 /**
73  * @if MOBILE
74  * @brief The structure type that creates a type name for #Ewk_Autofill_Profile.
75  *
76  * @since_tizen 2.4
77  * @endif
78  */
79 typedef struct _Ewk_Autofill_Profile Ewk_Autofill_Profile;
80
81 /**
82  * @if MOBILE
83  * @brief Creates a new profile
84  *
85  * The created profile must be deleted by ewk_autofill_profile_delete
86  *
87  * @since_tizen 2.4
88  *
89  * @return @c Ewk_Autofill_Profile if new profile is successfully created,
90            @c NULL otherwise
91  *
92  * @see ewk_autofill_profile_data_set
93  * @see ewk_autofill_profile_delete
94  * @endif
95  */
96 EXPORT_API Ewk_Autofill_Profile* ewk_autofill_profile_new(void);
97
98 /**
99  * @if MOBILE
100  * @brief Deletes a given profile
101  *
102  * The API will delete the a particular profile only from the memory.
103  * To remove the profile permenantly use
104  * ewk_context_form_autofill_profile_remove
105  *
106  * @since_tizen 2.4
107  *
108  * @param[in] profile name
109  *
110  * @see ewk_autofill_profile_new
111  * @see ewk_context_form_autofill_profile_get
112  * @see ewk_context_form_autofill_profile_remove
113  * @endif
114  */
115 EXPORT_API void ewk_autofill_profile_delete(Ewk_Autofill_Profile* profile);
116
117 /**
118  * @if MOBILE
119  * @brief Sets the data in the profile created by ewk_autofill_profile_new
120  *
121  * The data set by this function is set locally. To save it to database use
122  * ewk_context_form_autofill_profile_add
123  *
124  * @since_tizen 2.4
125  *
126  * @param[in] profile contains the profile data
127  * @param[in] name type of attribute to be set
128  * @param[in] value value of the attribute
129  *
130  * @see ewk_autofill_profile_data_get
131  * @see Ewk_Autofill_Profile_Data_Type
132  * @see ewk_context_form_autofill_profile_add
133  * @endif
134  */
135 EXPORT_API void ewk_autofill_profile_data_set(Ewk_Autofill_Profile* profile, Ewk_Autofill_Profile_Data_Type name, const char* value);
136
137 /**
138  * @if MOBILE
139  * @brief Gets the id attribute value from a given profile
140  *
141  * The profile obtained from ewk_context_form_autofill_profile_get will be used
142  * to get the profileid
143  *
144  * @param[in] profile name of profile
145  *
146  * @since_tizen 2.4
147  *
148  * @return @c Value of attribute (unsigned), @c 0 otherwise
149  *
150  * @see ewk_autofill_profile_new
151  * @see ewk_context_form_autofill_profile_get
152  * @see ewk_context_form_autofill_profile_get_all
153  * @endif
154  */
155 EXPORT_API unsigned ewk_autofill_profile_id_get(Ewk_Autofill_Profile* profile);
156
157 /**
158  * @if MOBILE
159  * @brief Gets the attribute value from a given profile
160  *
161  * The profile obtained from ewk_context_form_autofill_profile_get will be used
162  * to get the data
163  *
164  * @since_tizen 2.4
165  *
166  * @param[in] profile name of profile
167  * @param[in] name name of attribute
168  *
169  * @return @c Value of attribute (char*), @c NULL otherwise
170  *
171  * @see ewk_autofill_profile_new
172  * @see ewk_context_form_autofill_profile_get
173  * @see ewk_context_form_autofill_profile_get_all
174  * @endif
175  */
176 EXPORT_API const char* ewk_autofill_profile_data_get(Ewk_Autofill_Profile* profile, Ewk_Autofill_Profile_Data_Type name);
177
178 /**
179 * @}
180 */
181
182 #ifdef __cplusplus
183 }
184 #endif
185
186 #endif // ewk_autofill_profile_h
187