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