Support mouse-event of <tizen:box-content> and type of <tizen:livebox>
authorYunchan Cho <yunchan.cho@samsung.com>
Fri, 25 Jan 2013 12:34:50 +0000 (21:34 +0900)
committerYunchan Cho <yunchan.cho@samsung.com>
Tue, 29 Jan 2013 09:22:15 +0000 (18:22 +0900)
[Issue#] N/A
[Problem] wrt-installer doesn't support mouse-event of <tizen:box-content> and type of <tizen:livebox>
[Cause] N/A
[Solution] Two fields for this are added to config parser struct

Change-Id: Ib6b2f7b85288786021e54107780d73485788f7a6

packaging/wrt-installer.spec
src/CMakeLists.txt
src/configuration_parser/widget_parser.cpp
src/jobs/widget_install/manifest.cpp
src/jobs/widget_install/manifest.h
src/jobs/widget_install/task_database.cpp
src/jobs/widget_install/task_database.h
src/jobs/widget_install/task_manifest_file.cpp
src/jobs/widget_uninstall/task_db_update.cpp
src/jobs/widget_uninstall/task_db_update.h

index 6538bc9..58b0ab4 100644 (file)
@@ -38,6 +38,7 @@ BuildRequires:  pkgconfig(dpl-encryption)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
 BuildRequires:  pkgconfig(drm-service-core-intel)
 BuildRequires:  pkgconfig(app2sd)
+BuildRequires:  pkgconfig(web-provider-svc)
 Requires: xmlsec1
 
 %description
index c07dbab..75d2d4b 100644 (file)
@@ -123,6 +123,7 @@ PKG_CHECK_MODULES(INSTALLER_STATIC_DEP
     wrt-plugins-types
     pkgmgr-installer
     pkgmgr-parser
+    web-provider-svc
     REQUIRED
 )
 
index f46fdc0..c7da02b 100755 (executable)
@@ -2009,6 +2009,8 @@ class LiveboxParser : public ElementParser
             if (m_properNamespace) {
                 if (attribute.name == L"src")
                     m_box.m_boxSrc = attribute.value;
+                if (attribute.name == L"mouse-event")
+                    m_box.m_boxMouseEvent = attribute.value;
             }
         }
 
@@ -2079,6 +2081,8 @@ class LiveboxParser : public ElementParser
                 m_autoLaunch = attribute.value;
             } else if (attribute.name == L"update-period") {
                 m_updatePeriod = attribute.value;
+            } else if (attribute.name == L"type") {
+                m_type = attribute.value;
             }
         }
     }
@@ -2102,6 +2106,7 @@ class LiveboxParser : public ElementParser
         m_livebox.m_primary = m_primary;
         m_livebox.m_autoLaunch = m_autoLaunch;
         m_livebox.m_updatePeriod = m_updatePeriod;
+        m_livebox.m_type = m_type;
 
         m_data.m_livebox.push_back(m_livebox);
     }
@@ -2136,8 +2141,8 @@ class LiveboxParser : public ElementParser
     DPL::String m_primary;
     DPL::String m_autoLaunch;
     DPL::String m_updatePeriod;
+    DPL::String m_type;
     bool m_properNamespace;
-
 };
 
 
index 98adb96..0c369d9 100755 (executable)
@@ -340,10 +340,13 @@ void LiveBox::serialize(xmlTextWriterPtr writer)
         endElement(writer);
     }
 
