ConfigParserData& m_data;
};
-class FlashParser : public ElementParser
-{
- public:
- virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
- const DPL::String& /*name*/)
- {
- return &IgnoringParser::Create;
- }
-
- virtual void Accept(const XmlAttribute& attribute)
- {
- if (attribute.name == L"needed") {
- if (attribute.value == L"true") {
- m_flashNeeded = true;
- } else {
- m_flashNeeded = false;
- }
- }
- }
-
- virtual void Accept(const Element& /*element*/)
- {
- //if empty flash element will be passed, we say true
- m_data.flashNeeded = true;
- }
-
- virtual void Accept(const Text& /*text*/)
- {
- ThrowMsg(Exception::ParseError, "flash element must be empty");
- }
-
- virtual void Verify()
- {
- m_data.flashNeeded = m_flashNeeded;
- }
-
- FlashParser(ConfigParserData& data) :
- ElementParser(),
- m_flashNeeded(false),
- m_data(data)
- {
- }
-
- private:
- bool m_flashNeeded;
- ConfigParserData& m_data;
-};
-
class LinkParser : public ElementParser
{
public:
DPL::MakeDelegate(this, &WidgetParser::OnFeatureElement);
m_map[L"preference"] =
DPL::MakeDelegate(this, &WidgetParser::OnPreferenceElement);
- m_map[L"flash"] = DPL::MakeDelegate(this, &WidgetParser::OnFlashElement);
m_map[L"link"] = DPL::MakeDelegate(this, &WidgetParser::OnLinkElement);
m_map[L"setting"] =
DPL::MakeDelegate(this, &WidgetParser::OnSettingElement);
return ElementParserPtr(new PreferenceParser(m_data));
}
-ElementParserPtr WidgetParser::OnFlashElement()
-{
- return ElementParserPtr(new FlashParser(m_data));
-}
-
ElementParserPtr WidgetParser::OnLinkElement()
{
return ElementParserPtr(new LinkParser(m_data));
ElementParserPtr OnFeatureElement();
ElementParserPtr OnPreferenceElement();
ElementParserPtr OnAccessElement();
- ElementParserPtr OnFlashElement();
ElementParserPtr OnLinkElement();
ElementParserPtr OnSettingElement();
ElementParserPtr OnServiceElement();