2007-03-22 10:30:00 -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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
#ifndef mozilla_dom_SVGPatternElement_h
|
|
|
|
#define mozilla_dom_SVGPatternElement_h
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-08-27 16:11:14 -07:00
|
|
|
#include "nsSVGEnum.h"
|
2012-01-26 01:57:21 -08:00
|
|
|
#include "nsSVGLength2.h"
|
2008-06-14 02:01:02 -07:00
|
|
|
#include "nsSVGString.h"
|
2012-12-23 00:22:22 -08:00
|
|
|
#include "nsSVGElement.h"
|
2009-02-03 06:42:24 -08:00
|
|
|
#include "nsSVGViewBox.h"
|
2010-12-19 16:45:29 -08:00
|
|
|
#include "SVGAnimatedPreserveAspectRatio.h"
|
2011-09-25 14:04:31 -07:00
|
|
|
#include "SVGAnimatedTransformList.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
class nsSVGPatternFrame;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
nsresult NS_NewSVGPatternElement(nsIContent **aResult,
|
|
|
|
already_AddRefed<nsINodeInfo> aNodeInfo);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
namespace mozilla {
|
2013-03-19 20:20:38 -07:00
|
|
|
class DOMSVGAnimatedTransformList;
|
2013-01-16 12:51:00 -08:00
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef nsSVGElement SVGPatternElementBase;
|
|
|
|
|
2013-03-27 18:23:10 -07:00
|
|
|
class SVGPatternElement MOZ_FINAL : public SVGPatternElementBase
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-01-16 12:51:00 -08:00
|
|
|
friend class ::nsSVGPatternFrame;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
2013-01-16 12:51:00 -08:00
|
|
|
friend nsresult (::NS_NewSVGPatternElement(nsIContent **aResult,
|
|
|
|
already_AddRefed<nsINodeInfo> aNodeInfo));
|
|
|
|
SVGPatternElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
2013-03-11 16:03:47 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx, JSObject *scope) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
2013-03-19 20:20:38 -07:00
|
|
|
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// nsIContent interface
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
|
|
|
|
2012-03-03 01:21:09 -08:00
|
|
|
// nsSVGSVGElement methods:
|
|
|
|
virtual bool HasValidDimensions() const;
|
|
|
|
|
2013-03-19 20:20:38 -07:00
|
|
|
virtual mozilla::SVGAnimatedTransformList*
|
2012-08-22 08:56:38 -07:00
|
|
|
GetAnimatedTransformList(uint32_t aFlags = 0);
|
2011-09-25 14:04:31 -07:00
|
|
|
virtual nsIAtom* GetTransformListAttrName() const {
|
|
|
|
return nsGkAtoms::patternTransform;
|
|
|
|
}
|
2013-01-16 12:51:00 -08:00
|
|
|
|
|
|
|
// WebIDL
|
|
|
|
already_AddRefed<nsIDOMSVGAnimatedRect> ViewBox();
|
|
|
|
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
|
|
|
|
already_AddRefed<nsIDOMSVGAnimatedEnumeration> PatternUnits();
|
|
|
|
already_AddRefed<nsIDOMSVGAnimatedEnumeration> PatternContentUnits();
|
2013-03-19 20:20:38 -07:00
|
|
|
already_AddRefed<DOMSVGAnimatedTransformList> PatternTransform();
|
2013-01-19 12:56:00 -08:00
|
|
|
already_AddRefed<SVGAnimatedLength> X();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Height();
|
2013-01-16 12:51:00 -08:00
|
|
|
already_AddRefed<nsIDOMSVGAnimatedString> Href();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual LengthAttributesInfo GetLengthInfo();
|
2007-08-27 16:11:14 -07:00
|
|
|
virtual EnumAttributesInfo GetEnumInfo();
|
2009-02-03 06:42:24 -08:00
|
|
|
virtual nsSVGViewBox *GetViewBox();
|
2010-12-19 16:45:29 -08:00
|
|
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio();
|
2008-06-14 02:01:02 -07:00
|
|
|
virtual StringAttributesInfo GetStringInfo();
|
2007-08-27 16:11:14 -07:00
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
2007-03-22 10:30:00 -07:00
|
|
|
nsSVGLength2 mLengthAttributes[4];
|
|
|
|
static LengthInfo sLengthInfo[4];
|
|
|
|
|
2007-08-27 16:11:14 -07:00
|
|
|
enum { PATTERNUNITS, PATTERNCONTENTUNITS };
|
|
|
|
nsSVGEnum mEnumAttributes[2];
|
|
|
|
static EnumInfo sEnumInfo[2];
|
|
|
|
|
2013-03-19 20:20:38 -07:00
|
|
|
nsAutoPtr<mozilla::SVGAnimatedTransformList> mPatternTransform;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-06-14 02:01:02 -07:00
|
|
|
enum { HREF };
|
|
|
|
nsSVGString mStringAttributes[1];
|
|
|
|
static StringInfo sStringInfo[1];
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-01-29 14:11:45 -08:00
|
|
|
// SVGFitToViewbox properties
|
2009-02-03 06:42:24 -08:00
|
|
|
nsSVGViewBox mViewBox;
|
2010-12-19 16:45:29 -08:00
|
|
|
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2013-01-16 12:51:00 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGPatternElement_h
|