X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjobs%2Fwidget_install%2Fmanifest.h;h=cb7e6d6879d30dcc85eac26e12f61c2b29cdd6db;hb=7fb83d1e97cd557be2a3b16edd5dc651a2d27306;hp=28fed98cd9131c3078c331d93ed260e56cf75c5f;hpb=30f09f632ad20e9b29fec8e484cb861fdc93cfd3;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/jobs/widget_install/manifest.h b/src/jobs/widget_install/manifest.h index 28fed98..cb7e6d6 100644 --- a/src/jobs/widget_install/manifest.h +++ b/src/jobs/widget_install/manifest.h @@ -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 @@ -176,6 +182,44 @@ class Account 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 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 */ @@ -334,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: @@ -349,6 +397,7 @@ class UiApplication std::list icon; std::list appControl; std::list appCategory; + std::list metadata; }; typedef UiApplication UiApplicationType; @@ -382,10 +431,6 @@ class LiveBox { this->primary = x; } - void setAutoLaunch(const NcnameType &x) - { - this->autoLaunch = x; - } void setUpdatePeriod(const NcnameType &x) { this->updatePeriod = x; @@ -432,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) { @@ -478,6 +530,11 @@ class Manifest this->account.push_back(x); } + void addPrivileges(const PrivilegeType &x) + { + this->privileges = x; + } + void setInstallLocation(const InstallLocationType &x) { this->installLocation = x; @@ -512,6 +569,8 @@ class Manifest PackageType type; NmtokenType version; std::list account; + PrivilegeType privileges; + }; } //namespace Jobs } //namespace WidgetInstall