Bumping manifests a=b2g-bump
[gecko.git] / accessible / html / HTMLImageMapAccessible.h
blob3e29ce9d1bbe06757ace994f533bd038c1e33691
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"
13 namespace mozilla {
14 namespace a11y {
16 /**
17 * Used for HTML image maps.
19 class HTMLImageMapAccessible MOZ_FINAL : public ImageAccessibleWrap
21 public:
22 HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
24 // nsISupports and cycle collector
25 NS_DECL_ISUPPORTS_INHERITED
27 // Accessible
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);
35 /**
36 * Update area children of the image map.
38 void UpdateChildAreas(bool aDoFireEvents = true);
40 /**
41 * Return accessible of child node.
43 Accessible* GetChildAccessibleFor(const nsINode* aNode) const;
45 protected:
46 virtual ~HTMLImageMapAccessible() { }
48 // Accessible
49 virtual void CacheChildren();
52 /**
53 * Accessible for image map areas - must be child of image.
55 class HTMLAreaAccessible MOZ_FINAL : public HTMLLinkAccessible
57 public:
59 HTMLAreaAccessible(nsIContent* aContent, DocAccessible* aDoc);
61 // Accessible
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();
71 protected:
72 // Accessible
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;
87 } // namespace a11y
88 } // namespace mozilla
90 #endif