2013-01-06 13:32:01 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_SVGRectElement_h
|
|
|
|
#define mozilla_dom_SVGRectElement_h
|
|
|
|
|
|
|
|
#include "nsSVGPathGeometryElement.h"
|
|
|
|
#include "nsSVGLength2.h"
|
|
|
|
|
|
|
|
nsresult NS_NewSVGRectElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-01-06 13:32:01 +04:00
|
|
|
|
|
|
|
typedef nsSVGPathGeometryElement SVGRectElementBase;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 05:23:09 +04:00
|
|
|
class SVGRectElement MOZ_FINAL : public SVGRectElementBase
|
2013-01-06 13:32:01 +04:00
|
|
|
{
|
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGRectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2014-04-09 02:27:17 +04:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx) MOZ_OVERRIDE;
|
2013-01-06 13:32:01 +04:00
|
|
|
friend nsresult (::NS_NewSVGRectElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-01-06 13:32:01 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
// nsSVGSVGElement methods:
|
2013-05-08 09:11:24 +04:00
|
|
|
virtual bool HasValidDimensions() const MOZ_OVERRIDE;
|
2013-01-06 13:32:01 +04:00
|
|
|
|
|
|
|
// nsSVGPathGeometryElement methods:
|
2014-10-26 21:00:03 +03:00
|
|
|
virtual bool GetGeometryBounds(Rect* aBounds, Float aStrokeWidth,
|
|
|
|
const Matrix& aTransform) MOZ_OVERRIDE;
|
2014-10-22 15:29:05 +04:00
|
|
|
virtual void GetAsSimplePath(SimplePath* aSimplePath) MOZ_OVERRIDE;
|
2014-07-06 00:53:04 +04:00
|
|
|
virtual TemporaryRef<Path> BuildPath(PathBuilder* aBuilder = nullptr) MOZ_OVERRIDE;
|
2013-01-06 13:32:01 +04:00
|
|
|
|
2014-06-20 06:01:40 +04:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-01-06 13:32:01 +04:00
|
|
|
|
|
|
|
// WebIDL
|
2013-01-20 00:56:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength> X();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Height();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Rx();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Ry();
|
2013-01-06 13:32:01 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2013-05-08 09:11:24 +04:00
|
|
|
virtual LengthAttributesInfo GetLengthInfo() MOZ_OVERRIDE;
|
2013-01-06 13:32:01 +04:00
|
|
|
|
|
|
|
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT, ATTR_RX, ATTR_RY };
|
|
|
|
nsSVGLength2 mLengthAttributes[6];
|
|
|
|
static LengthInfo sLengthInfo[6];
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGRectElement_h
|