ConfigParserData::AppControlInfo& m_data;
};
+ struct DispositionParser : public ElementParser
+ {
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& /*name*/)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ virtual void Accept(const Text& /*text*/)
+ {}
+
+ virtual void Accept(const Element& /*element*/)
+ {}
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ if (attribute.name == L"disposition") {
+ if (attribute.value.size() > 0) {
+ m_value = attribute.value;
+ NormalizeString(m_value);
+ }
+ }
+ }
+
+ virtual void Verify()
+ {
+ if (m_value.IsNull() || *m_value != L"inline") {
+ m_data.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
+ }
+ else {
+ m_data.m_disposition = ConfigParserData::AppControlInfo::Disposition::INLINE;
+ }
+ }
+
+ DispositionParser(ConfigParserData::AppControlInfo& data) :
+ ElementParser(),
+ m_properNamespace(false),
+ m_data(data)
+ {}
+
+ private:
+ bool m_properNamespace;
+ DPL::OptionalString m_value;
+ ConfigParserData::AppControlInfo& m_data;
+ };
+
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
{
return DPL::MakeDelegate(this, &AppControlParser::OnUriElement);
} else if (name == L"mime") {
return DPL::MakeDelegate(this, &AppControlParser::OnMimeElement);
+ } else if (name == L"disposition") {
+ return DPL::MakeDelegate(this,
+ &AppControlParser::OnDispositionElement);
} else {
return &IgnoringParser::Create;
}
return ElementParserPtr(new MimeParser(m_appControl));
}
+ ElementParserPtr OnDispositionElement()
+ {
+ return ElementParserPtr(new DispositionParser(m_appControl));
+ }
+
AppControlParser(ConfigParserData& data) :
ElementParser(),
m_data(data),