michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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: #ifndef NS_SMILSETANIMATIONFUNCTION_H_ michael@0: #define NS_SMILSETANIMATIONFUNCTION_H_ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsSMILAnimationFunction.h" michael@0: michael@0: //---------------------------------------------------------------------- michael@0: // nsSMILSetAnimationFunction michael@0: // michael@0: // Subclass of nsSMILAnimationFunction that limits the behaviour to that offered michael@0: // by a element. michael@0: // michael@0: class nsSMILSetAnimationFunction : public nsSMILAnimationFunction michael@0: { michael@0: public: michael@0: /* michael@0: * Sets animation-specific attributes (or marks them dirty, in the case michael@0: * of from/to/by/values). michael@0: * michael@0: * @param aAttribute The attribute being set michael@0: * @param aValue The updated value of the attribute. michael@0: * @param aResult The nsAttrValue object that may be used for storing the michael@0: * parsed result. michael@0: * @param aParseResult Outparam used for reporting parse errors. Will be set michael@0: * to NS_OK if everything succeeds. michael@0: * @returns true if aAttribute is a recognized animation-related michael@0: * attribute; false otherwise. michael@0: */ michael@0: virtual bool SetAttr(nsIAtom* aAttribute, const nsAString& aValue, michael@0: nsAttrValue& aResult, nsresult* aParseResult = nullptr) MOZ_OVERRIDE; michael@0: michael@0: /* michael@0: * Unsets the given attribute. michael@0: * michael@0: * @returns true if aAttribute is a recognized animation-related michael@0: * attribute; false otherwise. michael@0: */ michael@0: virtual bool UnsetAttr(nsIAtom* aAttribute) MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: // Although animation might look like to-animation, unlike to-animation, michael@0: // it never interpolates values. michael@0: // Returning false here will mean this animation function gets treated as michael@0: // a single-valued function and no interpolation will be attempted. michael@0: virtual bool IsToAnimation() const MOZ_OVERRIDE { michael@0: return false; michael@0: } michael@0: michael@0: // applies the exact same value across the simple duration. michael@0: virtual bool IsValueFixedForSimpleDuration() const MOZ_OVERRIDE { michael@0: return true; michael@0: } michael@0: virtual bool HasAttr(nsIAtom* aAttName) const MOZ_OVERRIDE; michael@0: virtual const nsAttrValue* GetAttr(nsIAtom* aAttName) const MOZ_OVERRIDE; michael@0: virtual bool GetAttr(nsIAtom* aAttName, michael@0: nsAString& aResult) const MOZ_OVERRIDE; michael@0: virtual bool WillReplace() const MOZ_OVERRIDE; michael@0: michael@0: bool IsDisallowedAttribute(const nsIAtom* aAttribute) const; michael@0: }; michael@0: michael@0: #endif // NS_SMILSETANIMATIONFUNCTION_H_