int maps_preference_get_route_alternatives_enabled(const maps_preference_h preference,
bool *enable);
+/**
+ * @brief Gets the departure time of a route.
+ * @details This function retrieves the departure time of a route.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @param[in] preference The preference handle
+ * @param[out] time The departure time
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int maps_preference_get_route_departure_time(const maps_preference_h preference,
+ time_t *time);
+
/**
* @brief Gets the maps preference value by key.
* @details This function gets the maps preference value by key.
int maps_preference_set_route_alternatives_enabled(maps_preference_h preference,
bool enable);
+/**
+ * @brief Sets the departure time of a route.
+ * @details This function sets the departure time of a route.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @param[in] preference The preference handle
+ * @param[in] time The departure time
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int maps_preference_set_route_departure_time(const maps_preference_h preference,
+ time_t time);
+
/**
* @brief Sets the preference value by key.
* @details This function sets the preference value assigned with a specified
#ifndef __MAPS_ROUTE_H__
#define __MAPS_ROUTE_H__
+#include <time.h>
#include <tizen_type.h>
#include <maps_area.h>
#include <maps_route_segment.h>
*/
int maps_view_object_polyline_set_polyline(maps_view_object_h polyline, maps_coordinates_list_h points);
+/**
+ * @brief Appends a point to the polyline.
+ * @details This function appends a point to the polyline.
+ * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
+ *
+ * @param[in] polyline The polyline object handle
+ * @param[in] point The point to append
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre @a polyline is created using maps_view_object_create_polyline().
+ * @pre @a point is created using maps_coordinates_create().
+ *
+ * @see #maps_view_object_h
+ * @see #maps_coordinates_h
+ * @see maps_coordinates_create()
+ * @see maps_view_object_create_polyline()
+ * @see maps_view_object_polyline_foreach_point()
+ */
+int maps_view_object_polyline_append_point(maps_view_object_h polyline, maps_coordinates_h point);
+
/**
* @brief Retrieves all points, added to the polyline.
* @details This function retrieves all points, added to the polyline.
g_str_hash("MAPS_PREFERENCE_ROUTE_TRANSPORT_MODE"),
g_str_hash("MAPS_PREFERENCE_ROUTE_FEATURE_WEIGHT"),
g_str_hash("MAPS_PREFERENCE_ROUTE_FEATURE"),
- g_str_hash("MAPS_PREFERENCE_ROUTE_ALTERNATIVES")
+ g_str_hash("MAPS_PREFERENCE_ROUTE_ALTERNATIVES"),
+ g_str_hash("MAPS_PREFERENCE_ROUTE_DEPARTURE_TIME"),
};
const int size = sizeof(names) / sizeof(names[0]);
if (error != MAPS_ERROR_NONE)
break;
+ error = maps_item_hashtable_set_int(*preference, "MAPS_PREFERENCE_ROUTE_DEPARTURE_TIME", 0);
+ if (error != MAPS_ERROR_NONE)
+ break;
+
return MAPS_ERROR_NONE;
} while (0);
EXPORT_API int maps_preference_get_route_alternatives_enabled(
const maps_preference_h preference, bool *enable)
{
- if (!preference)
+ if (!preference || !enable)
return MAPS_ERROR_INVALID_PARAMETER;
-
- int alternatives;
- int error = maps_item_hashtable_get_int(preference, "MAPS_PREFERENCE_ROUTE_ALTERNATIVES", &alternatives);
+ int alternatives = 0;
+ int error = maps_item_hashtable_get_int(preference,
+ "MAPS_PREFERENCE_ROUTE_ALTERNATIVES", &alternatives);
if (error != MAPS_ERROR_NONE)
return error;
-
*enable = (alternatives == _DEFAULT_ALTERNATIVES_SIZE) ? true :false;
-
return MAPS_ERROR_NONE;
}
+EXPORT_API int maps_preference_get_route_departure_time(const maps_preference_h preference,
+ time_t *time)
+{
+ if (!preference || !time)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ return maps_item_hashtable_get_int(preference,
+ "MAPS_PREFERENCE_ROUTE_DEPARTURE_TIME", (int *)time);
+}
+
EXPORT_API int maps_preference_get(const maps_preference_h preference,
const char *key, char **value)
{
{
if (!preference)
return MAPS_ERROR_INVALID_PARAMETER;
+ int alternatives = _DEFAULT_ALTERNATIVES_SIZE * enable;
+ return maps_item_hashtable_set_int(preference,
+ "MAPS_PREFERENCE_ROUTE_ALTERNATIVES", alternatives);
+}
- int alternatives = 0;
- if (enable)
- alternatives = _DEFAULT_ALTERNATIVES_SIZE;
-
- return maps_item_hashtable_set_int(preference, "MAPS_PREFERENCE_ROUTE_ALTERNATIVES", alternatives);
+EXPORT_API int maps_preference_set_route_departure_time(const maps_preference_h preference,
+ time_t time)
+{
+ if (!preference)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ return maps_item_hashtable_set_int(preference,
+ "MAPS_PREFERENCE_ROUTE_DEPARTURE_TIME", (int)time);
}
EXPORT_API int maps_preference_set_property(maps_preference_h preference,
return MAPS_ERROR_NONE;
}
+EXPORT_API int maps_view_object_polyline_append_point(maps_view_object_h polyline,
+ maps_coordinates_h point)
+{
+ if (!polyline || !point)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ /* Get the polyline data pointer */
+ maps_view_polyline_data_s *p = __get_polyline_data(polyline);
+ if (!p)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ /* Set new polyline trajectory */
+ int error = MAPS_ERROR_NONE;
+ do {
+ if (!p->points) {
+ error = maps_coordinates_list_create(&p->points);
+ if (error != MAPS_ERROR_NONE)
+ break;
+ }
+
+ error = maps_coordinates_list_append(p->points, point);
+ if (error != MAPS_ERROR_NONE)
+ break;
+
+ /* Notify view, that the object specific preferences is changed */
+ _maps_view_on_object_operation(__get_view(polyline), polyline, MAPS_VIEW_OBJECT_CHANGE);
+ } while(0);
+
+ return error;
+}
+
EXPORT_API int maps_view_object_polyline_foreach_point(maps_view_object_h polyline,
maps_coordinates_cb callback, void *user_data)
{