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/. */
|
2006-08-11 01:03:49 +04:00
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#ifndef DOM_SVG_SVGPOLYELEMENT_H_
|
|
|
|
#define DOM_SVG_SVGPOLYELEMENT_H_
|
2010-05-27 00:01:10 +04:00
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2010-12-08 15:15:53 +03:00
|
|
|
#include "SVGAnimatedPointList.h"
|
2016-12-18 14:11:47 +03:00
|
|
|
#include "SVGGeometryElement.h"
|
2006-08-11 01:03:49 +04:00
|
|
|
|
2013-01-06 13:32:01 +04:00
|
|
|
namespace mozilla {
|
2016-12-18 14:11:47 +03:00
|
|
|
namespace dom {
|
|
|
|
|
2019-09-21 17:38:56 +03:00
|
|
|
class DOMSVGPointList;
|
|
|
|
|
2020-07-15 13:37:55 +03:00
|
|
|
using SVGPolyElementBase = SVGGeometryElement;
|
2016-12-18 14:11:47 +03:00
|
|
|
|
|
|
|
class SVGPolyElement : public SVGPolyElementBase {
|
2006-08-11 01:03:49 +04:00
|
|
|
protected:
|
2018-09-21 23:45:49 +03:00
|
|
|
explicit SVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2006-08-11 01:03:49 +04:00
|
|
|
|
2019-04-18 01:38:02 +03:00
|
|
|
virtual ~SVGPolyElement() = default;
|
2014-07-09 01:23:16 +04:00
|
|
|
|
2006-08-11 01:03:49 +04:00
|
|
|
public:
|
|
|
|
// interfaces
|
2013-01-13 02:21:53 +04:00
|
|
|
|
2018-02-12 23:43:55 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement, SVGPolyElementBase)
|
2006-08-11 01:03:49 +04:00
|
|
|
|
|
|
|
// nsIContent interface
|
2017-10-03 01:05:19 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
|
2010-12-08 15:15:53 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual SVGAnimatedPointList* GetAnimatedPointList() override {
|
2010-12-08 15:15:53 +03:00
|
|
|
return &mPoints;
|
|
|
|
}
|
2018-03-29 12:45:24 +03:00
|
|
|
virtual nsStaticAtom* GetPointListAttrName() const override {
|
2010-12-08 15:15:53 +03:00
|
|
|
return nsGkAtoms::points;
|
|
|
|
}
|
|
|
|
|
2018-12-21 11:58:14 +03:00
|
|
|
// SVGElement methods:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool HasValidDimensions() const override;
|
2014-02-20 00:46:43 +04:00
|
|
|
|
2016-12-18 14:11:47 +03:00
|
|
|
// SVGGeometryElement methods:
|
2017-10-03 01:05:19 +03:00
|
|
|
virtual bool AttributeDefinesGeometry(const nsAtom* aName) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsMarkable() override { return true; }
|
2019-01-26 16:01:31 +03:00
|
|
|
virtual void GetMarkPoints(nsTArray<SVGMark>* aMarks) override;
|
2015-02-03 21:36:32 +03:00
|
|
|
virtual bool GetGeometryBounds(
|
|
|
|
Rect* aBounds, const StrokeOptions& aStrokeOptions,
|
2015-09-01 07:17:00 +03:00
|
|
|
const Matrix& aToBoundsSpace,
|
|
|
|
const Matrix* aToNonScalingStrokeSpace = nullptr) override;
|
2006-08-11 01:03:49 +04:00
|
|
|
|
2013-01-06 13:32:01 +04:00
|
|
|
// WebIDL
|
2019-09-21 17:38:56 +03:00
|
|
|
already_AddRefed<DOMSVGPointList> Points();
|
|
|
|
already_AddRefed<DOMSVGPointList> AnimatedPoints();
|
2013-01-06 13:32:01 +04:00
|
|
|
|
2006-08-11 01:03:49 +04:00
|
|
|
protected:
|
2010-12-08 15:15:53 +03:00
|
|
|
SVGAnimatedPointList mPoints;
|
2006-08-11 01:03:49 +04:00
|
|
|
};
|
|
|
|
|
2016-12-18 14:11:47 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#endif // DOM_SVG_SVGPOLYELEMENT_H_
|