added an api for plugins to get length of maps_item_list_h 47/99847/3
authorchanywa <cbible.kim@samsung.com>
Thu, 24 Nov 2016 08:38:34 +0000 (17:38 +0900)
committerSeechan Kim <cbible.kim@samsung.com>
Thu, 24 Nov 2016 08:56:05 +0000 (00:56 -0800)
Change-Id: I87d59865248a08cb8ca117fd62a78c9aab6363e2

capi-maps-service.changes
include/maps_extra_types.h
packaging/capi-maps-service.spec
src/api/maps_extra_types.cpp

index a04a5a7..4b6508e 100644 (file)
@@ -1,3 +1,8 @@
+[Version]   capi-maps-service_0.6.9
+[Date]      24 Nov 2016
+[Title]     added an api for plugins to get length of maps_item_list_h
+[Developer] Seechan Kim <cbible.kim@samsung.com>
+
 [Version]   capi-maps-service_0.6.8
 [Date]      11 Nov 2016
 [Title]     fixed some bugs and improved gestures
index f166d28..9c8f9ea 100644 (file)
@@ -349,6 +349,23 @@ typedef bool(*maps_item_list_foreach_noclone_cb) (int index, void *data, void *u
 int maps_item_list_foreach_noclone(maps_item_list_h list, maps_item_list_foreach_noclone_cb callback, void *user_data);
 
 /**
+ * @brief      Gets the number of elements in the specified list.
+ * @since_tizen 3.0
+ *
+ * @param[in]  list    The handle of list
+ * @param[out] length  The number of elements in the specified list
+ * @return     0 on success, otherwise a negative error value
+ * @retval     #MAPS_ERROR_NONE Successful
+ * @retval     #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre @a list is created using maps_item_list_create().
+ *
+ * @see maps_item_list_create()
+ * @see maps_item_list_append()
+ */
+int maps_item_list_get_length(maps_item_list_h list, int *length);
+
+/**
  * @}
  */
 
index 39cf550..29f6169 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-maps-service
 Summary:    Tizen Maps Service API
-Version:    0.6.8
+Version:    0.6.9
 Release:    1
 Group:      Location/API
 License:    Apache-2.0
index d0eb1bf..2d51933 100644 (file)
@@ -214,6 +214,20 @@ EXPORT_API int maps_item_list_clone(const maps_item_list_h origin,
        return error;
 }
 
+EXPORT_API int maps_item_list_get_length(maps_item_list_h list, int *length)
+{
+       if (!maps_condition_check_maps_feature())
+               return MAPS_ERROR_NOT_SUPPORTED;
+       if (!list || !length)
+               return MAPS_ERROR_INVALID_PARAMETER;
+       maps_item_list_s *l = (maps_item_list_s *)list;
+       if (!l->l)
+               *length = 0;
+       else
+               *length = g_list_length(l->l);
+       return MAPS_ERROR_NONE;
+}
+
 /*----------------------------------------------------------------------------*/
 
 typedef struct _maps_string_hashtable_s