diff options
Diffstat (limited to 'include/calllog_private.h')
-rwxr-xr-x | include/calllog_private.h | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/include/calllog_private.h b/include/calllog_private.h new file mode 100755 index 0000000..924cab8 --- /dev/null +++ b/include/calllog_private.h @@ -0,0 +1,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__ */ + |