no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / accessible / html / HTMLImageMapAccessible.h
blob15c56b44dedec9b061c67ae20297fe8e52d83fd4
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 "ImageAccessible.h"
12 namespace mozilla {
13 namespace a11y {
15 /**
16 * Used for HTML image maps.
18 class HTMLImageMapAccessible final : public ImageAccessible {
19 public:
20 HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
22 // nsISupports and cycle collector
23 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLImageMapAccessible, ImageAccessible)
25 // LocalAccessible
26 virtual a11y::role NativeRole() const override;
28 /**
29 * Update area children of the image map.
31 void UpdateChildAreas(bool aDoFireEvents = true);
33 /**
34 * Return accessible of child node.
36 LocalAccessible* GetChildAccessibleFor(const nsINode* aNode) const;
38 protected:
39 virtual ~HTMLImageMapAccessible() {}
42 /**
43 * Accessible for image map areas - must be child of image.
45 class HTMLAreaAccessible final : public HTMLLinkAccessible {
46 public:
47 HTMLAreaAccessible(nsIContent* aContent, DocAccessible* aDoc);
49 // LocalAccessible
50 virtual void Description(nsString& aDescription) const override;
51 virtual LocalAccessible* LocalChildAtPoint(
52 int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) override;
53 virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
54 virtual nsRect ParentRelativeBounds() override;
56 // HyperLinkAccessible
57 virtual uint32_t StartOffset() override;
58 virtual uint32_t EndOffset() override;
60 virtual bool IsAcceptableChild(nsIContent* aEl) const override {
61 return false;
64 // LocalAccessible
65 virtual role NativeRole() const override;
67 protected:
68 // LocalAccessible
69 virtual ENameValueFlag NativeName(nsString& aName) const override;
72 ////////////////////////////////////////////////////////////////////////////////
73 // LocalAccessible downcasting method
75 inline HTMLImageMapAccessible* LocalAccessible::AsImageMap() {
76 return IsImageMap() ? static_cast<HTMLImageMapAccessible*>(this) : nullptr;
79 } // namespace a11y
80 } // namespace mozilla
82 #endif