PWA enum value added and log delete. 32/82432/1
authorLim DoHyung <delight.lim@samsung.com>
Wed, 3 Aug 2016 09:10:35 +0000 (18:10 +0900)
committerLim DoHyung <delight.lim@samsung.com>
Wed, 3 Aug 2016 09:10:35 +0000 (18:10 +0900)
Change-Id: I752c328f1d837ad8e160b29a3b11a76ad4d0f82a
Signed-off-by: Lim DoHyung <delight.lim@samsung.com>
services/WebPageUI/WebPageUI.cpp
services/WebPageUI/WebPageUI.h

index 286971daae40648ce5656aecd734bb89e2dfd610..8dba87e42ec66071f27a69c61b01fd4a4ded2fdf 100755 (executable)
@@ -56,11 +56,17 @@ WebPageUI::WebPageUI()
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
 }
 
-struct wpaInfo {
+typedef struct {
+    std::string     id;
+    std::string     decodedIcon; // needs to src, type, sizes.
     std::string     uri;
-    std::string     orientation;
-    int             displayMode;
-};
+    std::string     name;
+    std::string     shortName;
+    int             orientation; // needs to portrait-primary, portrait-secondary, landscape-primary, landscape-secondary.
+    int             displayMode; // needs to fullscreen, standalone, minimal-ui, browser, and so on.
+    long            themeColor;
+    long            backgroundColor;
+} wpaInfo;
 
 WebPageUI::~WebPageUI()
 {
@@ -484,6 +490,7 @@ void WebPageUI::_cm_settings_clicked(void* data, Evas_Object*, void* )
 }
 
 void* pNum;
+wpaInfo *info = new wpaInfo();
 
 void WebPageUI::_cm_add_to_hs_clicked(void* data, Evas_Object*, void* )
 {
@@ -492,21 +499,18 @@ void WebPageUI::_cm_add_to_hs_clicked(void* data, Evas_Object*, void* )
         WebPageUI* webPageUI = static_cast<WebPageUI*>(data);
         _cm_dismissed(nullptr, webPageUI->m_ctxpopup, nullptr);
 
-        wpaInfo *info = new wpaInfo();
         pNum = &info;
         std::string uri = webPageUI->getURI();
-        std::string str = "landscape";
-        BROWSER_LOGD("[%s:%d] uri : %s", __PRETTY_FUNCTION__, __LINE__, uri.c_str());
         BROWSER_LOGD("[%s:%d] pNum : %s", __PRETTY_FUNCTION__, __LINE__, pNum);
 
         info->uri = uri.c_str();
-        info->orientation = str.c_str();
-        info->displayMode = 111;
+        info->orientation = portrait_secondary;         // test result : 1 (success)
+        info->displayMode = WebDisplayModeMinimalUi;    // test result : 2 (success)
         BROWSER_LOGD("[%s:%d] info[0] : %s", __PRETTY_FUNCTION__, __LINE__, (info->uri).c_str());
-        BROWSER_LOGD("[%s:%d] info[1] : %s", __PRETTY_FUNCTION__, __LINE__, (info->orientation).c_str());
+        BROWSER_LOGD("[%s:%d] info[1] : %d", __PRETTY_FUNCTION__, __LINE__, info->orientation);
         BROWSER_LOGD("[%s:%d] info[2] : %d", __PRETTY_FUNCTION__, __LINE__, info->displayMode);
 
-        shortcut_add_to_home("Shortcut", LAUNCH_BY_APP, NULL, NULL, 0, result_cb, NULL);
+        shortcut_add_to_home("Shortcut", LAUNCH_BY_APP, NULL, NULL, 0, result_cb, pNum);
     } else {
         BROWSER_LOGW("[%s] data = nullptr", __PRETTY_FUNCTION__);
     }
@@ -515,7 +519,10 @@ void WebPageUI::_cm_add_to_hs_clicked(void* data, Evas_Object*, void* )
 int WebPageUI::result_cb(int ret, void *data) {
     BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__);
     BROWSER_LOGD("[%s:%d] ret : %d, data : %s", __PRETTY_FUNCTION__, __LINE__, ret, data);
-//    BROWSER_LOGD("[%s:%d] data->displayMode : %d", __PRETTY_FUNCTION__, __LINE__, *(int *)(&(data->displayMode)));
+
+//    WebPageUI* webPageUI = static_cast<WebPageUI*>(data);
+//    webPageUI = (wpaInfo*)data;
+//    BROWSER_LOGD("[%s:%d] data->displayMode : %d", __PRETTY_FUNCTION__, __LINE__, (*(int *)((wpaInfo*)data)->displayMode));
     return 0;
 }
 
index f0ee860933fd04d835a130f6d33affd12e64092f..2a8fd0393d42ffaf8038d0170d4e742485aa8a60 100644 (file)
@@ -43,6 +43,22 @@ class BROWSER_EXPORT WebPageUI
         , public tizen_browser::interfaces::AbstractRotatable
 {
 public:
+    typedef enum OrientationType {
+        portrait_primary = 0,
+        portrait_secondary,
+        landscape_primary,
+        landscape_secondary,
+    } orientationType;
+
+    typedef enum WebDisplayMode {
+        WebDisplayModeUndefined = 0,
+        WebDisplayModeBrowser,
+        WebDisplayModeMinimalUi,
+        WebDisplayModeStandalone,
+        WebDisplayModeFullscreen,
+        WebDisplayModeLast = WebDisplayModeFullscreen
+    } webDisplayMode;
+
     WebPageUI();
     virtual ~WebPageUI();
     virtual std::string getName();