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/. */
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
#ifndef mozilla_dom_SVGAElement_h
|
|
|
|
#define mozilla_dom_SVGAElement_h
|
2010-05-27 00:01:10 +04:00
|
|
|
|
2012-01-26 13:57:21 +04:00
|
|
|
#include "Link.h"
|
2009-04-29 08:31:34 +04:00
|
|
|
#include "nsSVGString.h"
|
2013-01-10 09:30:13 +04:00
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
2009-10-14 02:13:41 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
nsresult NS_NewSVGAElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
namespace mozilla {
|
2014-03-18 08:48:19 +04:00
|
|
|
|
2014-03-18 08:48:20 +04:00
|
|
|
class EventChainPostVisitor;
|
2014-03-18 08:48:19 +04:00
|
|
|
class EventChainPreVisitor;
|
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGGraphicsElement SVGAElementBase;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGAElement final : public SVGAElementBase,
|
2015-03-27 21:52:19 +03:00
|
|
|
public Link
|
2009-04-29 08:31:34 +04:00
|
|
|
{
|
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGAElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2013-01-10 09:30:13 +04:00
|
|
|
friend nsresult (::NS_NewSVGAElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2013-12-12 23:30:27 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGAElement, SVGAElementBase)
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
// nsINode interface methods
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override;
|
2014-03-18 08:48:20 +04:00
|
|
|
virtual nsresult PostHandleEvent(
|
2015-03-21 19:28:04 +03:00
|
|
|
EventChainPostVisitor& aVisitor) override;
|
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
// nsIContent
|
2009-11-23 21:48:52 +03:00
|
|
|
virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
|
|
|
|
nsIContent *aBindingParent,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aCompileEventHandlers) override;
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNullParent = true) override;
|
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
|
|
|
|
virtual bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) override;
|
|
|
|
virtual bool IsLink(nsIURI** aURI) const override;
|
|
|
|
virtual void GetLinkTarget(nsAString& aTarget) override;
|
|
|
|
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
|
|
|
|
virtual EventStates IntrinsicState() const override;
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
2011-09-29 10:19:26 +04:00
|
|
|
const nsAString& aValue, bool aNotify)
|
2010-02-24 19:37:02 +03:00
|
|
|
{
|
2012-07-30 18:20:58 +04:00
|
|
|
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
|
2010-02-24 19:37:02 +03:00
|
|
|
}
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
2010-02-24 19:37:02 +03:00
|
|
|
nsIAtom* aPrefix, const nsAString& aValue,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNotify) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNotify) override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
// WebIDL
|
2013-06-15 02:37:27 +04:00
|
|
|
already_AddRefed<SVGAnimatedString> Href();
|
|
|
|
already_AddRefed<SVGAnimatedString> Target();
|
2013-02-19 02:48:53 +04:00
|
|
|
void GetDownload(nsAString & aDownload);
|
|
|
|
void SetDownload(const nsAString & aDownload, ErrorResult& rv);
|
2013-01-10 09:30:13 +04:00
|
|
|
|
2009-04-29 08:31:34 +04:00
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
virtual ~SVGAElement();
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual StringAttributesInfo GetStringInfo() override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
enum { HREF, TARGET };
|
|
|
|
nsSVGString mStringAttributes[2];
|
|
|
|
static StringInfo sStringInfo[2];
|
|
|
|
};
|
2010-05-27 00:01:10 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGAElement_h
|