Added to parse PlaceAttributes data 70/80470/3
authorchanywa <cbible.kim@samsung.com>
Mon, 18 Jul 2016 07:54:07 +0000 (16:54 +0900)
committerchanywa <cbible.kim@samsung.com>
Tue, 19 Jul 2016 07:09:20 +0000 (16:09 +0900)
Change-Id: Ia5b98d6409f29f2ece711d46afeb5127c0f73b13

22 files changed:
heremaps-uc/org.tizen.heremaps-uc.xml
heremaps-uc/src/heremaps-uc.c
inc/engine/finder/ExtendedAttribute.h
inc/engine/internal/JsonParser.h
inc/engine/internal/RestCurl.h
inc/engine/maps/GeoMapObjectMarker.h
inc/engine/maps/GeoTile.h
inc/engine/maps/GeoTiledMap.h
inc/engine/routes/GeoRouteQuery.h
inc/engine/tilefetcher/TileFetcherCache.h [changed mode: 0644->0755]
inc/engine/tilefetcher/TileFetcherQuery.h
inc/here_place.h
lib/aarch64/libheremaps-engine.so.1
lib/aarch64/libheremaps-engine.so.1.0.6_14 [moved from lib/aarch64/libheremaps-engine.so.1.0.6_13 with 65% similarity]
lib/arm/libheremaps-engine.so.1
lib/arm/libheremaps-engine.so.1.0.6_14 [moved from lib/arm/libheremaps-engine.so.1.0.6_13 with 62% similarity]
lib/i586/libheremaps-engine.so.1
lib/i586/libheremaps-engine.so.1.0.6_14 [moved from lib/i586/libheremaps-engine.so.1.0.6_13 with 62% similarity]
lib/x86_64/libheremaps-engine.so.1
lib/x86_64/libheremaps-engine.so.1.0.6_14 [moved from lib/x86_64/libheremaps-engine.so.1.0.6_13 with 65% similarity]
src/here_place.cpp
src/here_view_objects.cpp

index 4d43b60..6f5d925 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.heremaps-uc" api-version="2.4" version="1.0.0" install-location="internal-only">
        <label>HereMaps UC</label>
-       <author email="youngae.kang@samsung.com" href="www.samsung.com">Youngae kang</author>
+       <author email="cbible.kim@samsung.com" href="www.samsung.com">Seechan Kim</author>
        <author email="jongmun.woo@samsung.com" href="www.samsung.com">JongMun Woo</author>
        <description>HereMaps User Consent application</description>
        <privileges>
index 659f1fb..088674a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
- * Contact: Jongmun Woo <jongmun.woo@samsung.com>, Young-Ae Kang <youngae.kang@samsung.com>
+ * Contact: Jongmun Woo <jongmun.woo@samsung.com>, Seechan Kim <cbible.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index b882cb3..2637432 100755 (executable)
@@ -38,7 +38,7 @@ typedef std::vector< ExtendedAttribute > ExtendedAttributeList;
  * 
  * \ingroup finder
  */