-    if(!this->box.boxSrc.empty() && !this->box.boxSize.empty())
+    if(!this->box.boxSrc.empty() &&
+       !this->box.boxMouseEvent.empty() &&
+       !this->box.boxSize.empty())
     {
         startElement(writer, "box");
         writeAttribute(writer, "type", "buffer");
+        writeAttribute(writer, "mouse_event", this->box.boxMouseEvent);
 
         FOREACH(m, this->box.boxSize)
         {
@@ -361,7 +364,10 @@ void LiveBox::serialize(xmlTextWriterPtr writer)
 
         endElement(writer);
 
-        if(!this->box.pdSrc.empty() && ! this->box.pdWidth.empty() && ! this->box.pdHeight.empty()) {
+        if(!this->box.pdSrc.empty() &&
+           !this->box.pdWidth.empty() &&
+           !this->box.pdHeight.empty())
+        {
             startElement(writer, "pd");
             writeAttribute(writer, "type", "buffer");
 
index ac469d2..d09c057 100755 (executable)
@@ -231,6 +231,7 @@ typedef std::list<std::pair<DPL::String, DPL::String>> boxSizeType;
 struct BoxInfo
 {
     NcnameType boxSrc;
+    NcnameType boxMouseEvent;
     boxSizeType boxSize;
     NcnameType pdSrc;
     NcnameType pdWidth;
index 8ba08cf..de38c5f 100644 (file)
@@ -26,6 +26,7 @@
 #include <widget_install/job_widget_install.h>
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/widget_install_context.h>
+#include <web-provider-info.h>
 #include <dpl/wrt-dao-rw/widget_dao.h>
 #include <dpl/wrt-dao-ro/vconf_config.h>
 #include <dpl/foreach.h>
@@ -57,6 +58,7 @@ TaskDatabase::TaskDatabase(InstallerContext& context) :
     AddStep(&TaskDatabase::StepAceDBInsert);
     AddStep(&TaskDatabase::StepRemoveExternalFiles);
     AddStep(&TaskDatabase::StepCreateVconf);
+    AddStep(&TaskDatabase::StepLiveboxDBInsert);
 
     AddAbortStep(&TaskDatabase::StepAbortDBInsert);
 }
@@ -264,5 +266,36 @@ void TaskDatabase::StepAbortDBInsert()
         ace_unregister_widget(static_cast<ace_widget_handle_t>(m_handle));
 }
 
+void TaskDatabase::StepLiveboxDBInsert()
+{
+    if (m_context.widgetConfig.configInfo.m_livebox.size() <= 0) {
+        return;
+    }
+
+    std::string tizenId = DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
+
+    for (auto it = m_context.widgetConfig.configInfo.m_livebox.begin();
+            it != m_context.widgetConfig.configInfo.m_livebox.end(); ++it)
+    {
+        std::string boxId = DPL::ToUTF8String((**it).m_liveboxId);
+        std::string boxType;
+        if ((**it).m_type == L"") {
+            boxType = web_provider_info_get_default_type();
+        } else {
+            boxType = DPL::ToUTF8String((**it).m_type);
+        }
+        LogInfo("livebox id: " << boxId);
+        LogInfo("livebox type: " << boxType);
+
+        int ret =
+            web_provider_info_insert_box_type(
+                    boxId.c_str(), tizenId.c_str(), boxType.c_str());
+
+        if (ret < 0) {
+            LogDebug("failed to set type of livebox: " << boxId);
+        }
+    }
+}
+
 } //namespace WidgetInstall
 } //namespace Jobs
index f2098bc..5b2c154 100644 (file)
@@ -49,6 +49,7 @@ class TaskDatabase:
     void StepAceDBInsert();
     void StepRemoveExternalFiles();
     void StepCreateVconf();
+    void StepLiveboxDBInsert();
 
     void StepAbortDBInsert();
 
index 660c39a..af40308 100755 (executable)
@@ -890,6 +890,12 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
                     box.boxSrc = defaultLocale + ConfigInfo->m_boxInfo.m_boxSrc;
             }
 
+            if (ConfigInfo->m_boxInfo.m_boxMouseEvent == L"true") {
+                box.boxMouseEvent = ConfigInfo->m_boxInfo.m_boxMouseEvent;
+            } else {
+                box.boxMouseEvent = L"false";
+            }
+
             std::list<std::pair<DPL::String,DPL::String>> BoxSizeList
                 = ConfigInfo->m_boxInfo.m_boxSize;
             FOREACH(im, BoxSizeList) {
@@ -906,10 +912,8 @@ void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
                 box.pdWidth = ConfigInfo->m_boxInfo.m_pdWidth;
                 box.pdHeight = ConfigInfo->m_boxInfo.m_pdHeight;
             }
-
             liveBox.setBox(box);
         }
-
         manifest.addLivebox(liveBox);
     }
 
index c9eebd6..4c88b92 100644 (file)
  * @brief   Implementation file for uninstaller task database updating
  */
 
+#include <web-provider-info.h>
 #include <widget_uninstall/task_db_update.h>
 #include <widget_uninstall/job_widget_uninstall.h>
 #include <widget_uninstall/widget_uninstall_errors.h>
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 #include <ace_api_install.h>
-
 #include <dpl/assert.h>
 #include <ace-common/ace_api_common.h>
 
@@ -38,6 +38,7 @@ TaskDbUpdate::TaskDbUpdate(UninstallerContext& context) :
     m_context(context)
 {
     AddStep(&TaskDbUpdate::StepDbUpdate);
+    AddStep(&TaskDbUpdate::StepLiveboxDBDelete);
 }
 
 TaskDbUpdate::~TaskDbUpdate()
@@ -66,5 +67,18 @@ void TaskDbUpdate::StepDbUpdate()
         UninstallerContext::UNINSTALL_DB_UPDATE,
         "Widget DB Update Finished");
 }
+
+void TaskDbUpdate::StepLiveboxDBDelete()
+{
+    int ret =
+        web_provider_info_delete_by_app_id(m_context.tzAppid.c_str());
+
+    if (ret < 0) {
+        LogDebug("failed to delete box info");
+    } else {
+        LogInfo("delete box info: " << m_context.tzAppid);
+    }
+}
+
 } //namespace WidgetUninstall
 } //namespace Jobs
index 93c4ff2..1f34b00 100644 (file)
@@ -46,6 +46,7 @@ class TaskDbUpdate :
 
   private:
     void StepDbUpdate();
+    void StepLiveboxDBDelete();
 
   public:
     TaskDbUpdate(UninstallerContext& context);