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_SVGEllipseElement_h
8 : #define mozilla_dom_SVGEllipseElement_h
9 :
10 : #include "SVGGeometryElement.h"
11 : #include "nsSVGLength2.h"
12 :
13 : nsresult NS_NewSVGEllipseElement(nsIContent **aResult,
14 : already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
15 :
16 : namespace mozilla {
17 : namespace dom {
18 :
19 : typedef SVGGeometryElement SVGEllipseElementBase;
20 :
21 0 : class SVGEllipseElement final : public SVGEllipseElementBase
22 : {
23 : protected:
24 : explicit SVGEllipseElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
25 : virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
26 : friend nsresult (::NS_NewSVGEllipseElement(nsIContent **aResult,
27 : already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
28 :
29 : public:
30 : // nsSVGSVGElement methods:
31 : virtual bool HasValidDimensions() const override;
32 :
33 : // SVGGeometryElement methods:
34 : virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions,
35 : const Matrix& aToBoundsSpace,
36 : const Matrix* aToNonScalingStrokeSpace = nullptr) override;
37 : virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
38 :
39 : virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
40 : bool aPreallocateChildren) const override;
41 :
42 : // WebIDL
43 : already_AddRefed<SVGAnimatedLength> Cx();
44 : already_AddRefed<SVGAnimatedLength> Cy();
45 : already_AddRefed<SVGAnimatedLength> Rx();
46 : already_AddRefed<SVGAnimatedLength> Ry();
47 :
48 : protected:
49 :
50 : virtual LengthAttributesInfo GetLengthInfo() override;
51 :
52 : enum { CX, CY, RX, RY };
53 : nsSVGLength2 mLengthAttributes[4];
54 : static LengthInfo sLengthInfo[4];
55 : };
56 :
57 : } // namespace dom
58 : } // namespace mozilla
59 :
60 : #endif // mozilla_dom_SVGEllipseElement_h
|