Git init
[framework/api/contacts.git] / include / contacts_name.h
1 /*
2  * Copyright (c) 2011 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
18 #ifndef __TIZEN_SOCIAL_CONTACTS_NAME_H__
19 #define __TIZEN_SOCIAL_CONTACTS_NAME_H__
20
21 #include <contacts_types.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 /**
29  * @addtogroup CAPI_SOCIAL_CONTACTS_NAME_MODULE
30  * @{
31  */
32
33 /**
34  * @brief   Creates a handle to contacts name.
35  *
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.
38  *
39  *
40  * @param[out]  name  A new contacts name handle
41  *
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
46  *
47  * @see contact_name_destroy()
48  *
49  */
50 int contact_name_create(contact_name_h *name);
51
52 /**
53  * @brief   Destroys the handle to contacts name.
54  *
55  *
56  * @param[in]   name    The contacts name handle
57  *
58  * @return  0 on success, otherwise a negative error value.
59  * @retval  #CONTACTS_ERROR_NONE                Successful
60  * @retval  #CONTACTS_ERROR_INVALID_PARAMETER   Invalid parameter
61  *
62  *
63  * @see contact_name_create()
64  *
65  */
66 int contact_name_destroy(contact_name_h name);
67
68 /**
69  * @brief       Gets the contact name detail from the contacts name handle.
70  *
71  * @remarks   @a detail must be released with free() by you.            
72  *
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
77  *
78  * @return 0 on success, otherwise a negative error value.
79  * @retval  #CONTACTS_ERROR_NONE                 Successful
80  * @retval  #CONTACTS_ERROR_INVALID_PARAMETER    Invalid parameter
81  *
82  * @see contact_name_set_detail()
83  *
84  */
85 int contact_name_get_detail(contact_name_h name, contact_name_detail_e detail_type, char **detail);
86
87 /**
88  * @brief               Sets a contact name detail to the contacts name handle.
89  *
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
93  *
94  * @return 0 on success, otherwise a negative error value.
95  * @retval      #CONTACTS_ERROR_NONE                 Successful
96  * @retval      #CONTACTS_ERROR_INVALID_PARAMETER    Invalid parameter
97  *
98  * @see contact_name_get_detail()
99  *
100  */
101 int contact_name_set_detail(contact_name_h name, contact_name_detail_e detail_type, const char* detail);
102
103 /**
104  * @}
105  */
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif /* __TIZEN_SOCIAL_CONTACTS_NAME_H__ */
112