For livebox configuration
[platform/framework/web/wrt-installer.git] / src / jobs / widget_install / manifest.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 46f367c..8e6bf4b
@@ -176,6 +176,7 @@ void Manifest::serialize(xmlTextWriterPtr writer)
         FOREACH(u, this->uiApplication) { u->serialize(writer); }
         FOREACH(i, this->imeApplication) { i->serialize(writer); }
         //FOREACH(f, this->font) { f->serialize(writer); }
+        FOREACH(l, this->livebox) { l->serialize(writer); }
     }
     endElement(writer);
 }
@@ -301,5 +302,84 @@ void AppControl::serialize(xmlTextWriterPtr writer)
     }
     endElement(writer);
 }
+
+void LiveBox::serialize(xmlTextWriterPtr writer)
+{
+    startElement(writer, "livebox");
+    if(!this->appid.empty()) {
+        writeAttribute(writer, "appid", this->appid);
+    }
+    if(!this->auto_launch.empty()) {
+        writeAttribute(writer, "auto_launch", this->auto_launch);
+    }
+    if(!this->network.empty()) {
+        writeAttribute(writer, "network", this->network);
+    }
+    writeAttribute(writer, "abi", "html");
+    if(!this->period.empty()) {
+        writeAttribute(writer, "period", this->period);
+    }
+    if(!this->nodisplay.empty()) {
+        writeAttribute(writer, "nodisplay", this->nodisplay);
+    }
+    if(!this->primary.empty()) {
+        writeAttribute(writer, "primary", this->primary);
+    }
+    if(!this->timeout.empty()) {
+        writeAttribute(writer, "timeout", this->timeout);
+    }
+    if(!this->label.empty()) {
+        startElement(writer, "label");
+        writeText(writer, this->label);
+        endElement(writer);
+    }
+
+    if(!this->icon.empty()) {
+        startElement(writer, "icon");
+        writeText(writer, this->icon);
+        endElement(writer);
+    }
+
+    if(!this->box.boxSrc.empty() && !this->box.boxSize.empty())
+    {
+        startElement(writer, "box");
+        writeAttribute(writer, "type", "buffer");
+
+        FOREACH(m, this->box.boxSize)
+        {
+            std::pair<DPL::String, DPL::String> boxSize = *m;
+            startElement(writer, "size");
+            if(!boxSize.second.empty())
+                writeAttribute(writer, "preview", boxSize.second);
+            writeText(writer, boxSize.first);
+            endElement(writer);
+        }
+
+        startElement(writer, "script");
+        writeAttribute(writer, "src", this->box.boxSrc);
+        endElement(writer);
+
+        endElement(writer);
+
+        if(!this->box.pdSrc.empty() && ! this->box.pdWidth.empty() && ! this->box.pdHeight.empty()) {
+            startElement(writer, "pd");
+            writeAttribute(writer, "type", "buffer");
+
+            startElement(writer, "size");
+            DPL::String pdSize = this->box.pdWidth+DPL::String(L"x")+this->box.pdHeight;
+            writeText(writer, pdSize);
+            endElement(writer);
+
+            startElement(writer, "script");
+            writeAttribute(writer, "src", this->box.pdSrc);
+            endElement(writer);
+
+            endElement(writer);
+        }
+    }
+
+    endElement(writer);
+}
+
 } //namespace Jobs
 } //namespace WidgetInstall