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