summaryrefslogtreecommitdiff
path: root/include/calllog_private.h
blob: 924cab85a79a27f56f51b0afa836cdda88cd83f4 (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
121
122
123
124
125
/*
 * 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_CALLLOG_PRIVATE_H__
#define __TIZEN_CALLLOG_PRIVATE_H__


#ifdef __cplusplus
extern "C"
{
#endif

/**
 * @internal
 */
typedef struct
{
   int v_type:16;
   bool embedded;
   bool deleted;
   int id;
   char *number;
   int related_id; /* contact id */
   int log_time;
   int calllog_type;
   int extra_data1; /* duration, message_id */
   char *extra_data2; /*short message*/
} _calllog_s;//CTS_PLOG_VAL_


/**
 * @internal
 * @brief	Retrieves the detailed information of each call log in the call log database.
 * @details Retrieves just one call log for each phone number. 
 * If you want to get all the information for the number you can use calllog_query_calllog_by_number().
 *
 * @param[in]   callback	The callback function
 * @param[in]   user_data	The user data to be passed to the callback function
 *
 * @return  0 on success, otherwise a negative error value.
 * @retval  #CALLLOG_ERROR_NONE                Successful
 * @retval  #CALLLOG_ERROR_INVALID_PARAMETER   Invalid parameter
 * @retval  #CALLLOG_ERROR_DB_FAILED           Database failed
 *
 * @pre     This function requires an open connection to call log service by calllog_connect().
 *
 * @post	This function invokes calllog_foreach_cb().
 *
 * @see calllog_connect()
 * @see calllog_query_calllog_by_number()
 */
int _calllog_foreach_calllog_grouped_from_db(calllog_foreach_cb callback, void *user_data);


/**
 * @internal
 * @brief       Gets the short message from the call log handle.
 *
 * @remarks     @a shortmsg must be released with free() by you. 
 *
 * @param[in]   log         The call log handle
 * @param[out]  shortmsg    The short message to get
 *
 * @return 0 on success, otherwise a negative error value.
 * @retval  #CALLLOG_ERROR_NONE                Successful
 * @retval  #CALLLOG_ERROR_INVALID_PARAMETER   Invalid parameter
 * @retval	#CALLLOG_ERROR_NO_DATA				Data not found
 *
 * @see #calllog_h
 * @see calllog_set_shortmsg()
 */
int _calllog_get_shortmsg(calllog_h log, char **shortmsg);

/**
 * @internal
 * @brief       Sets a short message to the call log handle.
 *
 *
 * @param[in]   log         The call log handle
 * @param[in]   shortmsg    The short message to set
 *
 * @return 0 on success, otherwise a negative error value.
 * @retval  #CALLLOG_ERROR_NONE                Successful
 * @retval  #CALLLOG_ERROR_INVALID_PARAMETER   Invalid parameter
 *
 * @see calllog_h
 * @see calllog_get_shortmsg()
 */
int _calllog_set_shortmsg(calllog_h log, const char *shortmsg);




#define _calllog_safe_free(_srcx_) 	{	if(NULL != _srcx_) free(_srcx_);	}
#define _calllog_safe_strdup(_srcx_) 	(NULL != _srcx_) ? strdup(_srcx_):NULL
#define _calllog_safe_str(_srcx_)		(NULL != _srcx_) ? _srcx_:""

#define _calllog_free_strdup(_desty_, _srcx_) \
   { \
      if(_desty_) { free(_desty_); _desty_=NULL; }\
      if(_srcx_) _desty_ = strdup(_srcx_); \
   }



#ifdef __cplusplus
}
#endif

#endif /* __CALLLOG_H__ */