summaryrefslogtreecommitdiff
path: root/include/contacts_relatedgroup.h
blob: 9620e7de659d5ca6506b072672605bbd934b30d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 */


#ifndef __TIZEN_SOCIAL_CONTACTS_RELATEDGROUP_H__
#define __TIZEN_SOCIAL_CONTACTS_RELATEDGROUP_H__


#include <contacts_types.h>

#ifdef __cplusplus
extern "C"
{
#endif


/**
 * @addtogroup CAPI_SOCIAL_CONTACTS_RELATEDGROUP_MODULE
 * @{
 */

/**
 * @brief       Gets the related group name from the contacts group handle.  
 *
 * @remarks     @a name must be released with free() by you. 
 *
 * @param[in]   relatedgroup    The contacts group handle
 * @param[out]  name            The fetched related group name \n
 * 						If @a name does not exist, it is NULL
 *
 * @return 0 on success, otherwise a negative error value.
 * @retval  #CONTACTS_ERROR_NONE                Successful
 * @retval  #CONTACTS_ERROR_INVALID_PARAMETER   Invalid parameter
 */
int contact_relatedgroup_get_name(contact_relatedgroup_h relatedgroup, char **name);

/**
 * @brief       Gets the ringtone path from the contacts group handle.
 *
 * @remarks @a ringtone_path must be released with free() by you. 
 *
 * @param[in]   relatedgroup            The contacts group handle
 * @param[out]  ringtone_path           The ringtone path \n
 * 							If @a ringtone_path does not exist, it is NULL
 *
 * @return 0 on success, otherwise a negative error value.
 * @retval  #CONTACTS_ERROR_NONE                Successful
 * @retval  #CONTACTS_ERROR_INVALID_PARAMETER   Invalid parameter
 */
int contact_relatedgroup_get_ringtonepath(contact_relatedgroup_h relatedgroup, char **ringtone_path);

/**
 * @brief       Gets the group database ID from contacts group handle. 
 *
 *
 * @param[in]   relatedgroup        The contacts group handle
 * @param[out]  group_db_id        The group ID fetched from contacts group handle
 *
 * @return      0 on success, otherwise a negative error value.
 * @retval      #CONTACTS_ERROR_NONE                Successful
 * @retval      #CONTACTS_ERROR_INVALID_PARAMETER   Invalid parameter
 * 
 * @see contacts_group_get_from_db()
 */
int contact_relatedgroup_get_group_db_id(contact_relatedgroup_h relatedgroup, int *group_db_id);

/**
 * @brief       Moves the related group list iterator to the next position and gets the contacts group handle.
 *
 * @details   If the next element for the current related group list exists, then the iterator is moved to the next position
 * on the list and the contacts related group handle for this position is returned. When the iterator reaches the last element of the
 * list, all further calls will return #CONTACTS_ERROR_ITERATOR_END and @a relatedgroup will remain unchanged.
 *
 * @param[in]   relatedgroup_iterator   The handle to the related group list 
 * @param[out]  relatedgroup            The contacts group handle
 *
 * @return  0 on success, otherwise a negative error value.
 * @retval  #CONTACTS_ERROR_NONE                Successful
 * @retval  #CONTACTS_ERROR_INVALID_PARAMETER   Invalid parameter
 * @retval  #CONTACTS_ERROR_ITERATOR_END            List reached end
 *
 * @see contact_relatedgroup_iterator_has_next()
 */
int contact_relatedgroup_iterator_next(contact_relatedgroup_iterator_h *relatedgroup_iterator, contact_relatedgroup_h *relatedgroup);

/**
 * @brief   Checks whether the next element of the related group iterator exists or not.
 *
 *
 * @param[in]   relatedgroup_iterator   The handle to the related group list 
 *
 * @return  @c true If the next element exists or @c false If the next element doesn't exist  
 * @see contact_relatedgroup_iterator_next()
 */
bool contact_relatedgroup_iterator_has_next(contact_relatedgroup_iterator_h relatedgroup_iterator);

/**
 * @}
 */

#ifdef __cplusplus
}
#endif


#endif /* __TIZEN_SOCIAL_CONTACTS_RELATEDGROUP_H__ */