2 * Copyright (C) 2016 Samsung Electronics
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.
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.
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.
21 * @file ewk_autofill_profile.h
22 * @brief This file describes the Ewk Autofill Profile API.
25 #ifndef ewk_autofill_profile_h
26 #define ewk_autofill_profile_h
42 * \enum _Ewk_Autofill_Profile_Data_Type
43 * @brief Enumeration that provides an option to autofill profile data types.
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 */
65 * @brief Enumeration that creates a type name for the Ewk_Autofill_Profile_Data_Type.
70 typedef enum _Ewk_Autofill_Profile_Data_Type Ewk_Autofill_Profile_Data_Type;
74 * @brief The structure type that creates a type name for #Ewk_Autofill_Profile.
79 typedef struct _Ewk_Autofill_Profile Ewk_Autofill_Profile;
83 * @brief Creates a new profile
85 * The created profile must be deleted by ewk_autofill_profile_delete
89 * @return @c Ewk_Autofill_Profile if new profile is successfully created,
92 * @see ewk_autofill_profile_data_set
93 * @see ewk_autofill_profile_delete
96 EXPORT_API Ewk_Autofill_Profile* ewk_autofill_profile_new(void);
100 * @brief Deletes a given profile
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
108 * @param[in] profile name
110 * @see ewk_autofill_profile_new
111 * @see ewk_context_form_autofill_profile_get
112 * @see ewk_context_form_autofill_profile_remove
115 EXPORT_API void ewk_autofill_profile_delete(Ewk_Autofill_Profile* profile);
119 * @brief Sets the data in the profile created by ewk_autofill_profile_new
121 * The data set by this function is set locally. To save it to database use
122 * ewk_context_form_autofill_profile_add
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
130 * @see ewk_autofill_profile_data_get
131 * @see Ewk_Autofill_Profile_Data_Type
132 * @see ewk_context_form_autofill_profile_add
135 EXPORT_API void ewk_autofill_profile_data_set(Ewk_Autofill_Profile* profile, Ewk_Autofill_Profile_Data_Type name, const char* value);
139 * @brief Gets the id attribute value from a given profile
141 * The profile obtained from ewk_context_form_autofill_profile_get will be used
142 * to get the profileid
144 * @param[in] profile name of profile
148 * @return @c Value of attribute (unsigned), @c 0 otherwise
150 * @see ewk_autofill_profile_new
151 * @see ewk_context_form_autofill_profile_get
152 * @see ewk_context_form_autofill_profile_get_all
155 EXPORT_API unsigned ewk_autofill_profile_id_get(Ewk_Autofill_Profile* profile);
159 * @brief Gets the attribute value from a given profile
161 * The profile obtained from ewk_context_form_autofill_profile_get will be used
166 * @param[in] profile name of profile
167 * @param[in] name name of attribute
169 * @return @c Value of attribute (char*), @c NULL otherwise
171 * @see ewk_autofill_profile_new
172 * @see ewk_context_form_autofill_profile_get
173 * @see ewk_context_form_autofill_profile_get_all
176 EXPORT_API const char* ewk_autofill_profile_data_get(Ewk_Autofill_Profile* profile, Ewk_Autofill_Profile_Data_Type name);
186 #endif // ewk_autofill_profile_h