Relase Tizen 2.0 beta 2.0alpha master 2.0_alpha submit/master/20120920.151021
authorDonghee Ye <donghee.ye@samsung.com>
Tue, 21 Aug 2012 10:55:40 +0000 (19:55 +0900)
committerDonghee Ye <donghee.ye@samsung.com>
Tue, 21 Aug 2012 10:55:40 +0000 (19:55 +0900)
Change-Id: I741dc5fb0d06513ac4481f032857b0ef529aa819

debian/changelog
include/calllog.h
include/calllog_private.h
include/calllog_types.h
packaging/capi-social-call-log.spec
src/calllog.c

index 4b36462..71457a9 100755 (executable)
@@ -1,3 +1,11 @@
+capi-social-call-log (0.1.2-1) unstable; urgency=low
+
+  * Release Tizen 2.0 beta
+  * Git: framework/api/call-log
+  * Tag: capi-social-call-log_0.1.2-1
+
+ -- DongHee Ye <donghee.ye@samsung.com>  Tue, 24 Jul 2012 10:11:36 +0900
+
 capi-social-call-log (0.1.1-25) unstable; urgency=low
 
   * package build dependecy updated
index 8f4d58c..bca1b8c 100755 (executable)
@@ -50,7 +50,6 @@ int calllog_connect(void);
 /**
  * @brief       Closes the connection to call log service.
  *
- *
  * @return  0 on success, otherwise a negative error value.
  * @retval  #CALLLOG_ERROR_NONE            Successful
  * @retval  #CALLLOG_ERROR_DB_FAILED           Database failed
@@ -60,6 +59,41 @@ int calllog_connect(void);
 int calllog_disconnect(void);
 
 /**
+ * @brief       Registers a callback function to be invoked when the call log changes.
+ *
+ * @param[in]   callback       The callback function to register
+ * @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
+ *
+ * @pre     This function requires an open connection to the call log service by calllog_connect().
+ * @post calllog_db_changed_cb() will be invoked when the call log changes.
+ *
+ * @see calllog_connect()
+ * @see calllog_db_changed_cb()
+ * @see calllog_insert_to_db()
+ * @see calllog_update_missed_unchecked_to_checked_to_db()
+ * @see calllog_delete_from_db()
+ */
+int calllog_add_calllog_db_changed_cb(calllog_db_changed_cb callback, void *user_data);
+
+/**
+ * @brief       Unregisters the callback function.
+ *
+ * @param[in]   callback            The callback function to unregister
+ *
+ * @return  0 on success, otherwise a negative error value.
+ * @retval  #CALLLOG_ERROR_NONE                Successful
+ * @retval  #CALLLOG_ERROR_INVALID_PARAMETER   Invalid parameter
+ *
+ * @see calllog_db_changed_cb()
+ * @see calllog_add_calllog_db_changed_cb()
+ */
+int calllog_remove_calllog_db_changed_cb(calllog_db_changed_cb callback);
+
+/**
  * @brief       Creates a new call log handle.
  * @remarks The call log handle must be released with calllog_destroy() by you.
  * @remarks    The created handle is not added to call log database until calllog_insert_to_db() is called.
@@ -338,5 +372,5 @@ int calllog_query_calllog_by_number(calllog_foreach_cb callback, const char *num
 }
 #endif
 
-#endif /* __CONTACTS_LOG_H__ */
+#endif /* __TIZEN_CALLLOG_H__ */
 
index 970c9f0..40ee582 100755 (executable)
@@ -122,5 +122,5 @@ int _calllog_set_shortmsg(calllog_h log, const char *shortmsg);
 }
 #endif
 
-#endif /* __CALLLOG_H__ */
+#endif /* __TIZEN_CALLLOG_PRIVATE_H__ */
 
index c919107..06c2f81 100755 (executable)
@@ -75,6 +75,14 @@ typedef enum
 } calllog_type_e;
 
 /**
+ * @brief       Called when call log changes.
+ *
+ * @param[in]   user_data      The user data passed from the callback registration function
+ * @see calllog_add_calllog_db_changed_cb()
+ */
+typedef void (*calllog_db_changed_cb)(void *user_data);
+
+/**
  * @brief The call log handle.
  */
 typedef struct _calllog_s* calllog_h;
@@ -126,5 +134,5 @@ typedef bool (*calllog_foreach_cb)(calllog_query_detail_s *query_log, void *user
 }
 #endif
 
-#endif /* __CALLLOG_H__ */
+#endif /* __TIZEN_CALLLOG_TYPE_H__ */
 
index ace3bee..ee2f64c 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       capi-social-call-log
 Summary:    Call log library in Tizen Native API
-Version:    0.1.1
-Release:    25
+Version:    0.1.3
+Release:    1
 Group:      TO_BE/FILLED_IN
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 7ca5855..943c1f1 100755 (executable)
@@ -191,7 +191,7 @@ int calllog_update_missed_unchecked_to_checked_to_db(int calllog_db_id)
 
 int calllog_get_time(calllog_h log, time_t* log_time)
 {
-       if(log == NULL || time == NULL) {
+       if(log == NULL || log_time == NULL) {
         LOGE("[%s] CALLLOG_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALLLOG_ERROR_INVALID_PARAMETER);
                return CALLLOG_ERROR_INVALID_PARAMETER;
     }
@@ -384,11 +384,30 @@ int calllog_query_calllog_by_number(calllog_foreach_cb cb, const char* number_to
                _calllog_safe_free(query_data.contact_image_path);
                _calllog_safe_free(query_data.phone_number);
                _calllog_safe_free(query_data.short_message);
+               if (!func_ret) {
+                       break;
+               }
        }
        
        contacts_svc_iter_remove(iter);
        return CALLLOG_ERROR_NONE;
 }
 
+int calllog_add_calllog_db_changed_cb(calllog_db_changed_cb callback, void *user_data)
+{
+       if(contacts_svc_subscribe_change(CTS_SUBSCRIBE_PLOG_CHANGE, callback, user_data) == CTS_SUCCESS)
+               return CALLLOG_ERROR_NONE;
+
+       LOGE("[%s] CALLLOG_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALLLOG_ERROR_INVALID_PARAMETER);
+       return CALLLOG_ERROR_INVALID_PARAMETER;
+}
 
+int calllog_remove_calllog_db_changed_cb(calllog_db_changed_cb callback)
+{
+       if(contacts_svc_unsubscribe_change(CTS_SUBSCRIBE_PLOG_CHANGE, callback) == CTS_SUCCESS)
+               return CALLLOG_ERROR_NONE;
+
+       LOGE("[%s] CONTACTS_ERROR_INVALID_PARAMETER(0x%08x)", __FUNCTION__, CALLLOG_ERROR_INVALID_PARAMETER);
+       return CALLLOG_ERROR_INVALID_PARAMETER;
+}