2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_SOCIAL_CONTACTS_NAME_H__
19 #define __TIZEN_SOCIAL_CONTACTS_NAME_H__
21 #include <contacts_types.h>
29 * @addtogroup CAPI_SOCIAL_CONTACTS_NAME_MODULE
34 * @brief Creates a handle to contacts name.
36 * @remarks @a name must be released with contact_name_destroy() by you. \n
37 * @a name is not added to contacts database until contact_insert_to_db() is called.
40 * @param[out] name A new contacts name handle
42 * @return 0 on success, otherwise a negative error value.
43 * @retval #CONTACTS_ERROR_NONE Successful
44 * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter
45 * @retval #CONTACTS_ERROR_OUT_OF_MEMORY Out of memory
47 * @see contact_name_destroy()
50 int contact_name_create(contact_name_h *name);
53 * @brief Destroys the handle to contacts name.
56 * @param[in] name The contacts name handle
58 * @return 0 on success, otherwise a negative error value.
59 * @retval #CONTACTS_ERROR_NONE Successful
60 * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter
63 * @see contact_name_create()
66 int contact_name_destroy(contact_name_h name);
69 * @brief Gets the contact name detail from the contacts name handle.
71 * @remarks @a detail must be released with free() by you.
73 * @param[in] name The contacts name handle
74 * @param[in] detail_type The type of detail name to get
75 * @param[out] detail The detail name to be returned \n
76 * If requested data does not exist, @a detail is NULL
78 * @return 0 on success, otherwise a negative error value.
79 * @retval #CONTACTS_ERROR_NONE Successful
80 * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter
82 * @see contact_name_set_detail()
85 int contact_name_get_detail(contact_name_h name, contact_name_detail_e detail_type, char **detail);
88 * @brief Sets a contact name detail to the contacts name handle.
90 * @param[in] name The contacts name handle
91 * @param[in] detail_type The type of detail name to set
92 * @param[in] detail The detail name to set
94 * @return 0 on success, otherwise a negative error value.
95 * @retval #CONTACTS_ERROR_NONE Successful
96 * @retval #CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter
98 * @see contact_name_get_detail()
101 int contact_name_set_detail(contact_name_h name, contact_name_detail_e detail_type, const char* detail);
111 #endif /* __TIZEN_SOCIAL_CONTACTS_NAME_H__ */