2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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/. */
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
#ifndef mozilla_dom_SVGRect_h
|
|
|
|
#define mozilla_dom_SVGRect_h
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2013-03-26 19:53:13 +04:00
|
|
|
#include "mozilla/dom/SVGIRect.h"
|
2014-03-18 06:41:33 +04:00
|
|
|
#include "mozilla/gfx/Rect.h"
|
2013-05-09 21:42:12 +04:00
|
|
|
#include "nsSVGElement.h"
|
2007-01-31 19:05:42 +03:00
|
|
|
|
2007-09-06 03:07:34 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
2013-03-26 19:52:41 +04:00
|
|
|
// SVGRect class
|
2007-09-06 03:07:34 +04:00
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-26 19:53:13 +04:00
|
|
|
class SVGRect MOZ_FINAL : public SVGIRect
|
2007-09-06 03:07:34 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGRect(nsIContent* aParent, float x=0.0f, float y=0.0f, float w=0.0f,
|
|
|
|
float h=0.0f);
|
2007-09-06 03:07:34 +04:00
|
|
|
|
2013-05-16 22:06:21 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGRect)
|
2007-09-06 03:07:34 +04:00
|
|
|
|
2013-03-26 19:53:13 +04:00
|
|
|
// WebIDL
|
|
|
|
virtual float X() const MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
return mX;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetX(float aX, ErrorResult& aRv) MOZ_FINAL
|
|
|
|
{
|
|
|
|
mX = aX;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual float Y() const MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
return mY;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetY(float aY, ErrorResult& aRv) MOZ_FINAL
|
|
|
|
{
|
|
|
|
mY = aY;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual float Width() const MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
return mWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetWidth(float aWidth, ErrorResult& aRv) MOZ_FINAL
|
|
|
|
{
|
|
|
|
mWidth = aWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual float Height() const MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
return mHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetHeight(float aHeight, ErrorResult& aRv) MOZ_FINAL
|
|
|
|
{
|
|
|
|
mHeight = aHeight;
|
|
|
|
}
|
|
|
|
|
2015-01-02 09:13:59 +03:00
|
|
|
virtual nsIContent* GetParentObject() const MOZ_OVERRIDE
|
2013-05-16 22:06:21 +04:00
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
2007-09-06 03:07:34 +04:00
|
|
|
protected:
|
2014-06-24 20:36:45 +04:00
|
|
|
~SVGRect() {}
|
|
|
|
|
2013-05-16 22:06:21 +04:00
|
|
|
nsCOMPtr<nsIContent> mParent;
|
2007-09-06 03:07:34 +04:00
|
|
|
float mX, mY, mWidth, mHeight;
|
|
|
|
};
|
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-04-18 15:40:09 +04:00
|
|
|
already_AddRefed<mozilla::dom::SVGRect>
|
2013-05-09 21:42:12 +04:00
|
|
|
NS_NewSVGRect(nsIContent* aParent, float x=0.0f, float y=0.0f,
|
|
|
|
float width=0.0f, float height=0.0f);
|
2013-03-26 19:53:13 +04:00
|
|
|
|
2013-04-18 15:40:09 +04:00
|
|
|
already_AddRefed<mozilla::dom::SVGRect>
|
2014-03-18 06:41:33 +04:00
|
|
|
NS_NewSVGRect(nsIContent* aParent, const mozilla::gfx::Rect& rect);
|
2013-03-26 19:53:13 +04:00
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
#endif //mozilla_dom_SVGRect_h
|