2010-04-28 23:00:54 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-04-28 23:00:54 +00:00
|
|
|
|
|
|
|
/* representation of a dummy attribute targeted by <animateMotion> element */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
#define MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2010-04-28 23:00:54 +00:00
|
|
|
#include "nsISMILAttr.h"
|
2012-01-26 09:57:21 +00:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsSMILValue;
|
2010-04-28 23:00:54 +00:00
|
|
|
class nsSVGElement;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-03-19 03:18:45 +00:00
|
|
|
namespace dom {
|
|
|
|
class SVGAnimationElement;
|
|
|
|
}
|
|
|
|
|
2010-04-28 23:00:54 +00:00
|
|
|
/**
|
|
|
|
* SVGMotionSMILAttr: Implements the nsISMILAttr interface for SMIL animations
|
|
|
|
* from <animateMotion>.
|
|
|
|
*
|
|
|
|
* NOTE: Even though there's technically no "motion" attribute, we behave in
|
|
|
|
* many ways as if there were, for simplicity.
|
|
|
|
*/
|
|
|
|
class SVGMotionSMILAttr : public nsISMILAttr
|
|
|
|
{
|
|
|
|
public:
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGMotionSMILAttr(nsSVGElement* aSVGElement)
|
2010-04-28 23:00:54 +00:00
|
|
|
: mSVGElement(aSVGElement) {}
|
|
|
|
|
|
|
|
// nsISMILAttr methods
|
|
|
|
virtual nsresult ValueFromString(const nsAString& aStr,
|
2013-03-19 03:18:45 +00:00
|
|
|
const dom::SVGAnimationElement* aSrcElement,
|
2010-04-28 23:00:54 +00:00
|
|
|
nsSMILValue& aValue,
|
2013-05-29 20:43:41 +00:00
|
|
|
bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
|
|
|
|
virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
|
|
|
|
virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
|
|
|
|
virtual void ClearAnimValue() MOZ_OVERRIDE;
|
|
|
|
virtual const nsIContent* GetTargetNode() const MOZ_OVERRIDE;
|
2010-04-28 23:00:54 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Raw pointers are OK here because this SVGMotionSMILAttr is both
|
|
|
|
// created & destroyed during a SMIL sample-step, during which time the DOM
|
|
|
|
// isn't modified.
|
|
|
|
nsSVGElement* mSVGElement;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // MOZILLA_SVGMOTIONSMILATTR_H_
|