1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_a11y_HTMLImageMapAccessible_h__
7 #define mozilla_a11y_HTMLImageMapAccessible_h__
9 #include "HTMLLinkAccessible.h"
10 #include "ImageAccessibleWrap.h"
11 #include "nsIDOMHTMLMapElement.h"
17 * Used for HTML image maps.
19 class HTMLImageMapAccessible MOZ_FINAL
: public ImageAccessibleWrap
22 HTMLImageMapAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
24 // nsISupports and cycle collector
25 NS_DECL_ISUPPORTS_INHERITED
28 virtual a11y::role
NativeRole();
30 // HyperLinkAccessible
31 virtual uint32_t AnchorCount();
32 virtual Accessible
* AnchorAt(uint32_t aAnchorIndex
);
33 virtual already_AddRefed
<nsIURI
> AnchorURIAt(uint32_t aAnchorIndex
);
36 * Update area children of the image map.
38 void UpdateChildAreas(bool aDoFireEvents
= true);
41 * Return accessible of child node.
43 Accessible
* GetChildAccessibleFor(const nsINode
* aNode
) const;
46 virtual ~HTMLImageMapAccessible() { }
49 virtual void CacheChildren();
53 * Accessible for image map areas - must be child of image.
55 class HTMLAreaAccessible MOZ_FINAL
: public HTMLLinkAccessible
59 HTMLAreaAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
62 virtual void Description(nsString
& aDescription
);
63 virtual Accessible
* ChildAtPoint(int32_t aX
, int32_t aY
,
64 EWhichChildAtPoint aWhichChild
);
65 virtual void GetBoundsRect(nsRect
& aBounds
, nsIFrame
** aBoundingFrame
);
67 // HyperLinkAccessible
68 virtual uint32_t StartOffset();
69 virtual uint32_t EndOffset();
73 virtual ENameValueFlag
NativeName(nsString
& aName
) MOZ_OVERRIDE
;
74 virtual void CacheChildren();
78 ////////////////////////////////////////////////////////////////////////////////
79 // Accessible downcasting method
81 inline HTMLImageMapAccessible
*
82 Accessible::AsImageMap()
84 return IsImageMap() ? static_cast<HTMLImageMapAccessible
*>(this) : nullptr;
88 } // namespace mozilla