[Release] wrt-installer_0.1.57
[framework/web/wrt-installer.git] / src / jobs / widget_install / manifest.h
index d2b3917..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
@@ -145,6 +151,76 @@ class AppControl
 typedef AppControl AppControlType;
 
 /**
+ * @brief account element
+ */
+typedef std::list<std::pair<DPL::String, DPL::String>> IconListType;
+typedef std::list<LabelType> DisplayNameListType;
+typedef std::list<DPL::String> AccountCapabilityType;
+
+struct AccountProvider
+{
+    NcnameType appid;
+    NcnameType multiAccount;
+    IconListType icon;
+    DisplayNameListType name;
+    AccountCapabilityType capability;
+};
+
+typedef AccountProvider AccountProviderType;
+
+class Account
+{
+  public:
+    Account() {}
+    void addAccountProvider(const AccountProvider &x)
+    {
+        this->provider = x;
+    }
+    void serialize(xmlTextWriterPtr writer);
+
+  private:
+    AccountProviderType provider;
+};
+
+class Privilege
+{
+  public:
+    Privilege() {}
+    void addPrivilegeName(const DPL::String &x)
+    {
+        this->name.push_back(x);
+    }
+    bool isEmpty()
+    {
+        return this->name.empty();
+    }
+
+    void serialize(xmlTextWriterPtr writer);
+
+  private:
+    std::list<DPL::String> name;
+};
+
+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
  */
 class ImeApplication
@@ -302,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:
@@ -317,6 +397,7 @@ class UiApplication
     std::list<IconType> icon;
     std::list<AppControlType> appControl;
     std::list<AppCategoryType> appCategory;
+    std::list<MetadataType> metadata;
 };
 
 typedef UiApplication UiApplicationType;
@@ -330,6 +411,7 @@ struct BoxInfo
 {
     NcnameType boxSrc;
     NcnameType boxMouseEvent;
+    NcnameType boxTouchEffect;
     boxSizeType boxSize;
     NcnameType pdSrc;
     NcnameType pdWidth;
@@ -349,10 +431,6 @@ class LiveBox
     {
         this->primary = x;
     }
-    void setAutoLaunch(const NcnameType &x)
-    {
-        this->autoLaunch = x;
-    }
     void setUpdatePeriod(const NcnameType &x)
     {
         this->updatePeriod = x;
@@ -399,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)
     {
@@ -440,6 +525,16 @@ class Manifest
         this->livebox.push_back(x);
     }
 
+    void addAccount(const Account &x)
+    {
+        this->account.push_back(x);
+    }
+
+    void addPrivileges(const PrivilegeType &x)
+    {
+        this->privileges = x;
+    }
+
     void setInstallLocation(const InstallLocationType &x)
     {
         this->installLocation = x;
@@ -473,6 +568,9 @@ class Manifest
     NcnameType package;
     PackageType type;
     NmtokenType version;
+    std::list<Account> account;
+    PrivilegeType privileges;
+
 };
 } //namespace Jobs
 } //namespace WidgetInstall