2001-09-25 04:48:50 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2001-05-12 01:11:38 +04:00
|
|
|
|
2012-06-04 16:32:34 +04:00
|
|
|
#ifndef mozilla_a11y_HTMLImageMapAccessible_h__
|
|
|
|
#define mozilla_a11y_HTMLImageMapAccessible_h__
|
2001-05-12 01:11:38 +04:00
|
|
|
|
2012-06-04 16:32:38 +04:00
|
|
|
#include "HTMLLinkAccessible.h"
|
2012-06-02 15:30:34 +04:00
|
|
|
#include "ImageAccessibleWrap.h"
|
2010-04-06 04:41:28 +04:00
|
|
|
|
2012-06-04 16:32:34 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2010-04-06 04:41:28 +04:00
|
|
|
/**
|
|
|
|
* Used for HTML image maps.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
class HTMLImageMapAccessible final : public ImageAccessibleWrap {
|
2010-04-06 04:41:28 +04:00
|
|
|
public:
|
2012-06-04 16:32:34 +04:00
|
|
|
HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2010-04-06 04:41:28 +04:00
|
|
|
|
|
|
|
// nsISupports and cycle collector
|
2018-02-12 23:44:40 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLImageMapAccessible,
|
|
|
|
ImageAccessibleWrap)
|
2010-04-06 04:41:28 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2018-05-07 22:05:50 +03:00
|
|
|
virtual a11y::role NativeRole() const override;
|
2010-04-06 04:41:28 +04:00
|
|
|
|
2010-09-01 07:26:13 +04:00
|
|
|
// HyperLinkAccessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual uint32_t AnchorCount() override;
|
|
|
|
virtual Accessible* AnchorAt(uint32_t aAnchorIndex) override;
|
2018-05-15 20:19:54 +03:00
|
|
|
virtual already_AddRefed<nsIURI> AnchorURIAt(
|
|
|
|
uint32_t aAnchorIndex) const override;
|
2010-09-01 07:26:13 +04:00
|
|
|
|
2012-03-16 00:16:02 +04:00
|
|
|
/**
|
|
|
|
* Update area children of the image map.
|
|
|
|
*/
|
|
|
|
void UpdateChildAreas(bool aDoFireEvents = true);
|
|
|
|
|
2014-02-11 00:52:34 +04:00
|
|
|
/**
|
|
|
|
* Return accessible of child node.
|
|
|
|
*/
|
|
|
|
Accessible* GetChildAccessibleFor(const nsINode* aNode) const;
|
|
|
|
|
2010-04-06 04:41:28 +04:00
|
|
|
protected:
|
2014-07-09 01:23:18 +04:00
|
|
|
virtual ~HTMLImageMapAccessible() {}
|
2010-04-06 04:41:28 +04:00
|
|
|
};
|
|
|
|
|
2009-10-28 13:42:36 +03:00
|
|
|
/**
|
|
|
|
* Accessible for image map areas - must be child of image.
|
2001-05-12 01:11:38 +04:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
class HTMLAreaAccessible final : public HTMLLinkAccessible {
|
2001-05-12 01:11:38 +04:00
|
|
|
public:
|
2012-06-04 16:32:34 +04:00
|
|
|
HTMLAreaAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-03-06 06:33:33 +03:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Description(nsString& aDescription) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
|
2015-03-21 19:28:04 +03:00
|
|
|
EWhichChildAtPoint aWhichChild) override;
|
|
|
|
virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
|
2009-10-28 13:42:36 +03:00
|
|
|
|
2010-09-01 07:26:13 +04:00
|
|
|
// HyperLinkAccessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual uint32_t StartOffset() override;
|
|
|
|
virtual uint32_t EndOffset() override;
|
2010-09-01 07:26:13 +04:00
|
|
|
|
2016-04-01 04:22:50 +03:00
|
|
|
virtual bool IsAcceptableChild(nsIContent* aEl) const override {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-10-28 13:42:36 +03:00
|
|
|
protected:
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2018-05-15 19:13:02 +03:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) const override;
|
2001-05-12 01:11:38 +04:00
|
|
|
};
|
|
|
|
|
2012-06-04 16:32:34 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Accessible downcasting method
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
inline HTMLImageMapAccessible* Accessible::AsImageMap() {
|
2012-12-18 09:22:26 +04:00
|
|
|
return IsImageMap() ? static_cast<HTMLImageMapAccessible*>(this) : nullptr;
|
2012-06-04 16:32:34 +04:00
|
|
|
}
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-06-02 15:30:34 +04:00
|
|
|
#endif
|