diff options
author | chanywa <cbible.kim@samsung.com> | 2017-02-28 16:49:52 +0900 |
---|---|---|
committer | chanywa <cbible.kim@samsung.com> | 2017-06-01 14:04:40 +0900 |
commit | 764e212a7bd4c88e0a843cd8f37f3f77f1a1c247 (patch) | |
tree | abb3eaad4c0ddd832563f1c75d3d186c748dcfd8 | |
parent | 10bdb083d9a7cd1009f05e9ea1484d71fe018239 (diff) | |
download | maps-plugin-here-764e212a7bd4c88e0a843cd8f37f3f77f1a1c247.tar.gz maps-plugin-here-764e212a7bd4c88e0a843cd8f37f3f77f1a1c247.tar.bz2 maps-plugin-here-764e212a7bd4c88e0a843cd8f37f3f77f1a1c247.zip |
Fix preferred language to be applicatable to queries
Change-Id: I6368e8705886cdbf222f0a6c754a3b55f88020a5
-rw-r--r-- | inc/engine/common/TileKey.h | 34 | ||||
-rwxr-xr-x | inc/engine/maps/GeoTiledMap.h | 44 | ||||
-rw-r--r-- | inc/engine/routes/GeoRouteQuery.h | 123 | ||||
-rw-r--r-- | maps-plugin-here.changes | 5 | ||||
-rw-r--r-- | packaging/maps-plugin-here.spec | 2 | ||||
-rw-r--r-- | src/here_place.cpp | 7 | ||||
-rw-r--r-- | src/here_route.cpp | 7 |
7 files changed, 138 insertions, 84 deletions
diff --git a/inc/engine/common/TileKey.h b/inc/engine/common/TileKey.h index 77b2216..0024ff3 100644 --- a/inc/engine/common/TileKey.h +++ b/inc/engine/common/TileKey.h @@ -40,21 +40,21 @@ public: /** * This is a constructor. It initializes a new instance of the tile key with * the zoom level and the x and y coordinates of the tile at that zoom level. - * + * * @param aLevel A value indicating the zoom level. - * + * * @param aX A value indicating the x coordinate in the map tile grid. - * + * * @param aY A value indicating the y coordinate in the map tile grid. * * @param aMapLanguage A value indicating the map language. * * @param aMapLanguage A value indicating the map type. - */ + */ TileKey(int aLevel, int aX, int aY, - String sMapLanguage = String("eng"), + String sMapLanguage = String("en-US"), GeoTiledMap::MapType aMapType = GeoTiledMap::MT_Normal_Day) { m_aLevel = aLevel; @@ -64,9 +64,9 @@ public: m_aMapType = aMapType; } - /** + /** * This method is a copy constructor. - * + * * @param rRhs A constant reference to an object whose contents are to be * copied into the present instance. */ @@ -77,7 +77,7 @@ public: /** * This method retrieves a tile hash value based on the tile key properties. - * + * * @return An integer value representing the tile hash. */ int GetHash() const @@ -89,12 +89,12 @@ public: return hashValue; } - /** + /** * This is an equality operator. - * + * * @param rRhs A constant reference to an object that is to be compared to * the present instance. - * + * * @return <code>true</code> if the given instance and the right-hand object * are identical, otherwise <code>false</code>. */ @@ -107,12 +107,12 @@ public: m_aMapType == rRhs.m_aMapType; } - /** + /** * This is an assignment operator. - * + * * @param rRhs A constant reference to an object whose contents are to be * copied into the present instance. - * + * * @return A reference to the given instance of the class after the assignment. */ TileKey& operator = (const TileKey& rRhs) @@ -130,17 +130,17 @@ public: /** * This member variable holds a value indicating the tile zoom level. - */ + */ int m_aLevel; /** * This member variable holds a value indicating the x coordinate of the tile. - */ + */ int m_aX; /** * This member variable holds a value indicating the y coordinate of the tile. - */ + */ int m_aY; /** diff --git a/inc/engine/maps/GeoTiledMap.h b/inc/engine/maps/GeoTiledMap.h index 126ad22..673e472 100755 --- a/inc/engine/maps/GeoTiledMap.h +++ b/inc/engine/maps/GeoTiledMap.h @@ -373,20 +373,31 @@ public: */ void SetUpdateMapSignal(UpdateMapSignalFunctor slot); - /** - * This method sets the map type. - * - * @param aMapType A value indicating the new map type. - */ + /** + * This method sets the map type. + * + * @param aMapType A value indicating the new map type. + */ void SetMapType(MapType aMapType); - /** - * This method retrieves the map type. - * - * @return A value indicating the current map type. - */ + /** + * This method retrieves the map type. + * + * @return A value indicating the current map type. + */ MapType GetMapType() const; +#ifdef TIZEN_MIGRATION + /** + * This method retrieves the current language of the map. + * + * A language is specified as an ISO 3166 alpha-2 two letter country-code + * followed by ISO 639-1 for the two-letter language code. + * Each language tag is composed of one or more "subtags" separated by hyphens (-). + * Each subtag is composed of basic Latin letters or digits only. + * For example, "ko-KR" for Korean, "en-US" for American English. + */ +#else /* * Available language options are: * L"ara", L"chi", L"cht", L"dut", L"eng", L"ger", L"gle", L"fre", L"ita", L"spa", L"rus", L"pol", L"gre", L"wel" @@ -401,8 +412,20 @@ public: * "ita" (Italian), "spa" (Spanish), "rus" (Russian), "pol" (Polish), * "gre" (Greek), "wel" (Welsh) */ +#endif void SetMapLanguage(const String& aMapLanguage); +#ifdef TIZEN_MIGRATION + /** + * This method retrieves the current language of the map. + * + * A language is specified as an ISO 3166 alpha-2 two letter country-code + * followed by ISO 639-1 for the two-letter language code. + * Each language tag is composed of one or more "subtags" separated by hyphens (-). + * Each subtag is composed of basic Latin letters or digits only. + * For example, "ko-KR" for Korean, "en-US" for American English. + */ +#else /** * This method retrieves the current language of the map. * @@ -412,6 +435,7 @@ public: * "gle" (Irish), "fre" (French), "ita" (Italian), "spa" (Spanish), * "rus" (Russian), "pol" (Polish), "gre" (Greek), "wel" (Welsh) */ +#endif const String& GetMapLanguage() const; /** diff --git a/inc/engine/routes/GeoRouteQuery.h b/inc/engine/routes/GeoRouteQuery.h index 6507c1e..d500827 100644 --- a/inc/engine/routes/GeoRouteQuery.h +++ b/inc/engine/routes/GeoRouteQuery.h @@ -38,7 +38,7 @@ class GeoRouteQueryListener; * start and end points, waypoints (the locations through which the route must * pass), areas to include and to avoid, mode of travel, route features with * weighting, required optimization, etc. - * + * * \ingroup routes */ class EXPORT_API GeoRouteQuery : public BaseQuery @@ -46,7 +46,7 @@ class EXPORT_API GeoRouteQuery : public BaseQuery public: /** - * This enumeration defines identifiers for the supported modes of travel. + * This enumeration defines identifiers for the supported modes of travel. */ enum TravelMode { TM_CarTravel = 0x0001, ///< Indicates that the route is to be @@ -59,7 +59,7 @@ public: /** * This enumeration defines identifiers for the supported route feature * types, feature types that can be favored or excluded by the route - * calculation. + * calculation. */ enum FeatureType { FT_NoFeature = 0x00000000, ///< Indicates no route features (are selected). @@ -68,22 +68,22 @@ public: FT_BoatFerryFeature = 0x00000004, ///< Indicates a boat ferry. FT_RailFerryFeature = 0x00000008, ///< Indicates rail (train) ferry. FT_PublicTransitFeature = 0x00000010, ///< Indicates public transport. - FT_TunnelFeature = 0x00000020, ///< Indicates tunnel. + FT_TunnelFeature = 0x00000020, ///< Indicates tunnel. FT_DirtRoadFeature = 0x00000040, ///< Indicates dirt road. - FT_ParksFeature = 0x00000080, ///< Indicates park. - FT_HOVLane = 0x00000100, ///< Indicates a high-occupancy vehicle lane. + FT_ParksFeature = 0x00000080, ///< Indicates park. + FT_HOVLane = 0x00000100, ///< Indicates a high-occupancy vehicle lane. FT_Stairs = 0x00000200 ///< Indicates stairs. - }; + }; - /** - * This enumeration defines identifiers for the supported route feature weighting. + /** + * This enumeration defines identifiers for the supported route feature weighting. */ enum FeatureWeight { FW_NormalFeatureWeight = 0x00000000, ///< Indicates normal weighting. FW_PreferFeatureWeight = 0x00000001, ///< Indicates that a feature is preferred. - FW_AvoidFeatureWeight = 0x00000002, ///< Indicates that a feature is to be avoided. + FW_AvoidFeatureWeight = 0x00000002, ///< Indicates that a feature is to be avoided. FW_SoftExcludeFeatureWeight = 0x00000004, ///< Indicates that soft-exclude applies to the feature. - FW_StrictExcludeFeatureWeight = 0x00000008 ///< Indicates that the feature is to be strictly excluded. + FW_StrictExcludeFeatureWeight = 0x00000008 ///< Indicates that the feature is to be strictly excluded. }; /** @@ -91,24 +91,24 @@ public: */ typedef std::map< GeoRouteQuery::FeatureType, GeoRouteQuery::FeatureWeight > FeaturesMap; - /** - * This enumeration defines identifiers for the supported route optimizations. + /** + * This enumeration defines identifiers for the supported route optimizations. */ enum RouteOptimization { RO_ShortestRoute = 0x0001, ///< Indicates the shortest route. RO_FastestRoute = 0x0002, ///< Indicates the fastest route. }; - /** - * This enumeration defines identifiers for route segment detail specifiers. + /** + * This enumeration defines identifiers for route segment detail specifiers. */ enum SegmentDetail { SD_NoSegmentData = 0x0000, ///< Indicates that no route segment data are to be included. SD_BasicSegmentData = 0x0001 ///< Indicates that basic route segment data are to be included. }; - /** - * This enumeration defines identifiers for route maneuver specifiers. + /** + * This enumeration defines identifiers for route maneuver specifiers. */ enum ManeuverDetail { MD_NoManeuvers = 0x0000, ///< Indicates that manuevers are to be included int he route. @@ -116,7 +116,7 @@ public: }; #ifdef TIZEN_CUSTOMIZATION - /** + /** * This enumeration defines identifiers for route MetricSystem specifiers. */ enum MetricSystem { @@ -128,7 +128,7 @@ public: /** * This method is a constructor that initializes a new instance of the * class, using the list of waypoints supplied by the caller. - * + * * @param rWaypoints A constant reference to a vector of instances of * <code>GeoCoordinates</code> that define the route waypoints. */ @@ -138,11 +138,11 @@ public: * This method is a constructor that initializes a new instance of the * class, using the objects representing the route origin and destination * supplied by the caller. - * + * * @param rOrigin A constant reference to an object that defines the point * of origin for the route. - * - * @param rDestination A constant reference to an object that defines the + * + * @param rDestination A constant reference to an object that defines the * destination for the route. */ GeoRouteQuery(const GeoCoordinates &rOrigin, const GeoCoordinates &rDestination); @@ -151,20 +151,20 @@ public: * This method is a copy constructor that initializes a new instance of the * class by copying the values of the properties of the object supplied by * the caller. - * + * * @param rRhs A constant reference to an object whose property values are * to be used to initialize a new instance of the class. */ GeoRouteQuery(const GeoRouteQuery &rRhs); - /** + /** * This method is the destructor for objects of this class. */ ~GeoRouteQuery(); - /** + /** * This is the assignment operator. - * + * * @param rRhs A constant reference to an object whose property values are * to be copied to the given instance. */ @@ -173,7 +173,7 @@ public: /** * This method sets route waypoints, using the list of objects supplied by * the caller. - * + * * @param rWaypoints A constant reference to a vector of instances of * <code>GeoCoordinates</code> that define the route waypoints. */ @@ -181,25 +181,25 @@ public: /** * This method retrieves the route waypoints. - * + * * @return A vector of instances of <code>GeoCoordinates</code> that define * the route waypoints. */ GeoCoordinateList GetWaypoints() const; - /** + /** * This method sets areas through which the route must not pass, using a * list of bounding box objects supplied by the caller. - * + * * @param rAreas A constant reference to a list of bounding box objects that * define the areas the route must avoid. */ void SetExcludeAreas(const GeoBoundingBoxList &rAreas); - /** + /** * This method retrieves a list of bounding boxes that defines areas through - * which the route must not pass. - * + * which the route must not pass. + * * @return A list of bounding box objects that define the areas the route * must avoid. */ @@ -208,7 +208,7 @@ public: // defaults to TravelByCar /** * This method sets the travel mode to be used in the route query. - * + * * @param aTravelModes A value indicating the travel mode to use in the * query. */ @@ -216,7 +216,7 @@ public: /** * This method retrieves the travel mode used in the route query. - * + * * @return A value indicating the travel mode used in the * query. */ @@ -224,22 +224,22 @@ public: /** * This method associates weighting with a feature to be used in the route - * query. - * + * query. + * * @param aFeatureType A value indicating the feature type to which the * weighting is to apply. - * + * * @param aFeatureWeight A value indicating the weighting to apply. */ void SetFeatureWeight(FeatureType aFeatureType, FeatureWeight aFeatureWeight); /** * This method retrieves the weighting for the feature type specified by the - * caller. - * - * @param aFeatureType A value indicating the feature type for which to + * caller. + * + * @param aFeatureType A value indicating the feature type for which to * retrieve weighting. - * + * * @return A value indicating the weighting associated with the named route * feature. */ @@ -248,7 +248,7 @@ public: /** * This method retrieves a map of route feature types specified for the * given query. - * + * * @return An object containing a map of route feature types specified for * the given query. */ @@ -257,7 +257,7 @@ public: // defaults to OptimizeFastes) /** * This method sets the route optimization option for the given query. - * + * * @param aOptimization A value indicating the route optimization option to * set for the given query. */ @@ -266,7 +266,7 @@ public: /** * This method retrieves the route optimization selector set for the given * query. - * + * * @return A value indicating the route optimization selector set for the * given query. */ @@ -275,7 +275,7 @@ public: // defaults to BasicSegmentData /** * This method sets the segment detail selector for the given query. - * + * * @param aSegmentDetail A value indicating the segment detail selector for * the given query. */ @@ -283,7 +283,7 @@ public: /** * This method retrieves the segment detail selector for the given query. - * + * * @return A value indicating the segment detail selector set for the given * query. */ @@ -292,8 +292,8 @@ public: // defaults to BasicManeuvers /** * This method sets the maneuver detail selector for the given - * query. - * + * query. + * * @param aManeuverDetail A value indicating the maneuver detail selector for * the given query. */ @@ -301,8 +301,8 @@ public: /** * This method retrieves the maneuver detail selector set for the given - * query. - * + * query. + * * @return A value indicating the maneuver detail selector for * the given query. */ @@ -311,7 +311,7 @@ public: #ifdef TIZEN_CUSTOMIZATION /** * This method sets the MetricSystem selector for the given - * query. + * query. * * @param aMetricSystem A value indicating the MetricSystemselector for * the given query. @@ -400,15 +400,30 @@ public: * @return An value indicating the arrival time. */ time_t GetArrivalTime(void) const; + + /** + * This method retrieves a BCP 47 identifier of the search language. + * + * @return A string containing a BCP 47 identifier of the language. + */ + String GetLanguage() const; + + /** + * This method sets the langauge, using a BCP 47 langauge code. + * + * @param sSearch A constant reference to a string containing a BCP 47 + * identifier of the language. + */ + void SetLanguage(const String& sLang); #endif /** * This method attempts to establish a connection with the server and then, * if the connection has been established, it builds and submits a query. - * + * * @rListener rListener A reference to an object that is to be notified when * the reply to the query has arrived from the server. - * + * * @param pUserData A pointer to user data to be passed back within the * corresponding reply object. * diff --git a/maps-plugin-here.changes b/maps-plugin-here.changes index 8362637..c143831 100644 --- a/maps-plugin-here.changes +++ b/maps-plugin-here.changes @@ -1,3 +1,8 @@ +[Version] maps-plugin-here_0.3.18 +[Date] 28 Feb 2017 +[Title] Fix preferred language to be applicatable to queries +[Developer] Seechan Kim <cbible.kim@samsung.com> + [Version] maps-plugin-here_0.3.17 [Date] 10 Feb 2017 [Title] add APIs to set and get scale of the whole map diff --git a/packaging/maps-plugin-here.spec b/packaging/maps-plugin-here.spec index 2d0cf5a..6a77d09 100644 --- a/packaging/maps-plugin-here.spec +++ b/packaging/maps-plugin-here.spec @@ -1,6 +1,6 @@ Name: maps-plugin-here Summary: Tizen HERE Maps Plug-in Library -Version: 0.3.17 +Version: 0.3.18 Release: 1 Group: Location/Libraries License: Apache-2.0 and HERE diff --git a/src/here_place.cpp b/src/here_place.cpp index fd6af49..a2082ea 100644 --- a/src/here_place.cpp +++ b/src/here_place.cpp @@ -336,10 +336,13 @@ here_error_e HerePlace::StartPlaceDetailsInternal(const char *szUrl) if (!szUrl || (szUrl && strlen(szUrl) <= 0)) return HERE_ERROR_INVALID_PARAMETER; - std::unique_ptr<PlaceDetailsQuery> pPlaceDetailsQuery (new (std::nothrow)PlaceDetailsQuery()); + String fullUrl = szUrl; + if (m_pDiscoveryQuery && m_pDiscoveryQuery->GetLanguage().length() > 0) + fullUrl += "&Accept-Language=" + m_pDiscoveryQuery->GetLanguage(); + std::unique_ptr<PlaceDetailsQuery> pPlaceDetailsQuery (new (std::nothrow)PlaceDetailsQuery()); m_bPlaceDetailsInternal = true; - bool bExcuted = (int)(pPlaceDetailsQuery->Execute(*this, NULL, szUrl) > 0); + bool bExcuted = (int)(pPlaceDetailsQuery->Execute(*this, NULL, fullUrl.c_str()) > 0); return (bExcuted ? HERE_ERROR_NONE : HERE_ERROR_INVALID_OPERATION); } diff --git a/src/here_route.cpp b/src/here_route.cpp index b547068..8ea6c75 100644 --- a/src/here_route.cpp +++ b/src/here_route.cpp @@ -203,6 +203,13 @@ here_error_e HereRoute::PreparePreference(maps_preference_h hPref) g_free(szRealtimeTraffic); } + char *szLanguage = NULL; + if (maps_preference_get_language(hPref, &szLanguage) == MAPS_ERROR_NONE) + { + m_pQuery->SetLanguage(szLanguage); + g_free(szLanguage); + } + return HERE_ERROR_NONE; } |