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
);
24 class SVGFragmentIdentifier
;
27 class SVGViewportElement
;
29 class SVGViewElement
: public SVGViewElementBase
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
;
42 virtual nsresult
Clone(mozilla::dom::NodeInfo
*aNodeInfo
, nsINode
**aResult
,
43 bool aPreallocateChildren
) const override
;
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();
54 // nsSVGElement overrides
56 virtual EnumAttributesInfo
GetEnumInfo() override
;
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
;
72 SVGStringList mStringListAttributes
[1];
73 static StringListInfo sStringListInfo
[1];
77 } // namespace mozilla
79 #endif // mozilla_dom_SVGViewElement_h