-class ExtendedAttribute
+class EXPORT_API ExtendedAttribute
 {
 public:
     /**
index 7fa4c40..0ca02e2 100755 (executable)
@@ -118,15 +118,23 @@ private:
 
     static void ParseAddress( JsonObject* json_data, Address& address );
 
+#ifdef TIZEN_MIGRATION
+    static void ParseContacts( JsonArray* json_data, ContactDetailsList& contacts );
+
     static void ParseContacts( JsonArray* json_data, const String& key,
                                ContactDetailsList& contacts );
-#ifndef TIZEN_MIGRATION
+
+    static void ParseLinkObject( JsonObject* json_data, LinkObject& link_object );
+#else
+    static void ParseContacts( JsonArray* json_data, const String& key,
+                               ContactDetailsList& contacts );
+
     static void ParseLinkObject( IJsonValue* json_data,
                                    const char* object_name,
                                    LinkObject& link_object );
-#endif
+
     static void ParseLinkObject( JsonObject* json_data, LinkObject& link_object );
-#ifndef TIZEN_MIGRATION
+
     static void ParseLinkObject( JsonObject* json_data,
                                    const char* object_name,
                                    LinkObject& link_object );
index ba0670c..371affe 100755 (executable)
@@ -69,10 +69,10 @@ private:
        bool CreateDetachedThread(void* (*pFunc)(void*), void *pArgs);
 
        #ifdef TIZEN_SUPPORT_CRYPTO_LOCK
-       static void CRYPTO_MutexLock(int mode, int type, char *file, int line);
-       static void CRYPTO_InitMutexLocks(void);
-       static void CRYPTO_KillMutexLocks(void);
-       static unsigned long CRYPTO_ThreadId(void);
+       static void CryptoMutexLock(int mode, int type, char *file, int line);
+       static void CryptoInitMutexLocks(void);
+       static void CryptoKillMutexLocks(void);
+       static unsigned long CryptoThreadId(void);
        #endif
 
        class RestCurlImpl;
index d2e4693..8f68817 100755 (executable)
@@ -159,14 +159,14 @@ public:
      *
      * @return A value indicating z-order to the bitmap.
      */
-    int GetZorder() const;
+    int GetZOrder() const;
 
     /**
      * This method sets the marker z-order.
      *
      * @param nZorder A constant value of z-order.
      */
-    void SetZorder(int nZorder);
+    void SetZOrder(int nZorder);
 #endif
 
 private:
index a0d6910..7c62135 100755 (executable)
@@ -271,9 +271,9 @@ public:
     void AbortLoading();
 
 #ifdef TIZEN_SUPPORT_LIMIT_RETRYING_FETCHING_TILES
-    int GetTryCount();
+    int GetTryCount() const;
 
-    int SetTryCount(int cnt);
+    int SetTryCount(int count);
 #endif
 
 private:
index dcf54e8..de73f2d 100755 (executable)
@@ -86,24 +86,24 @@ public:
         MT_Normal_Day_Custom,
         MT_Normal_Night,
         MT_Normal_Night_Grey,
-        MT_Pedestrian_Day,
-        MT_Pedestrian_Day_Mobile,
-        MT_Pedestrian_Night,
-        MT_Pedestrian_Night_Mobile,
-        MT_Carnav_Day_Grey,
         MT_Normal_Day_Mobile,
         MT_Normal_Day_Grey_Mobile,
         MT_Normal_Day_Transit_Mobile,
         MT_Normal_Night_Transit_Mobile,
         MT_Normal_Night_Mobile,
         MT_Normal_Night_Grey_Mobile,
-        MT_Reduced_Day,
-        MT_Reduced_Night,
         MT_Hybrid_Day_Transit,
         MT_Hybrid_Grey_Day,
         MT_Hybrid_Traffic_Day,
         MT_Hybrid_Day_Mobile,
         MT_Terrain_Day_Mobile,
+        MT_Pedestrian_Day,
+        MT_Pedestrian_Day_Mobile,
+        MT_Pedestrian_Night,
+        MT_Pedestrian_Night_Mobile,
+        MT_Reduced_Day,
+        MT_Reduced_Night,
+        MT_Carnav_Day_Grey,
 #endif
         MT_Last_Entry_Undefined         ///< Indicates that the map type is not
                                         ///  defined. 
@@ -191,7 +191,7 @@ public:
      *
      * @return A value indicating the maximum map zoom level.
      */
-    void SetMaximumZoomLevel(double zoom);
+    void SetMaximumZoomLevel(double zoomLevel);
 #endif
    
     /**
@@ -444,7 +444,7 @@ public:
      * 
      * @return An pointer indicating the bitmap of the root tile.
      */
-    DrawableBitmapPtr GetRootPixmap();
+    DrawableBitmapPtr GetRootPixmap() const;
 
     /**
      * This method sets a pointer of a structure of the Evas GL API object that
@@ -482,7 +482,7 @@ public:
      *
      * @return A value indicating the angle of the map.
      */
-    double GetAngle();
+    double GetAngle() const;
 
     /**
      * This method sets a Boolean value indicating if the scale bar is enabled or not.
index 2c18a40..eb3480d 100755 (executable)
@@ -323,7 +323,7 @@ public:
      * @return A value indicating the MetricSystem selector for
      *        the given query.
      */
-    GeoRouteQuery::MetricSystem GetMetricSystem(void);
+    GeoRouteQuery::MetricSystem GetMetricSystem(void) const;
 
     /**
      * This method sets the bounding area for the given query.
@@ -339,7 +339,7 @@ public:
      * @return A value indicating the bounding area for
      *        the given query.
      */
-    GeoBoundingBox GetViewBounds(void);
+    GeoBoundingBox GetViewBounds(void) const;
 
     /**
      * This method sets a value that indicates the maximum number of alternative routes
old mode 100644 (file)
new mode 100755 (executable)
index 05f641b..67a4e9c
@@ -52,62 +52,149 @@ public:
 
 typedef std::list<TileCache> TileCacheList;
 
+/**
+ *
+ * This class encapsulates a caching system for map tiles based on the file system.
+ *
+ */
+
 class TileFetcherCache
 {
 public:
+    /**
+     * This method is the default constructor.
+     */
        TileFetcherCache();
 
+    /**
+     * This method is the (virtual) destructor.
+     */
        virtual ~TileFetcherCache();
 
+    /**
+     * This method is to get the instance of this class.
+     */
        static TileFetcherCache& GetInstance();
 
+    /**
+     * This method is to clear caching system.
+     */
        void shutdown();
 
+    /**
+     * This method is to remove a tile having the hash.
+     */
        bool remove(const int hash);
 
+    /**
+     * This method is to check if there is a tile having the hash.
+     */
        bool isFound(const int hash);
 
+    /**
+     * This method is to get the iterator of a tile having the hash.
+     */
        TileCacheList::iterator find(const int hash);
 
+    /**
+     * This method is to read a tile having the hash from own file system.
+     *
+     * @param  hash    A value of hash indicating the tile
+     * @param  buffer  A buffer to store the map tile
+     * @param  size    A size of map tile (bytes)
+     */
        unsigned long read(const int hash, unsigned char *&buffer, unsigned long &size);
 
+    /**
+     * This method is to write a tile having the hash to own file system.
+     *
+     * @param  hash    A value of hash indicating the tile
+     * @param  buffer  A buffer stored the map tile
+     * @param  size    A size of map tile (bytes)
+     */
        unsigned long write(const int hash, const unsigned char *buffer, const unsigned long size);
 
+    /**
+     * This method is to clear all of cache files.
+     */
        void clearCache();
 
-       Here::Maps::RestItemHandle::RequestId load(const Here::Maps::TileKey &rKey, Here::Maps::TileFetcherQueryListener &rListener);
-
+    /**
+     * This method is to abort the request to get a tile from the cache.
+     */
        void abort(void *pArg);
 
+    /**
+     * This method is to request to get a tile from the cache.
+     */
        void fire(void *pArg);
 
 private:
        HERE_MAPS_NO_COPY_NO_ASSIGN(TileFetcherCache);
 
+    /**
+     * This method is to initialize the cache by scanning and building the list of already cached tiles.
+     */
        void __initCache();
 
+    /**
+     * This method is to compare hit rates of tiles to decide which one will be removed.
+     */
        static bool __compareTileCache(const TileCache& first, const TileCache& second);
 
+    /**
+     * This method is to check if more tiles can be stored.
+     */
        bool __checkCapacity(void);
 
+    /**
+     * This method is to check if more tiles can be stored with only free space.
+     */
        bool __isAvailableSpace(void);
 
+    /**
+     * This method is to check if more tiles can be stored with only the count of tiles.
+     */
        bool __isAvailableCount(void);
 
+    /**
+     * This method is to get the path where tile files are stored in.
+     */
        bool __getCachePath(char *path, int size);
 
+    /**
+     * This method is to get the path of the tile.
+     */
        bool __getFilePath(const int hash, char *path, int size);
 
+    /**
+     * This method is to get the path of the tile.
+     */
        bool __getFilePath(const char *fname, char *path, int size);
 
+    /**
+     * This method is to get the hash from the file name.
+     */
        int __parseHash(const char *fname);
 
+    /**
+     * This method is a timer callback to delay loading time.
+     */
        static gboolean __fireTimer(gpointer data);
 
+    /**
+     * This method is a timer callback to delay loading time.
+     */
        static gboolean __fireIdler(gpointer data);
 
+    /**
+     * This method is a timer destroyer.
+     */
        static void __timerDestroy(gpointer data);
 
+    /**
+     * This method is a timer destroyer.
+     */
        static void __idlerDestroy(gpointer data);
 
        //members
index 9a6adfd..732d394 100755 (executable)
@@ -129,7 +129,7 @@ public:
      * @return A string containing the base URI.
      */
 #ifdef TIZEN_MIGRATION
-    String GetBaseUri();
+    String GetBaseUri() const;
 #else
     static String GetBaseUri();
 #endif
index 78a3892..76bff8a 100644 (file)
@@ -30,6 +30,7 @@
 #include <maps_place_link_object_plugin.h>
 #include <maps_place_editorial_plugin.h>
 #include <maps_place_review_plugin.h>
+#include <maps_place_attribute_plugin.h>
 #include <maps_place_category.h>
 
 //map engine header
@@ -43,6 +44,7 @@
 #include <finder/LinkObject.h>
 #include <finder/Ratings.h>
 #include <finder/RelatedItem.h>
+#include <finder/ExtendedAttribute.h>
 #include <common/GeoLocation.h>
 #include <common/Address.h>
 
@@ -92,13 +94,14 @@ public:
 
 private:
        void ProcessPlaceLocation(PlaceDetails herePlace, maps_place_h mapsPlace);
-       void ProcessPlaceContact(PlaceDetails herePlace, maps_place_h mapsPlace);
-       void ProcessPlaceCategory(PlaceDetails herePlace, maps_place_h mapsPlace);
-       void ProcessPlaceImage(PlaceDetails herePlace, maps_place_h mapsPlace);
+       void ProcessPlaceContacts(PlaceDetails herePlace, maps_place_h mapsPlace);
+       void ProcessPlaceCategories(PlaceDetails herePlace, maps_place_h mapsPlace);
+       void ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceDetails(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceRatings(PlaceDetails herePlace, maps_place_h mapsPlace);
        void ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace);
+       void ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h mapsPlace);
 
        void __sortList(PlaceList &list);
        void __flushReplies(int error);
index 87c6e3c..83e84d5 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_13
\ No newline at end of file
+libheremaps-engine.so.1.0.6_14
\ No newline at end of file
similarity index 65%
rename from lib/aarch64/libheremaps-engine.so.1.0.6_13
rename to lib/aarch64/libheremaps-engine.so.1.0.6_14
index 02eb719..aeec0c3 100755 (executable)
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_13 and b/lib/aarch64/libheremaps-engine.so.1.0.6_14 differ
index 87c6e3c..83e84d5 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_13
\ No newline at end of file
+libheremaps-engine.so.1.0.6_14
\ No newline at end of file
similarity index 62%
rename from lib/arm/libheremaps-engine.so.1.0.6_13
rename to lib/arm/libheremaps-engine.so.1.0.6_14
index 1f0a9cd..231635d 100755 (executable)
Binary files a/lib/arm/libheremaps-engine.so.1.0.6_13 and b/lib/arm/libheremaps-engine.so.1.0.6_14 differ
index 87c6e3c..83e84d5 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_13
\ No newline at end of file
+libheremaps-engine.so.1.0.6_14
\ No newline at end of file
similarity index 62%
rename from lib/i586/libheremaps-engine.so.1.0.6_13
rename to lib/i586/libheremaps-engine.so.1.0.6_14
index 89a3032..dc3d14d 100755 (executable)
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_13 and b/lib/i586/libheremaps-engine.so.1.0.6_14 differ
index 87c6e3c..83e84d5 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_13
\ No newline at end of file
+libheremaps-engine.so.1.0.6_14
\ No newline at end of file
similarity index 65%
rename from lib/x86_64/libheremaps-engine.so.1.0.6_13
rename to lib/x86_64/libheremaps-engine.so.1.0.6_14
index b58ff0e..e7aa9a2 100755 (executable)
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_13 and b/lib/x86_64/libheremaps-engine.so.1.0.6_14 differ
index 16359e5..89e4cd4 100644 (file)
@@ -600,14 +600,14 @@ void HerePlace::OnPlaceDetailsReply(const PlaceDetailsReply &Reply)
                        /* location */
                        ProcessPlaceLocation(herePlace, mapsPlace);
 
-                       ProcessPlaceContact(herePlace, mapsPlace);
+                       ProcessPlaceContacts(herePlace, mapsPlace);
 
-                       ProcessPlaceCategory(herePlace, mapsPlace);
+                       ProcessPlaceCategories(herePlace, mapsPlace);
 
                        /* tags */
                        /* maps & here not supported */
 
-                       ProcessPlaceImage(herePlace, mapsPlace);
+                       ProcessPlaceImages(herePlace, mapsPlace);
 
                        ProcessPlaceDetails(herePlace, mapsPlace);
 
@@ -617,6 +617,8 @@ void HerePlace::OnPlaceDetailsReply(const PlaceDetailsReply &Reply)
 
                        ProcessPlaceRated(herePlace, mapsPlace);
 
+                       ProcessPlaceAttributes(herePlace, mapsPlace);
+
                        if (!isPending)
                                m_PlaceList.push_back(mapsPlace);
 
@@ -742,7 +744,7 @@ void HerePlace::ProcessPlaceLocation(PlaceDetails herePlace, maps_place_h mapsPl
 }
 
 
-void HerePlace::ProcessPlaceContact(PlaceDetails herePlace, maps_place_h mapsPlace)
+void HerePlace::ProcessPlaceContacts(PlaceDetails herePlace, maps_place_h mapsPlace)
 {
        /* contact */
        ContactDetailsList hereContList = herePlace.GetContactDetails();
@@ -780,8 +782,7 @@ void HerePlace::ProcessPlaceContact(PlaceDetails herePlace, maps_place_h mapsPla
                }
 
                if (is_valid)
-                       maps_item_list_append(mapsContList, mapsCont,
-                               maps_place_contact_clone);
+                       maps_item_list_append(mapsContList, mapsCont, maps_place_contact_clone);
 
                maps_place_contact_destroy(mapsCont);
        }
@@ -793,7 +794,7 @@ void HerePlace::ProcessPlaceContact(PlaceDetails herePlace, maps_place_h mapsPla
        maps_item_list_destroy(mapsContList);
 }
 
-void HerePlace::ProcessPlaceCategory(PlaceDetails herePlace, maps_place_h mapsPlace)
+void HerePlace::ProcessPlaceCategories(PlaceDetails herePlace, maps_place_h mapsPlace)
 {
        CategoryList hereCateList = herePlace.GetCategories();
        CategoryList::iterator hereCate;
@@ -806,10 +807,11 @@ void HerePlace::ProcessPlaceCategory(PlaceDetails herePlace, maps_place_h mapsPl
 
        if (maps_item_list_create(&mapsCateList) != MAPS_ERROR_NONE) return;
 
-       // maps-service supports only one category
-       hereCate = hereCateList.begin();
-       if (maps_place_category_create(&mapsCate) == MAPS_ERROR_NONE)
-       {
+       for (hereCate = hereCateList.begin(); hereCate != hereCateList.end(); hereCate++) {
+               if (maps_place_category_create(&mapsCate) != MAPS_ERROR_NONE) continue;
+
+               is_valid = false;
+
                if (!hereCate->GetCategoryId().ToString().empty()) {
                        error = maps_place_category_set_id(mapsCate,
                                hereCate->GetCategoryId().ToString().c_str());
@@ -828,9 +830,9 @@ void HerePlace::ProcessPlaceCategory(PlaceDetails herePlace, maps_place_h mapsPl
                        is_valid |= (error == MAPS_ERROR_NONE);
                }
 
-               if (is_valid) {
+               if (is_valid)
                        maps_item_list_append(mapsCateList, mapsCate, maps_place_category_clone);
-               }
+
                maps_place_category_destroy(mapsCate);
        }
 
@@ -841,7 +843,7 @@ void HerePlace::ProcessPlaceCategory(PlaceDetails herePlace, maps_place_h mapsPl
        maps_item_list_destroy(mapsCateList);
 }
 
-void HerePlace::ProcessPlaceImage(PlaceDetails herePlace, maps_place_h mapsPlace)
+void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlace)
 {
        ImageContentList hereImageList = herePlace.GetImageContent();
        ImageContentList::iterator hereImage;
@@ -1116,6 +1118,56 @@ void HerePlace::ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace
        maps_place_link_object_destroy(mapsRelated);
 }
 
+void HerePlace::ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h mapsPlace)
+{
+       ExtendedAttributeList hereAttributeList = herePlace.GetExtendedAttributes();
+       ExtendedAttributeList::iterator hereAttribute;
+       maps_item_list_h mapsAttributeList;
+       maps_place_attribute_h mapsAttribute;
+       int error;
+       bool is_valid = false;
+
+       if (hereAttributeList.empty()) return;
+
+       if (maps_item_list_create(&mapsAttributeList) != MAPS_ERROR_NONE) return;
+
+       for (hereAttribute = hereAttributeList.begin(); hereAttribute != hereAttributeList.end(); hereAttribute++) {
+               if (maps_place_attribute_create(&mapsAttribute) != MAPS_ERROR_NONE) continue;
+
+               is_valid = false;
+
+               if (!hereAttribute->GetAttributeType().empty()) {
+                       error = maps_place_attribute_set_id(mapsAttribute,
+                               (char*)hereAttribute->GetAttributeType().c_str());
+                       is_valid |= (error == MAPS_ERROR_NONE);
+               }
+
+               if (!hereAttribute->GetLabel().empty()) {
+                       error = maps_place_attribute_set_label(mapsAttribute,
+                               (char*)hereAttribute->GetLabel().c_str());
+                       is_valid |= (error == MAPS_ERROR_NONE);
+               }
+
+               if (!hereAttribute->GetText().empty()) {
+                       error = maps_place_attribute_set_text(mapsAttribute,
+                               (char*)hereAttribute->GetText().c_str());
+                       is_valid |= (error == MAPS_ERROR_NONE);
+               }
+
+               if (is_valid)
+                       maps_item_list_append(mapsAttributeList, mapsAttribute, maps_place_attribute_clone);
+
+               maps_place_attribute_destroy(mapsAttribute);
+       }
+
+       if (maps_item_list_items(mapsAttributeList)) {
+               maps_place_set_attributes(mapsPlace, mapsAttributeList);
+               maps_item_list_remove_all(mapsAttributeList, maps_place_attribute_destroy);
+       }
+
+       maps_item_list_destroy(mapsAttributeList);
+}
+
 void HerePlace::__flushReplies(int error)
 {
        maps_place_h mapsPlace;
index 90058c6..8a73a29 100644 (file)
@@ -324,7 +324,7 @@ here_error_e HereViewObjects::__updateMarker(maps_view_object_h hMarker, GeoMapO
                /* z-order */
                int z_order = 0;
                maps_view_object_marker_get_z_order(hMarker, &z_order);
-               hereMarker->SetZorder(z_order);
+               hereMarker->SetZOrder(z_order);
        } while (0);
 
        if (img) evas_object_del(img);