X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjobs%2Fwidget_install%2Fmanifest.h;h=cb7e6d6879d30dcc85eac26e12f61c2b29cdd6db;hb=7fb83d1e97cd557be2a3b16edd5dc651a2d27306;hp=342c38725dfb280339de3e63830964e93f25d83d;hpb=4beb9ecf9eb870128bf0b9c90c75e11c007fa27e;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/jobs/widget_install/manifest.h b/src/jobs/widget_install/manifest.h index 342c387..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 @@ -145,6 +151,76 @@ class AppControl typedef AppControl AppControlType; /** + * @brief account element + */ +typedef std::list> IconListType; +typedef std::list DisplayNameListType; +typedef std::list 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 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 icon; std::list appControl; std::list appCategory; + std::list metadata; }; typedef UiApplication UiApplicationType; @@ -350,10 +431,6 @@ class LiveBox { this->primary = x; } - void setAutoLaunch(const NcnameType &x) - { - this->autoLaunch = x; - } void setUpdatePeriod(const NcnameType &x) { this->updatePeriod = x; @@ -400,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) { @@ -441,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; @@ -474,6 +568,9 @@ class Manifest NcnameType package; PackageType type; NmtokenType version; + std::list account; + PrivilegeType privileges; + }; } //namespace Jobs } //namespace WidgetInstall