tizen 2.4 release
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / config_parser_data.h
 #include <set>
 #include <list>
 #include <map>
+#include <boost/optional.hpp>
 #include <dpl/optional_typedefs.h>
 #include <dpl/string.h>
+#include <dpl/platform.h>
 #include <ctype.h>
 
 namespace WrtDB {
@@ -35,6 +37,11 @@ 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);
+#if ENABLE(ELEMENT_ATTR_MAX_LENGTH)
+void NormalizeString(DPL::String& str, const unsigned int length, bool showEllipsis = false);
+void NormalizeString(DPL::OptionalString& str, const unsigned int length, bool showEllipsis = false);
+void NormalizeAndTrimSpaceString(DPL::OptionalString& str, const unsigned int length);
+#endif // ELEMENT_ATTR_MAX_LENGTH
 
 class WidgetConfigurationManager;
 
@@ -160,22 +167,14 @@ class ConfigParserData
 
     struct AppControlInfo
     {
-        enum class Disposition {
-            UNDEFINE = 0,
-            WINDOW   = 1,
-            INLINE   = 2
-        };
         AppControlInfo(const DPL::String& operation) :
-            m_operation(operation),
-            m_disposition(Disposition::UNDEFINE),
-            m_index(0)
+            m_operation(operation)
         {}
         DPL::String m_src;
         DPL::String m_operation;
         std::set <DPL::String> m_uriList;
         std::set <DPL::String> m_mimeList;
-        Disposition m_disposition;
-        unsigned m_index;
+        DPL::String m_reload;
 
         bool operator==(const AppControlInfo&) const;
         bool operator!=(const AppControlInfo&) const;
@@ -183,6 +182,7 @@ class ConfigParserData
 
     typedef std::list<AppControlInfo> AppControlInfoList;
 
+#if USE(WEB_PROVIDER)
     struct LiveboxInfo
     {
         LiveboxInfo() { }
@@ -227,8 +227,9 @@ class ConfigParserData
         bool operator <(const LiveboxInfo&) const;
         bool operator<=(const LiveboxInfo&) const;
     };
-    typedef DPL::Optional<LiveboxInfo> OptionalLiveboxInfo;
+    typedef boost::optional<LiveboxInfo> OptionalLiveboxInfo;
     typedef std::list<OptionalLiveboxInfo> LiveboxList;
+#endif
 
     enum IconSectionType
     {
@@ -254,6 +255,7 @@ class ConfigParserData
 
     typedef std::list<DPL::OptionalString> DependsPkgList;
     typedef std::set<DPL::String> CategoryList;
+    typedef std::set<DPL::String> BackgroundCategoryList;
 
     struct AllowNavigationInfo
     {
@@ -300,6 +302,8 @@ class ConfigParserData
         LocalizedDataSet m_localizedDataSet;
         DPL::String serviceContent;
         IconsList m_iconsList;
+        MetadataList m_metadataList;
+        CategoryList m_categoryList;
     };
     typedef std::list<ServiceAppInfo> ServiceAppInfoList;
 
@@ -307,8 +311,9 @@ class ConfigParserData
         SECURITY_MODEL_V1 = 0, // WARP
         SECURITY_MODEL_V2      // CSP, allow-navigation
     };
-
+#if USE(WEB_PROVIDER)
     LiveboxList m_livebox;
+#endif
     StringsList nameSpaces;
 
     LocalizedDataSet localizedDataSet;
@@ -342,10 +347,6 @@ class ConfigParserData
     bool backSupported;
     bool accessNetwork;
 
-#ifdef CARD_VIEWER_SUPPORT
-    bool isCardApp;
-#endif
-
     // Unlocalized data, to be processed by WidgetConfigurationManager
     bool startFileEncountered;
     DPL::OptionalString startFile;
@@ -360,6 +361,12 @@ class ConfigParserData
     DPL::OptionalString tizenAppId;
     bool didFoundTizenApplicationElement;
 
+    // LaunchMode(caller, single)
+    DPL::OptionalString launchMode;
+
+    // Ambient Support(true, false)
+    DPL::OptionalString ambient;
+
     // allow-navigation
     bool allowNavigationEncountered;
     AllowNavigationInfoList allowNavigationInfoList;
@@ -381,6 +388,8 @@ class ConfigParserData
     DPL::OptionalString backgroundPage;
     // For category
     CategoryList categoryList;
+    // For background category
+    BackgroundCategoryList backgroundCategoryList;
     // For Account
     AccountProvider accountProvider;
     // security model version
@@ -397,9 +406,6 @@ class ConfigParserData
         minVersionRequired(),
         backSupported(false),
         accessNetwork(false),
-#ifdef CARD_VIEWER_SUPPORT
-        isCardApp(false),
-#endif
         startFileEncountered(false),
         didFoundTizenApplicationElement(false),
         allowNavigationEncountered(false),