2010-04-28 16:00:54 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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 16:00:54 -07:00
|
|
|
|
|
|
|
/* representation of a dummy attribute targeted by <animateMotion> element */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
#define MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
|
2013-05-29 13:43:41 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2010-04-28 16:00:54 -07:00
|
|
|
#include "nsISMILAttr.h"
|
2012-01-26 01:57:21 -08:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsSMILValue;
|
2010-04-28 16:00:54 -07:00
|
|
|
class nsSVGElement;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-03-18 20:18:45 -07:00
|
|
|
namespace dom {
|
|
|
|
class SVGAnimationElement;
|
|
|
|
}
|
|
|
|
|
2010-04-28 16:00:54 -07: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-08-31 18:08:04 -07:00
|
|
|
explicit SVGMotionSMILAttr(nsSVGElement* aSVGElement)
|
2010-04-28 16:00:54 -07:00
|
|
|
: mSVGElement(aSVGElement) {}
|
|
|
|
|
|
|
|
// nsISMILAttr methods
|
|
|
|
virtual nsresult ValueFromString(const nsAString& aStr,
|
2013-03-18 20:18:45 -07:00
|
|
|
const dom::SVGAnimationElement* aSrcElement,
|
2010-04-28 16:00:54 -07:00
|
|
|
nsSMILValue& aValue,
|
2013-05-29 13:43:41 -07: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 16:00:54 -07: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_
|