add APIs to set and get scale of the whole map 12/114212/3 accepted/tizen/common/20170213.174556 accepted/tizen/ivi/20170214.010638 accepted/tizen/mobile/20170214.010427 accepted/tizen/tv/20170214.010459 accepted/tizen/wearable/20170214.010603 submit/tizen/20170213.034030
authorchanywa <cbible.kim@samsung.com>
Fri, 10 Feb 2017 11:24:39 +0000 (20:24 +0900)
committerchanywa <cbible.kim@samsung.com>
Fri, 10 Feb 2017 11:32:01 +0000 (20:32 +0900)
Change-Id: I7e8ec3d641860e2f3ba458c29d32864e6e0f4656

capi-maps-service.changes
include/maps_view_plugin.h
packaging/capi-maps-service.spec
src/api/maps_view.cpp
src/plugin/empty_module.cpp
src/plugin/module.cpp
src/plugin/module.h

index 4b6508e..16ad586 100644 (file)
@@ -1,3 +1,8 @@
+[Version]   capi-maps-service_0.6.10
+[Date]      10 Feb 2017
+[Title]     add APIs to set and get scale of the whole map
+[Developer] Seechan Kim <cbible.kim@samsung.com>
+
 [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
index d5d7742..8014181 100644 (file)
@@ -133,6 +133,46 @@ int maps_view_get_maps_plugin_view_handle(maps_view_h view, void **maps_plugin_v
  */
 int maps_view_set_maps_plugin_view_handle(maps_view_h view, void *maps_plugin_view_handle);
 
+/**
+ * @brief Gets the scale factor of View.
+ * @details This function gets the current scale factor of View.
+ * @since_tizen 4.0
+ *
+ * @param[in] view The view handle
+ * @param[out] scale The pointer to a double in which to store the
+ * current scale factor
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre @a view is created using maps_view_create().
+ *
+ * @see maps_view_set_scale_factor()
+ * @see maps_view_create()
+ */
+int maps_view_get_scale_factor(maps_view_h view, double *scale_factor);
+
+/**
+ * @brief Sets the scale factor of View.
+ * @details This function sets the current scale factor of View.
+ * @remarks View is resizable based on this scale factor.
+ * @since_tizen 4.0
+ *
+ * @param[in] view The view handle
+ * @param[in] scale The new scale factor [0.1 ~ 10.0]
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre @a view is created using maps_view_create().
+ *
+ * @see maps_view_get_scale_factor()
+ * @see maps_view_create()
+ */
+int maps_view_set_scale_factor(maps_view_h view, double scale_factor);
+
 #ifdef __cplusplus
 }
 #endif
index a633229..0460bf6 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-maps-service
 Summary:    Tizen Maps Service API
-Version:    0.6.9
+Version:    0.6.10
 Release:    1
 Group:      Location/API
 License:    Apache-2.0
index 0499982..df89374 100644 (file)
@@ -1878,26 +1878,60 @@ maps_view_object_h _maps_view_object_hit_test(maps_view_h view, int x, int y, ma
        return htd.object;
 }
 
-EXPORT_API int maps_view_get_maps_plugin_view_handle(maps_view_h hView, void **maps_plugin_view_handle)
+EXPORT_API int maps_view_get_maps_plugin_view_handle(maps_view_h view, void **maps_plugin_view_handle)
 {
        if (!maps_condition_check_maps_feature())
                return MAPS_ERROR_NOT_SUPPORTED;
-       if (!hView || !maps_plugin_view_handle)
+       if (!view || !maps_plugin_view_handle)
                return MAPS_ERROR_INVALID_PARAMETER;
 
-       maps_view_s *v = (maps_view_s *)hView;
+       maps_view_s *v = (maps_view_s *)view;
        *maps_plugin_view_handle = v->maps_plugin_view_handle;
        return MAPS_ERROR_NONE;
 }
 
-EXPORT_API int maps_view_set_maps_plugin_view_handle(maps_view_h hView, void *maps_plugin_view_handle)
+EXPORT_API int maps_view_set_maps_plugin_view_handle(maps_view_h view, void *maps_plugin_view_handle)
 {
        if (!maps_condition_check_maps_feature())
                return MAPS_ERROR_NOT_SUPPORTED;
-       if (!hView)
+       if (!view)
                return MAPS_ERROR_INVALID_PARAMETER;
 
-       maps_view_s *v = (maps_view_s *)hView;
+       maps_view_s *v = (maps_view_s *)view;
        v->maps_plugin_view_handle = maps_plugin_view_handle;
        return MAPS_ERROR_NONE;
 }
+
+EXPORT_API int maps_view_get_scale_factor(maps_view_h view, double *scale_factor)
+{
+       if (!maps_condition_check_maps_feature())
+               return MAPS_ERROR_NOT_SUPPORTED;
+       if (!view || !scale_factor)
+               return MAPS_ERROR_INVALID_PARAMETER;
+
+       const plugin::interface_s *plugin = __get_plugin_interface(view);
+       if (!plugin)
+               return MAPS_ERROR_INVALID_PARAMETER;
+       if (!plugin->maps_plugin_get_view_scale_factor)
+               return MAPS_ERROR_NOT_SUPPORTED;
+       return plugin->maps_plugin_get_view_scale_factor(view, scale_factor);
+}
+
+EXPORT_API int maps_view_set_scale_factor(maps_view_h view, double scale_factor)
+{
+       if (!maps_condition_check_maps_feature())
+               return MAPS_ERROR_NOT_SUPPORTED;
+       if (!view)
+               return MAPS_ERROR_INVALID_PARAMETER;
+       if (scale_factor < 0.1 || scale_factor > 10.0)
+               return MAPS_ERROR_INVALID_PARAMETER;
+
+       const plugin::interface_s *plugin = __get_plugin_interface(view);
+       if (!plugin)
+               return MAPS_ERROR_INVALID_PARAMETER;
+       if (!plugin->maps_plugin_set_view_scale_factor)
+               return MAPS_ERROR_NOT_SUPPORTED;
+
+       return plugin->maps_plugin_set_view_scale_factor(view, scale_factor);
+}
+
index 8c52ab4..1f87a8a 100644 (file)
@@ -270,6 +270,17 @@ int maps_plugin_capture_snapshot_empty(maps_view_h view, void **data, int *width
        return 0;
 }
 
+int maps_plugin_get_view_scale_factor_empty(maps_view_h view, double *scale_factor)
+{
+       return 0;
+}
+
+int maps_plugin_set_view_scale_factor_empty(maps_view_h view, double scale_factor)
+{
+       return 0;
+}
+
+
 /* Interface of a plugin with all empty functions */
 plugin::interface_s empty_interface = {
        /* Plugin dedicated functions */
@@ -321,6 +332,8 @@ plugin::interface_s empty_interface = {
        maps_plugin_get_max_zoom_level_empty,
        maps_plugin_get_center_empty,
        maps_plugin_capture_snapshot_empty,
+       maps_plugin_get_view_scale_factor_empty,
+       maps_plugin_set_view_scale_factor_empty,
 };
 
 
index 3275878..f5a8bf5 100644 (file)
@@ -233,6 +233,12 @@ maps_plugin_h plugin::binary_extractor::init(const provider_info &info,
                new_plugin->interface.maps_plugin_capture_snapshot =
                        (maps_plugin_capture_snapshot_f) gmod_find_sym(plugin,
                        "maps_plugin_capture_snapshot");
+               new_plugin->interface.maps_plugin_get_view_scale_factor =
+                       (maps_plugin_get_view_scale_factor_f) gmod_find_sym(plugin,
+                       "maps_plugin_get_view_scale_factor");
+               new_plugin->interface.maps_plugin_set_view_scale_factor =
+                       (maps_plugin_set_view_scale_factor_f) gmod_find_sym(plugin,
+                       "maps_plugin_set_view_scale_factor");
 
                /* 2.3 Check whether the plugin init function is valid */
                if (!new_plugin->interface.maps_plugin_init) {
index 3905e9c..5e28f0b 100644 (file)
@@ -133,6 +133,8 @@ typedef int (*maps_plugin_get_max_zoom_level_f) (maps_view_h view, int *max_zoom
 typedef int (*maps_plugin_get_center_f) (maps_view_h view, maps_coordinates_h *coordinates);
 typedef int (*maps_plugin_capture_snapshot_f) (maps_view_h view, void **data,
                                                                int *width, int *height, maps_view_colorspace_type_e *cs);
+typedef int (*maps_plugin_get_view_scale_factor_f) (maps_view_h view, double *scale_factor);
+typedef int (*maps_plugin_set_view_scale_factor_f) (maps_view_h view, double scale_factor);
 
 namespace plugin {
 
@@ -188,6 +190,8 @@ typedef struct _interface_s {
        maps_plugin_get_max_zoom_level_f maps_plugin_get_max_zoom_level;
        maps_plugin_get_center_f maps_plugin_get_center;
        maps_plugin_capture_snapshot_f maps_plugin_capture_snapshot;
+       maps_plugin_get_view_scale_factor_f maps_plugin_get_view_scale_factor;
+       maps_plugin_set_view_scale_factor_f maps_plugin_set_view_scale_factor;
 } interface_s;
 
 /* Plugin structure */