Tizen 2.0 Release
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / config_parser_data.h
index a2d92ef..c6ae0bd 100644 (file)
 #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;
 
@@ -43,9 +43,8 @@ class ConfigParserData
   public:
     struct Param
     {
-        Param(const DPL::String& name) : name(name)
-        {
-        }
+        Param(const DPL::String& _name) : name(_name)
+        {}
         DPL::String name;
         DPL::String value;
         bool operator==(const Param&) const;
@@ -59,11 +58,10 @@ class ConfigParserData
 
     struct Feature
     {
-        Feature(const DPL::String& name,
-                bool required = true) : name(name),
-            required(required)
-        {
-        }
+        Feature(const DPL::String& _name,
+                bool _required = true) : name(_name),
+            required(_required)
+        {}
         DPL::String name;
         bool required;
         ParamsList paramsList;
@@ -77,11 +75,25 @@ class ConfigParserData
     };
     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)
-        {
-        }
+        Icon(const DPL::String& _src) : src(_src)
+        {}
         DPL::String src;
         DPL::OptionalInt width;
         DPL::OptionalInt height;
@@ -109,13 +121,12 @@ class ConfigParserData
 
     struct Preference
     {
-        Preference(const DPL::String& name,
-                bool readonly = false) :
-            name(name),
+        Preference(const DPL::String& _name,
+                   bool _readonly = false) :
+            name(_name),
             value(),
-            readonly(readonly)
-        {
-        }
+            readonly(_readonly)
+        {}
         DPL::String name;
         DPL::OptionalString value;
         bool readonly;
@@ -132,10 +143,9 @@ class ConfigParserData
     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;
@@ -150,10 +160,9 @@ class ConfigParserData
     {
         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;
 
@@ -167,6 +176,9 @@ class ConfigParserData
 
     typedef std::set<Setting> SettingsList;
 
+    /* ServiceInfo will be removed.
+     * ServiceInfo will be changed AppControl
+     */
     struct ServiceInfo
     {
         ServiceInfo(
@@ -178,8 +190,7 @@ class ConfigParserData
             m_operation(operation),
             m_scheme(scheme),
             m_mime(mime)
-        {
-        }
+        {}
         DPL::String m_src;
         DPL::String m_operation;
         DPL::String m_scheme;
@@ -188,7 +199,64 @@ class ConfigParserData
         bool operator==(const ServiceInfo&) const;
         bool operator!=(const ServiceInfo&) const;
     };
-    typedef std::list<ServiceInfo> ServiceInfoList;
+
+    struct AppControlInfo
+    {
+        AppControlInfo(
+            const DPL::String& operation) :
+            m_operation(operation)
+        {}
+        DPL::String m_src;
+        DPL::String m_operation;
+        std::set <DPL::String> m_uriList;
+        std::set <DPL::String> m_mimeList;
+
+        bool operator==(const AppControlInfo&) const;
+        bool operator!=(const AppControlInfo&) const;
+    };
+
+    typedef std::list<ServiceInfo> ServiceInfoList; // It will be removed.
+    typedef std::list<AppControlInfo> AppControlInfoList;
+
+    typedef std::list<std::pair<DPL::String, DPL::String> > BoxSizeList;
+
+    struct LiveboxInfo
+    {
+        LiveboxInfo() { }
+
+        struct BoxContent
+        {
+            DPL::String m_boxSrc;
+            DPL::String m_boxMouseEvent;
+            BoxSizeList m_boxSize;
+            DPL::String m_pdSrc;
+            DPL::String m_pdWidth;
+            DPL::String m_pdHeight;
+        };
+        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;
+    LiveboxList m_livebox;
+
+    typedef std::list<DPL::OptionalString> DependsPkgList;
+
+    typedef std::set<DPL::String> CategoryList;
 
     StringsList nameSpaces;
 
@@ -199,6 +267,7 @@ class ConfigParserData
     DPL::OptionalString authorEmail;
 
     FeaturesList featuresList;
+    PrivilegeList privilegeList;
 
     SettingsList settingsList;
 
@@ -217,9 +286,7 @@ class ConfigParserData
 
     bool flashNeeded;
 
-    DPL::OptionalFloat minVersionRequired;
-    DPL::OptionalInt minVersionRequiredFound;
-    StringsList powderDescriptionLinks;
+    DPL::OptionalString minVersionRequired;
 
     bool backSupported;
     bool accessNetwork;
@@ -231,22 +298,36 @@ class ConfigParserData
     DPL::OptionalString startFileContentType;
     IconsList iconsList;
 
-    // pakcage name determined by operator for TIZEN webapp
-    DPL::OptionalString pkgname;
+    // tizen id / required platform min version for TIZEN webapp
+    DPL::OptionalString tizenId;
+    DPL::OptionalString tizenMinVersionRequired;
+    DPL::OptionalString tizenPkgId;
+    DPL::OptionalString tizenAppId;
+
+    //csp polic for widget
+    DPL::OptionalString cspPolicy;
+
     //Application service model list
-    ServiceInfoList appServiceList;
+    ServiceInfoList appServiceList; //It will be removed.
+    AppControlInfoList appControlList;
+
+    // For link shared directory
+    DependsPkgList dependsPkgList;
+    // Splash image path
+    DPL::OptionalString splashImgSrc;
+    // Background page filename
+    DPL::OptionalString backgroundPage;
+    // For category
+    CategoryList categoryList;
 
     ConfigParserData() :
         flashNeeded(false),
-        minVersionRequired(1.0),
-        minVersionRequiredFound(),
+        minVersionRequired(),
         backSupported(false),
         accessNetwork(false),
         startFileEncountered(false)
-    {
-    }
+    {}
 };
-
 } // namespace WrtDB
 
 #endif  //CONFIG_PARSER_DATA_H_