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/. */
|
2012-05-17 14:02:41 +04:00
|
|
|
|
2013-01-08 07:22:41 +04:00
|
|
|
#ifndef mozilla_dom_SVGViewElement_h
|
|
|
|
#define mozilla_dom_SVGViewElement_h
|
2012-05-17 14:02:41 +04:00
|
|
|
|
|
|
|
#include "nsSVGElement.h"
|
|
|
|
#include "nsSVGEnum.h"
|
|
|
|
#include "nsSVGViewBox.h"
|
|
|
|
#include "SVGAnimatedPreserveAspectRatio.h"
|
|
|
|
#include "SVGStringList.h"
|
|
|
|
|
2013-01-10 09:24:37 +04:00
|
|
|
static const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0;
|
|
|
|
static const unsigned short SVG_ZOOMANDPAN_DISABLE = 1;
|
|
|
|
static const unsigned short SVG_ZOOMANDPAN_MAGNIFY = 2;
|
|
|
|
|
2013-01-08 07:22:41 +04:00
|
|
|
typedef nsSVGElement SVGViewElementBase;
|
|
|
|
|
|
|
|
class nsSVGOuterSVGFrame;
|
|
|
|
|
|
|
|
nsresult NS_NewSVGViewElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-01-08 07:22:41 +04:00
|
|
|
|
2012-05-17 14:02:41 +04:00
|
|
|
namespace mozilla {
|
2013-01-08 07:22:41 +04:00
|
|
|
class SVGFragmentIdentifier;
|
2012-05-17 14:02:41 +04:00
|
|
|
|
2013-01-08 07:22:41 +04:00
|
|
|
namespace dom {
|
2017-06-14 15:38:10 +03:00
|
|
|
class SVGViewportElement;
|
2012-05-17 14:02:41 +04:00
|
|
|
|
2013-03-28 05:23:09 +04:00
|
|
|
class SVGViewElement : public SVGViewElementBase
|
2012-05-17 14:02:41 +04:00
|
|
|
{
|
2013-01-08 07:22:41 +04:00
|
|
|
protected:
|
2012-05-17 14:02:41 +04:00
|
|
|
friend class mozilla::SVGFragmentIdentifier;
|
2013-01-10 03:02:45 +04:00
|
|
|
friend class SVGSVGElement;
|
2017-06-14 15:38:10 +03:00
|
|
|
friend class SVGViewportElement;
|
2013-01-08 07:22:41 +04:00
|
|
|
friend class ::nsSVGOuterSVGFrame;
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGViewElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2013-01-08 07:22:41 +04:00
|
|
|
friend nsresult (::NS_NewSVGViewElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-01-08 07:22:41 +04:00
|
|
|
|
2012-05-17 14:02:41 +04:00
|
|
|
public:
|
2017-04-20 22:57:48 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
|
|
|
bool aPreallocateChildren) const override;
|
2012-05-17 14:02:41 +04:00
|
|
|
|
2013-01-08 07:22:41 +04:00
|
|
|
// WebIDL
|
|
|
|
uint16_t ZoomAndPan() { return mEnumAttributes[ZOOMANDPAN].GetAnimValue(); }
|
|
|
|
void SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv);
|
2013-05-09 21:42:12 +04:00
|
|
|
already_AddRefed<SVGAnimatedRect> ViewBox();
|
2013-01-08 07:22:41 +04:00
|
|
|
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
|
2013-04-21 10:42:00 +04:00
|
|
|
already_AddRefed<DOMSVGStringList> ViewTarget();
|
2013-01-08 07:22:41 +04:00
|
|
|
|
2012-05-17 14:02:41 +04:00
|
|
|
private:
|
|
|
|
|
|
|
|
// nsSVGElement overrides
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual EnumAttributesInfo GetEnumInfo() override;
|
2012-05-17 14:02:41 +04:00
|
|
|
|
|
|
|
enum { ZOOMANDPAN };
|
|
|
|
nsSVGEnum mEnumAttributes[1];
|
|
|
|
static nsSVGEnumMapping sZoomAndPanMap[];
|
|
|
|
static EnumInfo sEnumInfo[1];
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsSVGViewBox *GetViewBox() override;
|
|
|
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
|
2012-05-17 14:02:41 +04:00
|
|
|
|
|
|
|
nsSVGViewBox mViewBox;
|
|
|
|
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual StringListAttributesInfo GetStringListInfo() override;
|
2012-05-17 14:02:41 +04:00
|
|
|
|
|
|
|
enum { VIEW_TARGET };
|
|
|
|
SVGStringList mStringListAttributes[1];
|
|
|
|
static StringListInfo sStringListInfo[1];
|
|
|
|
};
|
|
|
|
|
2013-01-08 07:22:41 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGViewElement_h
|