2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
#ifndef mozilla_a11y_BaseAccessibles_h__
|
|
|
|
#define mozilla_a11y_BaseAccessibles_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
#include "AccessibleWrap.h"
|
2012-05-31 01:04:41 -07:00
|
|
|
#include "HyperTextAccessibleWrap.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIContent.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file contains a number of classes that are used as base
|
|
|
|
* classes for the different accessibility implementations of
|
|
|
|
* the HTML and XUL widget sets. --jgaunt
|
|
|
|
*/
|
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
|
|
|
/**
|
2007-03-22 10:30:00 -07:00
|
|
|
* Leaf version of DOM Accessible -- has no children
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class LeafAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-08-18 19:14:50 -07:00
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
LeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2009-05-11 03:57:28 -07:00
|
|
|
|
|
|
|
// nsISupports
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-05-11 03:57:28 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
|
2012-05-28 18:18:45 -07:00
|
|
|
EWhichChildAtPoint aWhichChild);
|
2009-10-28 03:42:36 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2009-10-28 03:42:36 -07:00
|
|
|
virtual void CacheChildren();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2009-10-26 17:58:36 -07:00
|
|
|
* Used for text or image accessible nodes contained by link accessibles or
|
|
|
|
* accessibles for nodes with registered click event handler. It knows how to
|
|
|
|
* report the state of the host link (traveled or not) and can activate (click)
|
|
|
|
* the host accessible programmatically.
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class LinkableAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { eAction_Jump = 0 };
|
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
LinkableAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-03-18 04:37:12 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2008-03-18 04:37:12 -07:00
|
|
|
|
|
|
|
// nsIAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
|
|
|
|
NS_IMETHOD DoAction(uint8_t index);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD TakeFocus();
|
2008-03-18 04:37:12 -07:00
|
|
|
|
2008-10-31 20:58:07 -07:00
|
|
|
// nsAccessNode
|
2010-06-11 21:04:35 -07:00
|
|
|
virtual void Shutdown();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-04-09 02:48:41 -07:00
|
|
|
virtual void Value(nsString& aValue);
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint64_t NativeLinkState() const;
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2011-07-19 01:30:24 -07:00
|
|
|
// ActionAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint8_t ActionCount();
|
2011-07-19 01:30:24 -07:00
|
|
|
virtual KeyBinding AccessKey() const;
|
|
|
|
|
2010-08-31 20:26:13 -07:00
|
|
|
// HyperLinkAccessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
|
2010-08-31 20:26:13 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent);
|
2012-03-23 05:21:31 -07:00
|
|
|
virtual void UnbindFromParent();
|
2010-11-12 11:01:04 -08:00
|
|
|
|
2008-03-18 04:37:12 -07:00
|
|
|
/**
|
2011-05-21 00:00:07 -07:00
|
|
|
* Parent accessible that provides an action for this linkable accessible.
|
2008-03-18 04:37:12 -07:00
|
|
|
*/
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible* mActionAcc;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsLink;
|
|
|
|
bool mIsOnclick;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A simple accessible that gets its enumerated role passed into constructor.
|
2012-06-04 05:32:29 -07:00
|
|
|
*/
|
|
|
|
class EnumRoleAccessible : public AccessibleWrap
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-04 05:32:29 -07:00
|
|
|
EnumRoleAccessible(nsIContent* aContent, DocAccessible* aDoc,
|
|
|
|
a11y::role aRole);
|
|
|
|
virtual ~EnumRoleAccessible() { }
|
2009-03-07 07:38:58 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-03-07 07:38:58 -08:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2012-06-04 05:32:29 -07:00
|
|
|
virtual a11y::role NativeRole();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
2012-06-04 05:32:29 -07:00
|
|
|
a11y::role mRole;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|