Modify app control element.
[platform/framework/web/wrt-installer.git] / src / jobs / widget_install / task_manifest_file.cpp
index 4a22574..b34b13c 100755 (executable)
@@ -547,6 +547,7 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
     setWidgetManifest(manifest);
     setWidgetOtherInfo(uiApp);
     setAppServiceInfo(uiApp);
+    setAppControlInfo(uiApp);
     setAppCategory(uiApp);
     setLiveBoxInfo(manifest);
 
@@ -765,6 +766,36 @@ void TaskManifestFile::setAppServiceInfo(UiApplication & uiApp)
     }
 }
 
+void TaskManifestFile::setAppControlInfo(UiApplication & uiApp)
+{
+    WrtDB::ConfigParserData::AppControlInfoList appControlList =
+        m_context.widgetConfig.configInfo.appControlList;
+
+    if (appControlList.empty()) {
+        LogInfo("Widget doesn't contain app control");
+        return;
+    }
+
+    // x-tizen-svc=http://tizen.org/appcontrol/operation/pick|NULL|image;
+    FOREACH(it, appControlList) {
+        AppControl appControl;
+        if (!it->m_operation.empty()) {
+            appControl.addOperation(it->m_operation); //TODO: encapsulation?
+        }
+        if (!it->m_uriList.empty()) {
+            FOREACH(uri, it->m_uriList) {
+                appControl.addUri(*uri);
+            }
+        }
+        if (!it->m_mimeList.empty()) {
+            FOREACH(mime, it->m_mimeList) {
+                appControl.addMime(*mime);
+            }
+        }
+        uiApp.addAppControl(appControl);
+    }
+}
+
 void TaskManifestFile::setAppCategory(UiApplication &uiApp)
 {
     WrtDB::ConfigParserData::CategoryList categoryList =