2012-05-17 10:02:41 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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 10:02:41 +00:00
|
|
|
|
2013-01-08 03:22:41 +00:00
|
|
|
#ifndef mozilla_dom_SVGViewElement_h
|
|
|
|
#define mozilla_dom_SVGViewElement_h
|
2012-05-17 10:02:41 +00:00
|
|
|
|
|
|
|
#include "nsSVGElement.h"
|
|
|
|
#include "nsSVGEnum.h"
|
|
|
|
#include "nsSVGViewBox.h"
|
|
|
|
#include "SVGAnimatedPreserveAspectRatio.h"
|
|
|
|
#include "SVGStringList.h"
|
|
|
|
|
2013-01-10 05:24:37 +00: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 03:22:41 +00:00
|
|
|
typedef nsSVGElement SVGViewElementBase;
|
|
|
|
|
|
|
|
class nsSVGOuterSVGFrame;
|
|
|
|
|
|
|
|
nsresult NS_NewSVGViewElement(nsIContent **aResult,
|
2014-06-20 02:01:40 +00:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-01-08 03:22:41 +00:00
|
|
|
|
2012-05-17 10:02:41 +00:00
|
|
|
namespace mozilla {
|
2013-01-08 03:22:41 +00:00
|
|
|
class SVGFragmentIdentifier;
|
2012-05-17 10:02:41 +00:00
|
|
|
|
2013-01-08 03:22:41 +00:00
|
|
|
namespace dom {
|
2013-01-09 23:02:45 +00:00
|
|
|
class SVGSVGElement;
|
2012-05-17 10:02:41 +00:00
|
|
|
|
2013-03-28 01:23:09 +00:00
|
|
|
class SVGViewElement : public SVGViewElementBase
|
2012-05-17 10:02:41 +00:00
|
|
|
{
|
2013-01-08 03:22:41 +00:00
|
|
|
protected:
|
2012-05-17 10:02:41 +00:00
|
|
|
friend class mozilla::SVGFragmentIdentifier;
|
2013-01-09 23:02:45 +00:00
|
|
|
friend class SVGSVGElement;
|
2013-01-08 03:22:41 +00:00
|
|
|
friend class ::nsSVGOuterSVGFrame;
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGViewElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2013-01-08 03:22:41 +00:00
|
|
|
friend nsresult (::NS_NewSVGViewElement(nsIContent **aResult,
|
2014-06-20 02:01:40 +00:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx) MOZ_OVERRIDE;
|
2013-01-08 03:22:41 +00:00
|
|
|
|
2012-05-17 10:02:41 +00:00
|
|
|
public:
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2012-05-17 10:02:41 +00:00
|
|
|
|
2013-01-08 03:22:41 +00:00
|
|
|
// WebIDL
|
|
|
|
uint16_t ZoomAndPan() { return mEnumAttributes[ZOOMANDPAN].GetAnimValue(); }
|
|
|
|
void SetZoomAndPan(uint16_t aZoomAndPan, ErrorResult& rv);
|
2013-05-09 17:42:12 +00:00
|
|
|
already_AddRefed<SVGAnimatedRect> ViewBox();
|
2013-01-08 03:22:41 +00:00
|
|
|
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
|
2013-04-21 06:42:00 +00:00
|
|
|
already_AddRefed<DOMSVGStringList> ViewTarget();
|
2013-01-08 03:22:41 +00:00
|
|
|
|
2012-05-17 10:02:41 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
// nsSVGElement overrides
|
|
|
|
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual EnumAttributesInfo GetEnumInfo() MOZ_OVERRIDE;
|
2012-05-17 10:02:41 +00:00
|
|
|
|
|
|
|
enum { ZOOMANDPAN };
|
|
|
|
nsSVGEnum mEnumAttributes[1];
|
|
|
|
static nsSVGEnumMapping sZoomAndPanMap[];
|
|
|
|
static EnumInfo sEnumInfo[1];
|
|
|
|
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual nsSVGViewBox *GetViewBox() MOZ_OVERRIDE;
|
|
|
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() MOZ_OVERRIDE;
|
2012-05-17 10:02:41 +00:00
|
|
|
|
|
|
|
nsSVGViewBox mViewBox;
|
|
|
|
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
|
|
|
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual StringListAttributesInfo GetStringListInfo() MOZ_OVERRIDE;
|
2012-05-17 10:02:41 +00:00
|
|
|
|
|
|
|
enum { VIEW_TARGET };
|
|
|
|
SVGStringList mStringListAttributes[1];
|
|
|
|
static StringListInfo sStringListInfo[1];
|
|
|
|
};
|
|
|
|
|
2013-01-08 03:22:41 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGViewElement_h
|