michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * nsMappedAttributeElement is the base for elements supporting style mapped michael@0: * attributes via nsMappedAttributes (HTML and MathML). michael@0: */ michael@0: michael@0: #ifndef NS_MAPPEDATTRIBUTEELEMENT_H_ michael@0: #define NS_MAPPEDATTRIBUTEELEMENT_H_ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsStyledElement.h" michael@0: michael@0: class nsMappedAttributes; michael@0: struct nsRuleData; michael@0: michael@0: typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes, michael@0: nsRuleData* aData); michael@0: michael@0: typedef nsStyledElement nsMappedAttributeElementBase; michael@0: michael@0: class nsMappedAttributeElement : public nsMappedAttributeElementBase michael@0: { michael@0: michael@0: protected: michael@0: michael@0: nsMappedAttributeElement(already_AddRefed& aNodeInfo) michael@0: : nsMappedAttributeElementBase(aNodeInfo) michael@0: {} michael@0: michael@0: public: michael@0: virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const; michael@0: michael@0: static void MapNoAttributesInto(const nsMappedAttributes* aAttributes, michael@0: nsRuleData* aRuleData); michael@0: michael@0: NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) MOZ_OVERRIDE; michael@0: virtual bool SetMappedAttribute(nsIDocument* aDocument, michael@0: nsIAtom* aName, michael@0: nsAttrValue& aValue, michael@0: nsresult* aRetval) MOZ_OVERRIDE; michael@0: }; michael@0: michael@0: #endif // NS_MAPPEDATTRIBUTEELEMENT_H_