/src/mozilla-central/dom/svg/SVGPolyElement.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 | | #ifndef NS_SVGPOLYELEMENT_H_ |
8 | | #define NS_SVGPOLYELEMENT_H_ |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "SVGAnimatedPointList.h" |
12 | | #include "SVGGeometryElement.h" |
13 | | |
14 | | namespace mozilla { |
15 | | class DOMSVGPointList; |
16 | | |
17 | | namespace dom { |
18 | | |
19 | | typedef SVGGeometryElement SVGPolyElementBase; |
20 | | |
21 | | class SVGPolyElement : public SVGPolyElementBase |
22 | | { |
23 | | protected: |
24 | | explicit SVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
25 | | |
26 | | virtual ~SVGPolyElement(); |
27 | | |
28 | | public: |
29 | | //interfaces |
30 | | |
31 | | NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement, SVGPolyElementBase) |
32 | | |
33 | | // nsIContent interface |
34 | | NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override; |
35 | | |
36 | 0 | virtual SVGAnimatedPointList* GetAnimatedPointList() override { |
37 | 0 | return &mPoints; |
38 | 0 | } |
39 | 0 | virtual nsAtom* GetPointListAttrName() const override { |
40 | 0 | return nsGkAtoms::points; |
41 | 0 | } |
42 | | |
43 | | // nsSVGElement methods: |
44 | | virtual bool HasValidDimensions() const override; |
45 | | |
46 | | // SVGGeometryElement methods: |
47 | | virtual bool AttributeDefinesGeometry(const nsAtom *aName) override; |
48 | 0 | virtual bool IsMarkable() override { return true; } |
49 | | virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks) override; |
50 | | virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions, |
51 | | const Matrix& aToBoundsSpace, |
52 | | const Matrix* aToNonScalingStrokeSpace = nullptr) override; |
53 | | |
54 | | // WebIDL |
55 | | already_AddRefed<mozilla::DOMSVGPointList> Points(); |
56 | | already_AddRefed<mozilla::DOMSVGPointList> AnimatedPoints(); |
57 | | |
58 | | protected: |
59 | | SVGAnimatedPointList mPoints; |
60 | | }; |
61 | | |
62 | | } // namespace dom |
63 | | } // namespace mozilla |
64 | | |
65 | | #endif //NS_SVGPOLYELEMENT_H_ |