[Release] wrt-installer_0.1.57
[framework/web/wrt-installer.git] / src / jobs / widget_install / manifest.h
index 20236a4..cb7e6d6 100644 (file)
@@ -53,6 +53,11 @@ class StringWithLang
     {
         return !this->lang.empty();
     }
+    int operator==(const StringWithLang &other)
+    {
+        return (DPL::ToUTF8String(other.string) == DPL::ToUTF8String(string)) &&
+               (DPL::ToUTF8String(other.lang) == DPL::ToUTF8String(lang));
+    }
 
   private:
     DPL::String string;
@@ -72,6 +77,7 @@ typedef DPL::String NcnameType, NmtokenType, AnySimpleType, LangType;
 typedef DPL::String OperationType, MimeType, UriType, TypeType, PackageType;
 typedef DPL::OptionalString InstallLocationType, CategoriesType;
 typedef DPL::String AppCategoryType;
+typedef DPL::String KeyType, ValueType;
 
 /**
  * xmllib2 wrappers
@@ -197,6 +203,23 @@ class Privilege
 
 typedef Privilege PrivilegeType;
 
+class Metadata
+{
+  public:
+    Metadata(KeyType k, ValueType v) :
+        key(k),
+        value(v)
+    {}
+    void serialize(xmlTextWriterPtr writer);
+
+  private:
+    KeyType key;
+    ValueType value;
+};
+
+typedef Metadata MetadataType;
+
+
 /**
  * @brief ime-application element
  */
@@ -355,6 +378,10 @@ class UiApplication
     {
         this->appCategory.push_back(x);
     }
+    void addMetadata(const MetadataType &m)
+    {
+        this->metadata.push_back(m);
+    }
     void serialize(xmlTextWriterPtr writer);
 
   private:
@@ -370,6 +397,7 @@ class UiApplication
     std::list<IconType> icon;
     std::list<AppControlType> appControl;
     std::list<AppCategoryType> appCategory;
+    std::list<MetadataType> metadata;
 };
 
 typedef UiApplication UiApplicationType;
@@ -403,10 +431,6 @@ class LiveBox
     {
         this->primary = x;
     }
-    void setAutoLaunch(const NcnameType &x)
-    {
-        this->autoLaunch = x;
-    }
     void setUpdatePeriod(const NcnameType &x)
     {
         this->updatePeriod = x;
@@ -453,7 +477,14 @@ class Manifest
 
     void addLabel(const LabelType &x)
     {
+#ifdef MULTIPROCESS_SERVICE_SUPPORT
+        auto pos = std::find(label.begin(), label.end(), x);
+        if (pos == label.end()) {
+            this->label.push_back(x);
+        }
+#else
         this->label.push_back(x);
+#endif
     }
     void addIcon(const IconType &x)
     {