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
|
|
|
#include "nsIDOMHTMLMapElement.h"
|
|
|
|
|
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.
|
|
|
|
*/
|
2014-08-05 21:33:55 +04:00
|
|
|
class HTMLImageMapAccessible MOZ_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
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2014-09-16 21:30:23 +04:00
|
|
|
virtual a11y::role NativeRole() MOZ_OVERRIDE;
|
2010-04-06 04:41:28 +04:00
|
|
|
|
2010-09-01 07:26:13 +04:00
|
|
|
// HyperLinkAccessible
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual uint32_t AnchorCount();
|
|
|
|
virtual Accessible* AnchorAt(uint32_t aAnchorIndex);
|
|
|
|
virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
|
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
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2010-04-06 04:41:28 +04:00
|
|
|
virtual void CacheChildren();
|
|
|
|
};
|
|
|
|
|
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
|
|
|
*/
|
2014-08-05 21:33:55 +04:00
|
|
|
class HTMLAreaAccessible MOZ_FINAL : public HTMLLinkAccessible
|
2001-05-12 01:11:38 +04:00
|
|
|
{
|
|
|
|
public:
|
2010-08-19 06:14:50 +04:00
|
|
|
|
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
|
2011-04-23 17:14:05 +04:00
|
|
|
virtual void Description(nsString& aDescription);
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
|
2012-05-29 05:18:45 +04:00
|
|
|
EWhichChildAtPoint aWhichChild);
|
2014-09-16 21:30:23 +04:00
|
|
|
virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
|
2009-10-28 13:42:36 +03:00
|
|
|
|
2010-09-01 07:26:13 +04:00
|
|
|
// HyperLinkAccessible
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual uint32_t StartOffset();
|
|
|
|
virtual uint32_t EndOffset();
|
2010-09-01 07:26:13 +04:00
|
|
|
|
2009-10-28 13:42:36 +03:00
|
|
|
protected:
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2012-10-14 08:18:39 +04:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
|
2009-10-28 13:42:36 +03:00
|
|
|
virtual void CacheChildren();
|
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*
|
2012-06-04 16:32:34 +04:00
|
|
|
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
|