2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; 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/. */
|
2012-06-09 01:21:07 -07:00
|
|
|
|
|
|
|
#ifndef mozilla_a11y_XULListboxAccessible_h__
|
|
|
|
#define mozilla_a11y_XULListboxAccessible_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
#include "BaseAccessibles.h"
|
2012-03-27 17:53:58 -07:00
|
|
|
#include "TableAccessible.h"
|
2012-07-24 08:58:25 -07:00
|
|
|
#include "TableCellAccessible.h"
|
2012-03-27 17:53:58 -07:00
|
|
|
#include "xpcAccessibleTable.h"
|
2012-07-24 08:58:25 -07:00
|
|
|
#include "xpcAccessibleTableCell.h"
|
2012-06-09 01:21:07 -07:00
|
|
|
#include "XULMenuAccessible.h"
|
2000-12-31 16:12:15 -08:00
|
|
|
#include "XULSelectControlAccessible.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-09 01:21:07 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
2012-06-09 01:21:07 -07:00
|
|
|
* XULColumAccessible are accessible for list and tree columns elements
|
2007-09-18 20:31:14 -07:00
|
|
|
* (xul:treecols and xul:listcols).
|
|
|
|
*/
|
2012-06-09 01:21:07 -07:00
|
|
|
class XULColumAccessible : public AccessibleWrap
|
2007-09-18 20:31:14 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 01:21:07 -07:00
|
|
|
XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-09-18 20:31:14 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2007-09-18 20:31:14 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-09 01:21:07 -07:00
|
|
|
* XULColumnItemAccessible are accessibles for list and tree column elements
|
2007-09-18 20:31:14 -07:00
|
|
|
* (xul:listcol and xul:treecol).
|
|
|
|
*/
|
2012-06-09 01:21:07 -07:00
|
|
|
class XULColumnItemAccessible : public LeafAccessible
|
2007-09-18 20:31:14 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 01:21:07 -07:00
|
|
|
XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-09-18 20:31:14 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2008-10-10 05:26:55 -07:00
|
|
|
|
2011-06-05 12:35:43 -07:00
|
|
|
// ActionAccessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual uint8_t ActionCount() override;
|
|
|
|
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
|
|
|
|
virtual bool DoAction(uint8_t aIndex) override;
|
2011-06-05 12:35:43 -07:00
|
|
|
|
2007-09-18 20:31:14 -07:00
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/*
|
|
|
|
* A class the represents the XUL Listbox widget.
|
|
|
|
*/
|
2012-06-09 01:21:07 -07:00
|
|
|
class XULListboxAccessible : public XULSelectControlAccessible,
|
|
|
|
public TableAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 01:21:07 -07:00
|
|
|
XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-04-19 14:32:11 -07:00
|
|
|
// TableAccessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual uint32_t ColCount() override;
|
|
|
|
virtual uint32_t RowCount() override;
|
|
|
|
virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) override;
|
|
|
|
virtual bool IsColSelected(uint32_t aColIdx) override;
|
|
|
|
virtual bool IsRowSelected(uint32_t aRowIdx) override;
|
|
|
|
virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) override;
|
|
|
|
virtual uint32_t SelectedCellCount() override;
|
|
|
|
virtual uint32_t SelectedColCount() override;
|
|
|
|
virtual uint32_t SelectedRowCount() override;
|
|
|
|
virtual void SelectedCells(nsTArray<Accessible*>* aCells) override;
|
|
|
|
virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) override;
|
|
|
|
virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) override;
|
|
|
|
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) override;
|
|
|
|
virtual void SelectRow(uint32_t aRowIdx) override;
|
|
|
|
virtual void UnselectRow(uint32_t aRowIdx) override;
|
|
|
|
virtual Accessible* AsAccessible() override { return this; }
|
2012-04-19 14:32:11 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void Value(nsString& aValue) override;
|
|
|
|
virtual TableAccessible* AsTable() override { return this; }
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2008-11-03 19:37:46 -08:00
|
|
|
|
2011-09-27 18:46:11 -07:00
|
|
|
// Widgets
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsWidget() const override;
|
|
|
|
virtual bool IsActiveWidget() const override;
|
|
|
|
virtual bool AreItemsOperable() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual Accessible* ContainerWidget() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
2008-02-19 01:07:35 -08:00
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~XULListboxAccessible() {}
|
|
|
|
|
2014-10-21 17:49:28 -07:00
|
|
|
bool IsMulticolumn() { return ColCount() > 1; }
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-06-09 01:21:07 -07:00
|
|
|
* Listitems -- used in listboxes
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2012-06-09 01:21:07 -07:00
|
|
|
class XULListitemAccessible : public XULMenuitemAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { eAction_Click = 0 };
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2012-06-09 01:21:07 -07:00
|
|
|
|
|
|
|
XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void Description(nsString& aDesc) override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
|
|
|
virtual uint64_t NativeInteractiveState() const override;
|
|
|
|
virtual bool CanHaveAnonChildren() override;
|
2008-02-19 05:47:19 -08:00
|
|
|
|
2014-09-16 10:30:23 -07:00
|
|
|
// Actions
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void ActionNameAt(uint8_t index, nsAString& aName) override;
|
2014-09-16 10:30:23 -07:00
|
|
|
|
2011-09-27 18:46:11 -07:00
|
|
|
// Widgets
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual Accessible* ContainerWidget() const override;
|
2011-09-27 18:46:11 -07:00
|
|
|
|
2008-02-19 01:07:35 -08:00
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~XULListitemAccessible();
|
|
|
|
|
2012-10-13 21:18:39 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) override;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
|
|
|
// XULListitemAccessible
|
|
|
|
|
2010-04-23 17:40:51 -07:00
|
|
|
/**
|
|
|
|
* Return listbox accessible for the listitem.
|
|
|
|
*/
|
2014-09-16 10:30:23 -07:00
|
|
|
Accessible* GetListAccessible() const;
|
2008-02-19 01:07:35 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIsCheckbox;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2008-02-19 01:07:35 -08:00
|
|
|
/**
|
|
|
|
* Class represents xul:listcell.
|
|
|
|
*/
|
2012-06-09 01:21:07 -07:00
|
|
|
class XULListCellAccessible : public HyperTextAccessibleWrap,
|
2014-10-21 17:49:28 -07:00
|
|
|
public TableCellAccessible
|
2008-02-19 01:07:35 -08:00
|
|
|
{
|
|
|
|
public:
|
2012-06-09 01:21:07 -07:00
|
|
|
XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2008-02-19 01:07:35 -08:00
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2008-10-31 20:58:07 -07:00
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual TableCellAccessible* AsTableCell() override { return this; }
|
|
|
|
virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
2012-08-08 23:24:31 -07:00
|
|
|
|
|
|
|
// TableCellAccessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual TableAccessible* Table() const override;
|
|
|
|
virtual uint32_t ColIdx() const override;
|
|
|
|
virtual uint32_t RowIdx() const override;
|
|
|
|
virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) override;
|
|
|
|
virtual bool Selected() override;
|
2014-07-08 14:23:18 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~XULListCellAccessible() {}
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2012-06-09 01:21:07 -07:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|