2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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/. */
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
#ifndef mozilla_dom_SVGTextPathElement_h
|
|
|
|
#define mozilla_dom_SVGTextPathElement_h
|
2007-12-04 09:51:36 +03:00
|
|
|
|
|
|
|
#include "nsSVGEnum.h"
|
|
|
|
#include "nsSVGLength2.h"
|
2008-06-14 13:01:02 +04:00
|
|
|
#include "nsSVGString.h"
|
2013-02-08 23:55:49 +04:00
|
|
|
#include "mozilla/dom/SVGTextContentElement.h"
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2012-01-26 13:57:21 +04:00
|
|
|
class nsIAtom;
|
|
|
|
class nsIContent;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
|
|
|
nsresult NS_NewSVGTextPathElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2012-01-26 13:57:21 +04:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-02-08 23:55:49 +04:00
|
|
|
// textPath Method Types
|
|
|
|
static const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0;
|
|
|
|
static const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1;
|
|
|
|
static const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2;
|
|
|
|
// textPath Spacing Types
|
|
|
|
static const unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN = 0;
|
|
|
|
static const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1;
|
|
|
|
static const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2;
|
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
typedef SVGTextContentElement SVGTextPathElementBase;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGTextPathElement final : public SVGTextPathElementBase
|
2007-12-04 09:51:36 +03:00
|
|
|
{
|
2013-12-20 20:38:51 +04:00
|
|
|
friend class ::SVGTextFrame;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
|
|
|
protected:
|
2013-01-06 18:14:43 +04:00
|
|
|
friend nsresult (::NS_NewSVGTextPathElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGTextPathElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
2007-12-04 09:51:36 +03:00
|
|
|
public:
|
|
|
|
// nsIContent interface
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
// WebIDL
|
2013-01-20 00:56:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength> StartOffset();
|
2013-07-01 11:02:46 +04:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration> Method();
|
|
|
|
already_AddRefed<SVGAnimatedEnumeration> Spacing();
|
2013-06-15 02:37:27 +04:00
|
|
|
already_AddRefed<SVGAnimatedString> Href();
|
2013-01-03 00:24:07 +04:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
protected:
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual LengthAttributesInfo GetLengthInfo() override;
|
|
|
|
virtual EnumAttributesInfo GetEnumInfo() override;
|
|
|
|
virtual StringAttributesInfo GetStringInfo() override;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2013-07-24 04:01:35 +04:00
|
|
|
enum { /* TEXTLENGTH, */ STARTOFFSET = 1 };
|
|
|
|
nsSVGLength2 mLengthAttributes[2];
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsSVGLength2* LengthAttributes() override
|
2013-07-24 04:01:35 +04:00
|
|
|
{ return mLengthAttributes; }
|
|
|
|
static LengthInfo sLengthInfo[2];
|
|
|
|
|
|
|
|
enum { /* LENGTHADJUST, */ METHOD = 1, SPACING };
|
|
|
|
nsSVGEnum mEnumAttributes[3];
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsSVGEnum* EnumAttributes() override
|
2013-07-24 04:01:35 +04:00
|
|
|
{ return mEnumAttributes; }
|
2007-12-04 09:51:36 +03:00
|
|
|
static nsSVGEnumMapping sMethodMap[];
|
|
|
|
static nsSVGEnumMapping sSpacingMap[];
|
2013-07-24 04:01:35 +04:00
|
|
|
static EnumInfo sEnumInfo[3];
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2008-06-14 13:01:02 +04:00
|
|
|
enum { HREF };
|
|
|
|
nsSVGString mStringAttributes[1];
|
|
|
|
static StringInfo sStringInfo[1];
|
2007-12-04 09:51:36 +03:00
|
|
|
};
|
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGTextPathElement_h
|