/work/obj-fuzz/dist/include/mozilla/dom/SVGRect.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 mozilla_dom_SVGRect_h |
8 | | #define mozilla_dom_SVGRect_h |
9 | | |
10 | | #include "mozilla/dom/SVGIRect.h" |
11 | | #include "mozilla/gfx/Rect.h" |
12 | | #include "nsSVGElement.h" |
13 | | |
14 | | //////////////////////////////////////////////////////////////////////// |
15 | | // SVGRect class |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | class SVGRect final : public SVGIRect |
21 | | { |
22 | | public: |
23 | | explicit SVGRect(nsIContent* aParent, float x=0.0f, float y=0.0f, float w=0.0f, |
24 | | float h=0.0f); |
25 | | |
26 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
27 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGRect) |
28 | | |
29 | | // WebIDL |
30 | | float X() const final |
31 | 0 | { |
32 | 0 | return mX; |
33 | 0 | } |
34 | | |
35 | | void SetX(float aX, ErrorResult& aRv) final |
36 | 0 | { |
37 | 0 | mX = aX; |
38 | 0 | } |
39 | | |
40 | | float Y() const final |
41 | 0 | { |
42 | 0 | return mY; |
43 | 0 | } |
44 | | |
45 | | void SetY(float aY, ErrorResult& aRv) final |
46 | 0 | { |
47 | 0 | mY = aY; |
48 | 0 | } |
49 | | |
50 | | float Width() const final |
51 | 0 | { |
52 | 0 | return mWidth; |
53 | 0 | } |
54 | | |
55 | | void SetWidth(float aWidth, ErrorResult& aRv) final |
56 | 0 | { |
57 | 0 | mWidth = aWidth; |
58 | 0 | } |
59 | | |
60 | | float Height() const final |
61 | 0 | { |
62 | 0 | return mHeight; |
63 | 0 | } |
64 | | |
65 | | void SetHeight(float aHeight, ErrorResult& aRv) final |
66 | 0 | { |
67 | 0 | mHeight = aHeight; |
68 | 0 | } |
69 | | |
70 | | virtual nsIContent* GetParentObject() const override |
71 | 0 | { |
72 | 0 | return mParent; |
73 | 0 | } |
74 | | |
75 | | protected: |
76 | 0 | ~SVGRect() {} |
77 | | |
78 | | nsCOMPtr<nsIContent> mParent; |
79 | | float mX, mY, mWidth, mHeight; |
80 | | }; |
81 | | |
82 | | } // namespace dom |
83 | | } // namespace mozilla |
84 | | |
85 | | already_AddRefed<mozilla::dom::SVGRect> |
86 | | NS_NewSVGRect(nsIContent* aParent, float x=0.0f, float y=0.0f, |
87 | | float width=0.0f, float height=0.0f); |
88 | | |
89 | | already_AddRefed<mozilla::dom::SVGRect> |
90 | | NS_NewSVGRect(nsIContent* aParent, const mozilla::gfx::Rect& rect); |
91 | | |
92 | | #endif //mozilla_dom_SVGRect_h |