class LiveboxParser : public ElementParser
{
- public:
+ public:
- struct LabelParser : public ElementParser
+ struct BoxLabelParser : public ElementParser
{
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
const DPL::String& /*name*/)
{
}
- virtual void Accept(const Element& element)
- {
- if (element.ns ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
- {
- m_properNamespace = true;
- }
- }
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
+ }
- virtual void Accept(const Text& text)
- {
- if(m_properNamespace)
- m_label = text.value;
- }
+ virtual void Accept(const Text& text)
+ {
+ if(m_properNamespace)
+ m_label = text.value;
+ }
virtual void Verify()
{
- m_data.m_label = m_label;
+ m_data.m_label = m_label;
}
- LabelParser(ConfigParserData::LiveboxInfo& data) :
+ BoxLabelParser(ConfigParserData::LiveboxInfo& data) :
ElementParser(),
- m_properNamespace(false),
+ m_properNamespace(false),
m_data(data)
{
}
- private:
+ private:
DPL::String m_label;
+ bool m_properNamespace;
ConfigParserData::LiveboxInfo& m_data;
- bool m_properNamespace;
};
- struct IconParser : public ElementParser
+ struct BoxIconParser : public ElementParser
{
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
const DPL::String& /*name*/)
virtual void Accept(const XmlAttribute& attribute)
{
- if(m_properNamespace) {
- if (attribute.name == L"src") {
- m_icon = attribute.value;
+ if(m_properNamespace) {
+ if (attribute.name == L"src") {
+ m_icon = attribute.value;
+ }
}
- }
}
virtual void Accept(const Element& element)
{
- if (element.ns ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
- {
- m_properNamespace = true;
- }
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
}
virtual void Accept(const Text& /*text*/)
virtual void Verify()
{
- m_data.m_icon = m_icon;
+ m_data.m_icon = m_icon;
}
- explicit IconParser(ConfigParserData::LiveboxInfo& data) :
- ElementParser(),
- m_properNamespace(false),
- m_data(data)
+ explicit BoxIconParser(ConfigParserData::LiveboxInfo& data) :
+ ElementParser(),
+ m_properNamespace(false),
+ m_data(data)
{
}
- private:
+ private:
DPL::String m_icon;
+ bool m_properNamespace;
ConfigParserData::LiveboxInfo& m_data;
- bool m_properNamespace;
};
- struct BoxParser : public ElementParser
- {
- struct PdParser : public ElementParser
- {
- virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
- const DPL::String& name)
- {
- return &IgnoringParser::Create;
- }
-
- virtual void Accept(const XmlAttribute& attribute)
- {
- if(m_properNamespace) {
- if (attribute.name == L"src") {
- m_src = attribute.value;
- } else if (attribute.name == L"width") {
- m_width = attribute.value;
- } else if (attribute.name == L"height") {
- m_height = attribute.value;
- }
- }
- }
-
- virtual void Accept(const Element& element)
- {
- if (element.ns ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
- {
- m_properNamespace = true;
- }
- }
-
- virtual void Accept(const Text& /*text*/)
- {
- }
-
- virtual void Verify()
- {
- m_data.m_pdSrc = m_src;
- m_data.m_pdWidth = m_width;
- m_data.m_pdHeight = m_height;
- }
-
- explicit PdParser(ConfigParserData::LiveboxInfo::Box& data) :
- ElementParser(),
- m_properNamespace(false),
- m_data(data)
- {
- }
-
- private:
- DPL::String m_src;
- DPL::String m_width;
- DPL::String m_height;
-
- bool m_properNamespace;
- ConfigParserData::LiveboxInfo::Box& m_data;
- };
-
- struct SizeParser : public ElementParser
- {
- virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
- const DPL::String& /*name*/)
- {
- return &IgnoringParser::Create;
- }
-
- virtual void Accept(const XmlAttribute& attribute)
- {
- if(m_properNamespace) {
- if (attribute.name == L"preview") {
- m_preview = attribute.value;
- }
- }
- }
-
- virtual void Accept(const Element& element)
- {
- if (element.ns ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
- {
- m_properNamespace = true;
- }
- }
-
- virtual void Accept(const Text& text)
- {
- if(m_properNamespace)
- m_size = text.value;
- }
-
- virtual void Verify()
- {
- std::pair<DPL::String, DPL::String> boxSize;
- boxSize.first = m_size;
- boxSize.second = m_preview;
- m_data.m_boxSize.push_back(boxSize);
- }
-
- explicit SizeParser(ConfigParserData::LiveboxInfo::Box& data) :
- ElementParser(),
- m_data(data)
- {
- }
-
- private:
- DPL::String m_size;
- DPL::String m_preview;
- bool m_properNamespace;
- ConfigParserData::LiveboxInfo::Box& m_data;
- };
+ struct BoxContentParser : public ElementParser
+ {
+ struct BoxSizeParser : public ElementParser
+ {
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& /*name*/)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if(m_properNamespace) {
+ if (attribute.name == L"preview") {
+ m_preview = attribute.value;
+ }
+ }
+ }
+
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
+ }
+
+ virtual void Accept(const Text& text)
+ {
+ if(m_properNamespace)
+ m_size = text.value;
+ }
+
+ virtual void Verify()
+ {
+ std::pair<DPL::String, DPL::String> boxSize;
+ boxSize.first = m_size;
+ boxSize.second = m_preview;
+ m_data.m_boxSize.push_back(boxSize);
+ }
+
+ explicit BoxSizeParser(ConfigParserData::LiveboxInfo::BoxContentInfo& data) :
+ ElementParser(),
+ m_data(data)
+ {
+ }
+
+ private:
+ DPL::String m_size;
+ DPL::String m_preview;
+ bool m_properNamespace;
+ ConfigParserData::LiveboxInfo::BoxContentInfo& m_data;
+ };
+
+ struct PdParser : public ElementParser
+ {
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& name)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if(m_properNamespace) {
+ if (attribute.name == L"src") {
+ m_src = attribute.value;
+ } else if (attribute.name == L"width") {
+ m_width = attribute.value;
+ } else if (attribute.name == L"height") {
+ m_height = attribute.value;
+ }
+ }
+ }
+
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
+ }
+
+ virtual void Accept(const Text& /*text*/)
+ {
+ }
+
+ virtual void Verify()
+ {
+ m_data.m_pdSrc = m_src;
+ m_data.m_pdWidth = m_width;
+ m_data.m_pdHeight = m_height;
+ }
+
+ explicit PdParser(ConfigParserData::LiveboxInfo::BoxContentInfo& data) :
+ ElementParser(),
+ m_properNamespace(false),
+ m_data(data)
+ {
+ }
+
+ private:
+ DPL::String m_src;
+ DPL::String m_width;
+ DPL::String m_height;
+
+ bool m_properNamespace;
+ ConfigParserData::LiveboxInfo::BoxContentInfo& m_data;
+ };
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
{
- if (name == L"boxsize") {
- return DPL::MakeDelegate(this, &LiveboxParser::BoxParser::OnSizeElement);
- } else if (name == L"pd") {
- return DPL::MakeDelegate(this, &LiveboxParser::BoxParser::OnPdElement);
- }
- }
+ if (name == L"box-size") {
+ return DPL::MakeDelegate(this, &LiveboxParser::BoxContentParser::OnBoxSizeElement);
+ } else if (name == L"pd") {
+ return DPL::MakeDelegate(this, &LiveboxParser::BoxContentParser::OnPdElement);
+ }
+ }
virtual void Accept(const XmlAttribute& attribute)
{
- if (m_properNamespace) {
- if (attribute.name == L"src")
- m_box.m_boxSrc = attribute.value;
- }
+ if (m_properNamespace) {
+ if (attribute.name == L"src")
+ m_box.m_boxSrc = attribute.value;
+ }
}
virtual void Accept(const Element& element)
{
- if (element.ns ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
- {
- m_properNamespace = true;
- }
+ if (element.ns ==
+ ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
}
virtual void Accept(const Text& /*text*/)
virtual void Verify()
{
- m_data.m_boxInfo = m_box;
+ m_data.m_boxInfo = m_box;
}
- explicit BoxParser(ConfigParserData::LiveboxInfo& data) :
+ explicit BoxContentParser(ConfigParserData::LiveboxInfo& data) :
ElementParser(),
- m_properNamespace(false),
+ m_properNamespace(false),
m_data(data)
{
}
- ElementParserPtr OnPdElement()
+ ElementParserPtr OnBoxSizeElement()
{
- return ElementParserPtr(new PdParser(m_box));
+ return ElementParserPtr(new BoxSizeParser(m_box));
}
- ElementParserPtr OnSizeElement()
+ ElementParserPtr OnPdElement()
{
- return ElementParserPtr(new SizeParser(m_box));
+ return ElementParserPtr(new PdParser(m_box));
}
- private:
- DPL::String m_src;
+ private:
+ DPL::String m_src;
+ bool m_properNamespace;
ConfigParserData::LiveboxInfo& m_data;
- bool m_properNamespace;
- ConfigParserData::LiveboxInfo::Box m_box;
-
+ ConfigParserData::LiveboxInfo::BoxContentInfo m_box;
};
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
- const DPL::String& name)
- {
- if (name == L"label") {
- return DPL::MakeDelegate(this, &LiveboxParser::OnLabelElement);
- } else if (name == L"icon") {
- return DPL::MakeDelegate(this, &LiveboxParser::OnIconElement);
- } else if (name == L"box") {
- return DPL::MakeDelegate(this, &LiveboxParser::OnBoxElement);
+ const DPL::String& name)
+ {
+ if (name == L"box-label") {
+ return DPL::MakeDelegate(this, &LiveboxParser::OnBoxLabelElement);
+ } else if (name == L"box-icon") {
+ return DPL::MakeDelegate(this, &LiveboxParser::OnBoxIconElement);
+ } else if (name == L"box-content") {
+ return DPL::MakeDelegate(this, &LiveboxParser::OnBoxContentElement);
} else {
return &IgnoringParser::Create;
}
virtual void Accept(const XmlAttribute& attribute)
{
if (m_properNamespace) {
- if (attribute.name == L"appid") {
- m_appId = attribute.value;
- } else if (attribute.name == L"auto_launch") {
- m_autoLaunch = attribute.value;
- } else if (attribute.name == L"period") {
- m_period = attribute.value;
- } else if (attribute.name == L"network") {
- m_network = attribute.value;
- LogDebug("@@@ "<<m_network);
- } else if (attribute.name == L"nodisplay") {
- m_nodisplay = attribute.value;
- } else if (attribute.name == L"primary") {
- m_primary = attribute.value;
- } else if (attribute.name == L"timeout") {
- m_timeout = attribute.value;
- }
- }
+ if (attribute.name == L"id") {
+ m_liveboxId = attribute.value;
+ } else if (attribute.name == L"primary") {
+ m_primary = attribute.value;
+ } else if (attribute.name == L"auto-launch") {
+ m_autoLaunch = attribute.value;
+ } else if (attribute.name == L"update-period") {
+ m_updatePeriod = attribute.value;
+ }
+ }
}
virtual void Accept(const Element& element)
{
if (element.ns ==
- ConfigurationNamespace::TizenWebAppNamespaceName)
+ ConfigurationNamespace::TizenWebAppNamespaceName)
{
m_properNamespace = true;
}
virtual void Verify()
{
- m_livebox.m_appId = m_appId;
- m_livebox.m_autoLaunch = m_autoLaunch;
- m_livebox.m_period = m_period;
- m_livebox.m_network = m_network;
- m_livebox.m_nodisplay = m_nodisplay;
+ m_livebox.m_liveboxId = m_liveboxId;
m_livebox.m_primary = m_primary;
- m_livebox.m_timeout = m_timeout;
+ m_livebox.m_autoLaunch = m_autoLaunch;
+ m_livebox.m_updatePeriod = m_updatePeriod;
- m_data.m_livebox.push_back(m_livebox);
+ m_data.m_livebox.push_back(m_livebox);
}
explicit LiveboxParser(ConfigParserData& data) :
m_livebox = ConfigParserData::LiveboxInfo();
}
- ElementParserPtr OnLabelElement()
+ ElementParserPtr OnBoxLabelElement()
{
- return ElementParserPtr(new LabelParser(m_livebox));
+ return ElementParserPtr(new BoxLabelParser(m_livebox));
}
- ElementParserPtr OnIconElement()
+ ElementParserPtr OnBoxIconElement()
{
- return ElementParserPtr(new IconParser(m_livebox));
+ return ElementParserPtr(new BoxIconParser(m_livebox));
}
- ElementParserPtr OnBoxElement()
+
+ ElementParserPtr OnBoxContentElement()
{
- return ElementParserPtr(new BoxParser(m_livebox));
+ return ElementParserPtr(new BoxContentParser(m_livebox));
}
private:
ConfigParserData& m_data;
ConfigParserData::LiveboxInfo m_livebox;
- DPL::String m_appId;
- DPL::String m_autoLaunch;
- DPL::String m_period;
- DPL::String m_network;
- DPL::String m_nodisplay;
+ DPL::String m_liveboxId;
DPL::String m_primary;
- DPL::String m_timeout;
+ DPL::String m_autoLaunch;
+ DPL::String m_updatePeriod;
bool m_properNamespace;
};