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,
|
|
|
|
already_AddRefed<nsINodeInfo> aNodeInfo);
|
2009-04-28 21:31:34 -07:00
|
|
|
|
2013-01-09 21:30:13 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGGraphicsElement SVGAElementBase;
|
|
|
|
|
|
|
|
class SVGAElement MOZ_FINAL : public SVGAElementBase,
|
|
|
|
public Link
|
2009-04-28 21:31:34 -07:00
|
|
|
{
|
|
|
|
protected:
|
2013-01-09 21:30:13 -08:00
|
|
|
SVGAElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
|
|
|
friend nsresult (::NS_NewSVGAElement(nsIContent **aResult,
|
|
|
|
already_AddRefed<nsINodeInfo> aNodeInfo));
|
2013-04-25 09:29:54 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx,
|
|
|
|
JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
|
2009-04-28 21:31:34 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsINode interface methods
|
2013-05-07 22:11:24 -07:00
|
|
|
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult Clone(nsINodeInfo *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;
|
|
|
|
virtual bool IsFocusable(int32_t *aTabIndex = nullptr, bool aWithMouse = false) MOZ_OVERRIDE;
|
|
|
|
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
|
|
|
|
virtual void GetLinkTarget(nsAString& aTarget) MOZ_OVERRIDE;
|
|
|
|
virtual already_AddRefed<nsIURI> GetHrefURI() const MOZ_OVERRIDE;
|
|
|
|
virtual nsEventStates 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:
|
|
|
|
|
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
|