nsSVGPolyElement.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef NS_SVGPOLYELEMENT_H_
  6. #define NS_SVGPOLYELEMENT_H_
  7. #include "mozilla/Attributes.h"
  8. #include "nsSVGPathGeometryElement.h"
  9. #include "SVGAnimatedPointList.h"
  10. typedef nsSVGPathGeometryElement nsSVGPolyElementBase;
  11. namespace mozilla {
  12. class DOMSVGPointList;
  13. } // namespace mozilla
  14. class nsSVGPolyElement : public nsSVGPolyElementBase
  15. {
  16. protected:
  17. explicit nsSVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
  18. virtual ~nsSVGPolyElement();
  19. public:
  20. //interfaces
  21. NS_DECL_ISUPPORTS_INHERITED
  22. // nsIContent interface
  23. NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const override;
  24. virtual SVGAnimatedPointList* GetAnimatedPointList() override {
  25. return &mPoints;
  26. }
  27. virtual nsIAtom* GetPointListAttrName() const override {
  28. return nsGkAtoms::points;
  29. }
  30. // nsSVGElement methods:
  31. virtual bool HasValidDimensions() const override;
  32. // nsSVGPathGeometryElement methods:
  33. virtual bool AttributeDefinesGeometry(const nsIAtom *aName) override;
  34. virtual bool IsMarkable() override { return true; }
  35. virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks) override;
  36. virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions,
  37. const Matrix& aToBoundsSpace,
  38. const Matrix* aToNonScalingStrokeSpace = nullptr) override;
  39. // WebIDL
  40. already_AddRefed<mozilla::DOMSVGPointList> Points();
  41. already_AddRefed<mozilla::DOMSVGPointList> AnimatedPoints();
  42. protected:
  43. SVGAnimatedPointList mPoints;
  44. };
  45. #endif //NS_SVGPOLYELEMENT_H_