Line data Source code
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 : #ifndef mozilla_dom_SVGAnimateMotionElement_h
8 : #define mozilla_dom_SVGAnimateMotionElement_h
9 :
10 : #include "mozilla/Attributes.h"
11 : #include "mozilla/dom/SVGAnimationElement.h"
12 : #include "SVGMotionSMILAnimationFunction.h"
13 :
14 : nsresult NS_NewSVGAnimateMotionElement(nsIContent **aResult,
15 : already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 0 : class SVGAnimateMotionElement final : public SVGAnimationElement
21 : {
22 : protected:
23 : explicit SVGAnimateMotionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
24 :
25 : SVGMotionSMILAnimationFunction mAnimationFunction;
26 : friend nsresult
27 : (::NS_NewSVGAnimateMotionElement(nsIContent **aResult,
28 : already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
29 :
30 : virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
31 :
32 : public:
33 : // nsIDOMNode specializations
34 : virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
35 : bool aPreallocateChildren) const override;
36 :
37 : // SVGAnimationElement
38 : virtual nsSMILAnimationFunction& AnimationFunction() override;
39 : virtual bool GetTargetAttributeName(int32_t *aNamespaceID,
40 : nsIAtom **aLocalName) const override;
41 :
42 : // nsSVGElement
43 0 : virtual nsIAtom* GetPathDataAttrName() const override {
44 0 : return nsGkAtoms::path;
45 : }
46 :
47 : // Utility method to let our <mpath> children tell us when they've changed,
48 : // so we can make sure our mAnimationFunction is marked as having changed.
49 0 : void MpathChanged() { mAnimationFunction.MpathChanged(); }
50 : };
51 :
52 : } // namespace dom
53 : } // namespace mozilla
54 :
55 : #endif // mozilla_dom_SVGAnimateMotionElement_h
|