2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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-29 03:00:54 +04:00
|
|
|
|
|
|
|
/* representation of a dummy attribute targeted by <animateMotion> element */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
#define MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2010-04-29 03:00:54 +04:00
|
|
|
#include "nsISMILAttr.h"
|
2012-01-26 13:57:21 +04:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsSMILValue;
|
2010-04-29 03:00:54 +04:00
|
|
|
class nsSVGElement;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-03-19 07:18:45 +04:00
|
|
|
namespace dom {
|
|
|
|
class SVGAnimationElement;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
2013-03-19 07:18:45 +04:00
|
|
|
|
2010-04-29 03:00:54 +04: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 05:08:04 +04:00
|
|
|
explicit SVGMotionSMILAttr(nsSVGElement* aSVGElement)
|
2010-04-29 03:00:54 +04:00
|
|
|
: mSVGElement(aSVGElement) {}
|
|
|
|
|
|
|
|
// nsISMILAttr methods
|
|
|
|
virtual nsresult ValueFromString(const nsAString& aStr,
|
2013-03-19 07:18:45 +04:00
|
|
|
const dom::SVGAnimationElement* aSrcElement,
|
2010-04-29 03:00:54 +04:00
|
|
|
nsSMILValue& aValue,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool& aPreventCachingOfSandwich) const override;
|
|
|
|
virtual nsSMILValue GetBaseValue() const override;
|
|
|
|
virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
|
|
|
|
virtual void ClearAnimValue() override;
|
|
|
|
virtual const nsIContent* GetTargetNode() const override;
|
2010-04-29 03:00:54 +04: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_
|