Bug 1444460 [wpt PR 9948] - gyroscope: Rename LocalCoordinateSystem to GyroscopeLocal...
[gecko.git] / dom / svg / SVGViewElement.h
blob2ddeff16dc6a159fdbce693a2a23585765398bb2
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/. */
7 #ifndef mozilla_dom_SVGViewElement_h
8 #define mozilla_dom_SVGViewElement_h
10 #include "nsSVGElement.h"
11 #include "nsSVGEnum.h"
12 #include "nsSVGViewBox.h"
13 #include "SVGAnimatedPreserveAspectRatio.h"
14 #include "SVGStringList.h"
16 typedef nsSVGElement SVGViewElementBase;
18 class nsSVGOuterSVGFrame;
20 nsresult NS_NewSVGViewElement(nsIContent **aResult,
21 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
23 namespace mozilla {
24 class SVGFragmentIdentifier;
26 namespace dom {
27 class SVGViewportElement;
29 class SVGViewElement : public SVGViewElementBase
31 protected:
32 friend class mozilla::SVGFragmentIdentifier;
33 friend class SVGSVGElement;
34 friend class SVGViewportElement;
35 friend class ::nsSVGOuterSVGFrame;
36 explicit SVGViewElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
37 friend nsresult (::NS_NewSVGViewElement(nsIContent **aResult,
38 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
39 virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
41 public:
42 virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
43 bool aPreallocateChildren) const override;
45 // WebIDL
46 uint16_t ZoomAndPan() { return mEnumAttributes[ZOOMANDPAN].GetAnimValue(); }
47 void SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv);
48 already_AddRefed<SVGAnimatedRect> ViewBox();
49 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
50 already_AddRefed<DOMSVGStringList> ViewTarget();
52 private:
54 // nsSVGElement overrides
56 virtual EnumAttributesInfo GetEnumInfo() override;
58 enum { ZOOMANDPAN };
59 nsSVGEnum mEnumAttributes[1];
60 static nsSVGEnumMapping sZoomAndPanMap[];
61 static EnumInfo sEnumInfo[1];
63 virtual nsSVGViewBox *GetViewBox() override;
64 virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
66 nsSVGViewBox mViewBox;
67 SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
69 virtual StringListAttributesInfo GetStringListInfo() override;
71 enum { VIEW_TARGET };
72 SVGStringList mStringListAttributes[1];
73 static StringListInfo sStringListInfo[1];
76 } // namespace dom
77 } // namespace mozilla
79 #endif // mozilla_dom_SVGViewElement_h