/src/mozilla-central/dom/svg/SVGMotionSMILAttr.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | /* representation of a dummy attribute targeted by <animateMotion> element */ |
8 | | |
9 | | #ifndef MOZILLA_SVGMOTIONSMILATTR_H_ |
10 | | #define MOZILLA_SVGMOTIONSMILATTR_H_ |
11 | | |
12 | | #include "mozilla/Attributes.h" |
13 | | #include "nsISMILAttr.h" |
14 | | |
15 | | class nsIContent; |
16 | | class nsSMILValue; |
17 | | class nsSVGElement; |
18 | | |
19 | | namespace mozilla { |
20 | | |
21 | | namespace dom { |
22 | | class SVGAnimationElement; |
23 | | } // namespace dom |
24 | | |
25 | | /** |
26 | | * SVGMotionSMILAttr: Implements the nsISMILAttr interface for SMIL animations |
27 | | * from <animateMotion>. |
28 | | * |
29 | | * NOTE: Even though there's technically no "motion" attribute, we behave in |
30 | | * many ways as if there were, for simplicity. |
31 | | */ |
32 | | class SVGMotionSMILAttr : public nsISMILAttr |
33 | | { |
34 | | public: |
35 | | explicit SVGMotionSMILAttr(nsSVGElement* aSVGElement) |
36 | 0 | : mSVGElement(aSVGElement) {} |
37 | | |
38 | | // nsISMILAttr methods |
39 | | virtual nsresult ValueFromString(const nsAString& aStr, |
40 | | const dom::SVGAnimationElement* aSrcElement, |
41 | | nsSMILValue& aValue, |
42 | | bool& aPreventCachingOfSandwich) const override; |
43 | | virtual nsSMILValue GetBaseValue() const override; |
44 | | virtual nsresult SetAnimValue(const nsSMILValue& aValue) override; |
45 | | virtual void ClearAnimValue() override; |
46 | | virtual const nsIContent* GetTargetNode() const override; |
47 | | |
48 | | protected: |
49 | | // Raw pointers are OK here because this SVGMotionSMILAttr is both |
50 | | // created & destroyed during a SMIL sample-step, during which time the DOM |
51 | | // isn't modified. |
52 | | nsSVGElement* mSVGElement; |
53 | | }; |
54 | | |
55 | | } // namespace mozilla |
56 | | |
57 | | #endif // MOZILLA_SVGMOTIONSMILATTR_H_ |