#include <ctype.h>
namespace WrtDB {
-
-void NormalizeString(DPL::OptionalString& txt);
+void NormalizeString(DPL::OptionalString& txt, bool isTrimSpace = false);
void NormalizeString(DPL::String& str);
DPL::String GetSingleAttributeValue(const DPL::String value);
+void NormalizeAndTrimSpaceString(DPL::OptionalString& txt);
class WidgetConfigurationManager;
class ConfigParserData
{
public:
- struct Param
- {
- Param(const DPL::String& _name) : name(_name)
- {
- }
- DPL::String name;
- DPL::String value;
- bool operator==(const Param&) const;
- bool operator!=(const Param&) const;
- bool operator >(const Param&) const;
- bool operator>=(const Param&) const;
- bool operator <(const Param&) const;
- bool operator<=(const Param&) const;
- };
- typedef std::set<Param> ParamsList;
-
struct Feature
{
- Feature(const DPL::String& _name,
- bool _required = true) : name(_name),
- required(_required)
- {
- }
+ Feature(const DPL::String& _name) : name(_name)
+ {}
DPL::String name;
- bool required;
- ParamsList paramsList;
bool operator==(const Feature&) const;
bool operator!=(const Feature&) const;
};
typedef std::set<Feature> FeaturesList;
+ struct Privilege
+ {
+ Privilege(const DPL::String& _name) : name(_name)
+ {}
+ DPL::String name;
+
+ bool operator==(const Privilege&) const;
+ bool operator!=(const Privilege&) const;
+ bool operator >(const Privilege&) const;
+ bool operator>=(const Privilege&) const;
+ bool operator <(const Privilege&) const;
+ bool operator<=(const Privilege&) const;
+ };
+ typedef std::set<Privilege> PrivilegeList;
+
struct Icon
{
Icon(const DPL::String& _src) : src(_src)
- {
- }
+ {}
DPL::String src;
DPL::OptionalInt width;
DPL::OptionalInt height;
struct Preference
{
Preference(const DPL::String& _name,
- bool _readonly = false) :
+ bool _readonly = false) :
name(_name),
value(),
readonly(_readonly)
- {
- }
+ {}
DPL::String name;
DPL::OptionalString value;
bool readonly;
struct AccessInfo
{
AccessInfo(const DPL::String& strIRI,
- bool bSubdomainAccess) : m_strIRI(strIRI),
+ bool bSubdomainAccess) : m_strIRI(strIRI),
m_bSubDomainAccess(bSubdomainAccess)
- {
- }
+ {}
bool operator==(const AccessInfo&) const;
bool operator!=(const AccessInfo&) const;
{
Setting(const DPL::String& name,
const DPL::String& value) :
- m_name(name),
- m_value(value)
- {
- }
+ m_name(name),
+ m_value(value)
+ {}
DPL::String m_name;
DPL::String m_value;
typedef std::set<Setting> SettingsList;
- struct ServiceInfo
+ struct AppControlInfo
{
- ServiceInfo(
- const DPL::String& src,
- const DPL::String& operation,
- const DPL::String& scheme,
- const DPL::String& mime) :
- m_src(src),
+ enum class Disposition {
+ WINDOW = 0,
+ INLINE
+ };
+ AppControlInfo(const DPL::String& operation) :
m_operation(operation),
- m_scheme(scheme),
- m_mime(mime)
- {
- }
+ m_index(0)
+ {}
DPL::String m_src;
DPL::String m_operation;
- DPL::String m_scheme;
- DPL::String m_mime;
+ std::set <DPL::String> m_uriList;
+ std::set <DPL::String> m_mimeList;
+ Disposition m_disposition;
+ unsigned m_index;
+
+ bool operator==(const AppControlInfo&) const;
+ bool operator!=(const AppControlInfo&) const;
+ };
+
+ typedef std::list<AppControlInfo> AppControlInfoList;
+
+ typedef std::list<std::pair<DPL::String, DPL::String> > BoxSizeList;
- bool operator==(const ServiceInfo&) const;
- bool operator!=(const ServiceInfo&) const;
+ struct LiveboxInfo
+ {
+ LiveboxInfo() { }
+
+ struct BoxContent
+ {
+ DPL::String m_boxSrc;
+ DPL::String m_boxMouseEvent;
+ DPL::String m_boxTouchEffect;
+ BoxSizeList m_boxSize;
+ DPL::String m_pdSrc;
+ DPL::String m_pdWidth;
+ DPL::String m_pdHeight;
+ DPL::String m_pdFastOpen;
+ };
+ typedef BoxContent BoxContentInfo;
+
+ DPL::String m_label;
+ DPL::String m_icon;
+ DPL::String m_liveboxId;
+ DPL::String m_primary;
+ DPL::String m_type;
+ DPL::String m_autoLaunch;
+ DPL::String m_updatePeriod;
+ BoxContentInfo m_boxInfo;
+
+ bool operator==(const LiveboxInfo&) const;
+ bool operator!=(const LiveboxInfo&) const;
+ bool operator >(const LiveboxInfo&) const;
+ bool operator>=(const LiveboxInfo&) const;
+ bool operator <(const LiveboxInfo&) const;
+ bool operator<=(const LiveboxInfo&) const;
+ };
+ typedef std::list<DPL::Optional<LiveboxInfo> > LiveboxList;
+
+ enum IconSectionType
+ {
+ DefaultIcon =0,
+ SmallIcon
};
- typedef std::list<ServiceInfo> ServiceInfoList;
+
+ typedef std::set<std::pair<IconSectionType, DPL::String>> IconSet;
+ typedef std::list<DPL::String> CapabilityList;
+ typedef std::set<std::pair<DPL::String, DPL::String>> DisplayNameSet;
+
+ struct AccountProvider
+ {
+ AccountProvider() :
+ m_multiAccountSupport(false)
+ { }
+
+ bool m_multiAccountSupport;
+ IconSet m_iconSet;
+ DisplayNameSet m_displayNameSet;
+ CapabilityList m_capabilityList;
+ };
+
typedef std::list<DPL::OptionalString> DependsPkgList;
+ typedef std::set<DPL::String> CategoryList;
+ struct AllowNavigationInfo
+ {
+ AllowNavigationInfo(DPL::String scheme,
+ DPL::String host) :
+ m_scheme(scheme),
+ m_host(host)
+ { }
+ DPL::String m_scheme;
+ DPL::String m_host;
+ };
+ typedef std::list<AllowNavigationInfo> AllowNavigationInfoList;
+
+ enum class SecurityModelVersion {
+ SECURITY_MODEL_V1 = 0, // WARP
+ SECURITY_MODEL_V2 // CSP, allow-navigation
+ };
+
+ LiveboxList m_livebox;
StringsList nameSpaces;
LocalizedDataSet localizedDataSet;
DPL::OptionalString authorEmail;
FeaturesList featuresList;
+ PrivilegeList privilegeList;
SettingsList settingsList;
IconsList iconsList;
// tizen id / required platform min version for TIZEN webapp
- DPL::OptionalString tizenId;
DPL::OptionalString tizenMinVersionRequired;
+ DPL::OptionalString tizenPkgId;
+ DPL::OptionalString tizenAppId;
+
+ // allow-navigation
+ AllowNavigationInfoList allowNavigationInfoList;
+
+ //csp polic for widget
+ DPL::OptionalString cspPolicy;
+ DPL::OptionalString cspPolicyReportOnly;
+
+ //AppControl model list
+ AppControlInfoList appControlList;
- //Application service model list
- ServiceInfoList appServiceList;
// For link shared directory
DependsPkgList dependsPkgList;
// Splash image path
DPL::OptionalString splashImgSrc;
// Background page filename
DPL::OptionalString backgroundPage;
+ // For category
+ CategoryList categoryList;
+ // For Account
+ AccountProvider accountProvider;
+ // security model version
+ SecurityModelVersion securityModelVersion;
ConfigParserData() :
flashNeeded(false),
minVersionRequired(),
backSupported(false),
accessNetwork(false),
- startFileEncountered(false)
- {
- }
+ startFileEncountered(false),
+ securityModelVersion(SecurityModelVersion::SECURITY_MODEL_V1)
+ {}
};
-
} // namespace WrtDB
#endif //CONFIG_PARSER_DATA_H_